<?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>Makl Ndrix &#187; ghetto</title>
	<atom:link href="http://michaelhendrickx.com/tag/ghetto/feed" rel="self" type="application/rss+xml" />
	<link>http://michaelhendrickx.com</link>
	<description>may contain traces of nuts</description>
	<lastBuildDate>Thu, 17 May 2012 21:03:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<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 [...]<div class="addthis_toolbox addthis_default_style " addthis:url='http://michaelhendrickx.com/201005_changing-nsclient-configurations-in-bulk.html' addthis:title='Changing NSClient++ configurations in bulk'  ><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a><a class="addthis_button_tweet"></a><a class="addthis_counter addthis_pill_style"></a></div>]]></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>
	</channel>
</rss>

