<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Extempore &#187; nagios</title>
	<atom:link href="http://michaelhendrickx.com/tag/nagios/feed" rel="self" type="application/rss+xml" />
	<link>http://michaelhendrickx.com</link>
	<description>random ramblings of the disturbed mind</description>
	<lastBuildDate>Tue, 20 Jul 2010 05:39:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing NSClient++ configurations in bulk</title>
		<link>http://michaelhendrickx.com/201005_changing-nsclient-configurations-in-bulk.html</link>
		<comments>http://michaelhendrickx.com/201005_changing-nsclient-configurations-in-bulk.html#comments</comments>
		<pubDate>Tue, 11 May 2010 10:20:55 +0000</pubDate>
		<dc:creator>Michael Hendrickx</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[batch file]]></category>
		<category><![CDATA[ghetto]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[nsclient]]></category>

		<guid isPermaLink="false">http://michaelhendrickx.com/?p=277</guid>
		<description><![CDATA[At work, we started using Nagios to monitor the hosts and their services for any issues, so we can, proactively, take actions when we see trouble coming (hard disk that fills up rapidly, restarting services, etc).
Recently we change the Nagios host to another IP address and found ourselves having to change a few dozen NSClient.ini [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://michaelhendrickx.com/wp-content/uploads/2010/05/nagios.jpg" alt="" title="nagios" width="255" height="172" align="right" />At <a href="http://www.nakheel.com">work</a>, we started using Nagios to monitor the hosts and their services for any issues, so we can, proactively, take actions when we see trouble coming (hard disk that fills up rapidly, restarting services, etc).</p>
<p>Recently we change the Nagios host to another IP address and found ourselves having to change a few dozen NSClient.ini files on the server.  Even though we use DNS names as monitoring host (only nsclient access on port 12489/tcp is allowed from a certain host), NSClient by default caches the IP address (Using <strong>cache_allowed_hosts</strong>, which is set to &#8220;1&#8243; by default) so we were bound to change quite some files.</p>
<p>To do this, we have to do the following:<span id="more-277"></span></p>
<ul>
<li>stop the nsclient service</li>
<li>overwrite the nsclient.ini file</li>
<li>start the nsclient service</li>
</ul>
<p>For reasons i cannot disclose, this could not be done using any group policies.  So we went the ghetto batch way:</p>
<p><code><br />
@psexec \\%1 "C:\Program Files\NSClient++\NSclient++.exe" -uninstall<br />
@xcopy /Y C:\tool\nagios\nsclient\* "\\%1\c$\program files\nsclient++\"<br />
@psexec \\%1 "C:\Program Files\NSClient++\NSclient++.exe" -install<br />
@psexec \\%1 "C:\Program Files\NSClient++\NSclient++.exe" -start<br />
@echo Finished %1<br />
</code></p>
<p>This assumes you have nsclient++ already, which is an awesome piece of software that you can grab from <a href="http://nsclient.org/">nsclient.org</a>, and that you have <a href="http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx">psexec</a> installed to execute commands.</p>
<p>Using this script, you can just run <strong>C:\tool\nagios\update_nsc.bat server_name</strong> to have the server monitored again.</p>
<p>Thank you,<br />
Michael</p>
]]></content:encoded>
			<wfw:commentRss>http://michaelhendrickx.com/201005_changing-nsclient-configurations-in-bulk.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>nnscfgmaker.sh: a nagios/nsclient++ cfg maker</title>
		<link>http://michaelhendrickx.com/201001_nnscfgmaker-sh-a-nagiosnsclient-cfg-maker.html</link>
		<comments>http://michaelhendrickx.com/201001_nnscfgmaker-sh-a-nagiosnsclient-cfg-maker.html#comments</comments>
		<pubDate>Thu, 28 Jan 2010 14:27:42 +0000</pubDate>
		<dc:creator>Michael Hendrickx</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[nagios]]></category>
		<category><![CDATA[zenoss]]></category>

		<guid isPermaLink="false">http://michaelhendrickx.com/?p=241</guid>
		<description><![CDATA[Dear all,
We are in the process of changing the monitoring system on part of our network from Zenoss to Nagios.  This is not a Zenoss vs. Nagios debate, as both products are awesome and do the things they are designed for very well.  We (Christian and myself) use a combination of Cacti for [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://michaelhendrickx.com/wp-content/uploads/2010/01/nagios.jpg" alt="" title="nagios" width="150" height="114" align="right" />Dear all,</p>
<p>We are in the process of changing the monitoring system on part of our network from Zenoss to Nagios.  This is not a Zenoss vs. Nagios debate, as both products are awesome and do the things they are designed for very well.  We (<a href="http://ae.linkedin.com/in/certifiedgeek">Christian</a> and myself) use a combination of <a href="http://www.cacti.net">Cacti</a> for bandwith monitoring and <a href="http://www.zenoss.com">Zenoss</a> for server and device monitoring.  Now, recently we decided to change the latter to <a href="http://www.nagios.org/">Nagios</a>.  It is know for its &#8220;great deal of flexibility when integrating Nagios into their environment&#8221; (Galstad, 2005)</p>
<p>As Zenoss was configured using <a href="http://www.snmp-informant.com/">SNMP Informant</a> to grab information about the MS Windows servers (available disk space, CPU load, etc) and Nagios uses <a href="http://nsclient.org/">NSClient++</a>; one of the time consuming tasks was getting the client on the server (thank you domain <img src='http://michaelhendrickx.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) and configuring each and every server on the Nagios server.  I guess there should be some sort of discovery tool for Nagios, but I couldn&#8217;t directly find one.  </p>
<p>In order to tackle the copy-pasting for a few dozen config files, and to brush up my bash scripting again, I wrote the <strong>Nagios Nsclient++ cfg maker</strong><span id="more-241"></span>, yeah, what&#8217;s in a name eh.  This client enumerates the target server about what is installed and makes a CFG file based on that.  Oh yeah, we&#8217;re using nagios with its text files, not the SQL version.</p>
<p>You can download it <a href='http://michaelhendrickx.com/wp-content/uploads/2010/01/nnscfgmaker.sh' >here (bash script)</a>.  As it&#8217;s GPL&#8217;d, feel free to change and redistribute it.  As we mainly house HP servers, APC UPS&#8217;s and most of them run Windows (for now, <em>evil laugh</em>), so it&#8217;s a bit windows/hp minded.</p>
<p>The syntax is very easy, just run the script with the hostname of the server that you want to &#8220;enumerate&#8221;.  Doing that, you&#8217;ll have something similar as the output below:</p>
<pre>
mike@mon:/usr/local/nagios/etc/servers$ ./nnscfgmaker.sh server2
Nagios NSclient++ (check_nt) CFG maker

 + logfile: server2.cfg
 + pinging the server.. ok
 + checking of nsclient++ is installed
 + adding hdd c:\
 + adding hdd e:\
 + adding hdd f:\
 + adding hdd g:\
 + adding hdd h:\
 + adding hdd i:\
 + adding process: MS SQL Server (sqlservr.exe)
 + adding service: Automatic Updates (wuauserv)
 + adding service: DNS Client (DNSCache)
 + adding service: Event Log (Eventlog)
 + adding service: Messenger (Messenger)
 + adding service: Server Service (lanmanserver)
 + adding service: Windows Time (w32time)
 + adding service: SNMP service (SNMP)
 + adding service: HP OpenView Ctrl Service (ovctrl)
 + adding service: Backup Exec Server (BackupExecRPCService)
 + adding service: HP Insight Server Agent (CqMgServ)
 + adding service: HP Insight NIC Agent (CpqNicMgmt)
 + adding service: HP Insight Storage Agent (CqMgStor)
 + adding service: TrendMicro OfficeScan NT Listener (tmlisten)
 + adding service: Trendmicro Antivirus RealTime Scan (ntrtscan)
 - done

mike@mon:/usr/local/nagios/etc/servers$
</pre>
<p>This creates a files called server2.cfg, which Nagios can read and process.</p>
<p>Hope you like it, let me know if you have any questions or comments.</p>
<p>Take care,<br />
Michael</p>
<p><span style="color:#808080">Ethan Galstad (2005), Nagios. [online] Available from: <a href="http://archive.fosdem.org/2005/index/interviews/interviews_galstad.html">http://archive.fosdem.org/2005/index/interviews/interviews_galstad.html</a> (Accessed: 28 Jan 2010)</span></p>
]]></content:encoded>
			<wfw:commentRss>http://michaelhendrickx.com/201001_nnscfgmaker-sh-a-nagiosnsclient-cfg-maker.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
