<?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>Carlos&#039; Corner &#187; monitoring</title>
	<atom:link href="http://cars.lostroncos.org/category/monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://cars.lostroncos.org</link>
	<description>The tired geek-dad in the corner</description>
	<lastBuildDate>Wed, 12 May 2010 19:46:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple Neverfail Monitoring with Zabbix part 2</title>
		<link>http://cars.lostroncos.org/2010/02/23/simple-neverfail-monitoring-with-zabbix-part-2/</link>
		<comments>http://cars.lostroncos.org/2010/02/23/simple-neverfail-monitoring-with-zabbix-part-2/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:53:36 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[neverfail]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[neverfail for Exchange]]></category>
		<category><![CDATA[neverfail heartbeat]]></category>
		<category><![CDATA[reg_dword_big_endian]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=363</guid>
		<description><![CDATA[Recap
<p>So in the previous post I put together a simple script for getting the data out of a specified registry entry that handled the REG DWORD BIG ENDIAN data type.  In this one I&#8217;ll go over the general process of getting the registry based perf data into Zabbix and setting up alerting based on it.</p>
Setting [...]]]></description>
			<content:encoded><![CDATA[<h2>Recap</h2>
<p>So in the<a href="http://cars.lostroncos.org/2009/05/31/simple-monitoring-of-neverfail-with-zabbix-part-1/"> previous post</a> I put together a simple script for getting the data out of a specified registry entry that handled the REG DWORD BIG ENDIAN data type.  In this one I&#8217;ll go over the general process of getting the registry based perf data into Zabbix and setting up alerting based on it.</p>
<h2>Setting up Zabbix</h2>
<p>I won&#8217;t cover the actual installation of Zabbix here, but before we can put data into Zabbix we need to add the counters/items that I will be populating in the future. The first thing I need to do is determine exactly what those counters are and which of the nodes they need to come from.</p>
<table border="1">
<tbody>
<tr>
<th>Registry Path/Value</th>
<th>Node</th>
<th>Description</th>
</tr>
<tr>
<td>\Neverfail\R2\Performance\CurrentThroughput</td>
<td>Active</td>
<td>Nominally the throughput  of data between the two nodes</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\MegaBytessent</td>
<td>Active</td>
<td># of Megabytes sent</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\MegabytesReceived</td>
<td>Active</td>
<td># of MB received</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\OldestUnsafeupdatequeueentry</td>
<td>Active</td>
<td>Age of the oldest item in the Unsafe Queue</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\UnsafeUpdateQueueSize</td>
<td>Active</td>
<td>How much data is in the Unsafe Queue waiting to be passed to the passive node</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\UnsafeUpdateQueueSize (dup)</td>
<td>Active</td>
<td>Same as above but I want to measure the rate of growth as a possible factor in alerting</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\KBDispatchedFromUnsafeQueue</td>
<td>Active</td>
<td>How much total data has been sent from the unsafe queue</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\Oldestsafeupdatequeueentry</td>
<td>Passive</td>
<td>The age of the oldest item in the safe queue</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\safeUpdateQueueSize</td>
<td>Passive</td>
<td>Size of the Safe Queue</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\safeUpdateQueueSize(dup)</td>
<td>Passive</td>
<td>Same as above but I want to measure the rate of growth as a possible factor in alerting</td>
</tr>
<tr>
<td>\Neverfail\R2\Performance\KBDispatchedFromsafeQueue</td>
<td>Passive</td>
<td>How much total data has been written from the Safe Queue</td>
</tr>
<tr>
<td>\JavaSoft\Prefs\Neverfail\current\/Registry/State/Manager\/Status\/Value</td>
<td>Active</td>
<td>Current status of the registry synchronization.</td>
</tr>
<tr>
<td>\JavaSoft\Prefs\Neverfail\current\/New/File/State/Mgr\/Synchronization/Status\/Tag</td>
<td>Active</td>
<td>Current file synchronization status.</td>
</tr>
<tr>
<td>\JavaSoft\Prefs\Neverfail\current\/Controller\/Is/Primary/Server</td>
<td>Active</td>
<td>Is the active server the primary or not. From this I can tell which node is active.</td>
</tr>
</tbody>
</table>
<p>Because I have multiple Neverfail clusters in my environment I will create a template in Zabbix that has all the necessary counters associated with it that I can then apply to the hosts rather than adding them manually to each host.  Since a host can have multiple templates assigned to it I&#8217;ll also include a new &#8220;application&#8221; called Neverfail to help with separating Neverfail counters from any other counters that might be associated with a host (ex: Exchange counters).</p>
<p>To help with some of the drudgery associated with manually creating all the items, I&#8217;ve provided  <a href="http://cars.home.lostroncos.org/wp-uploads/2010/02/zbx_Template_NeverfailCluster.xml">a version of the template</a> that can simply be imported into Zabbix. The template includes all of the counters from above as well as a couple of basic triggers for alerting.</p>
<p>Here are a couple of short videos that walk through manually creating a template, and importing the one I&#8217;ve provided.</p>
<table border="0" width="550">
<tbody>
<tr>
<td><a href="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_create_template.swf" target="_blank"><img class="alignnone size-full wp-image-493" title="Creating a template" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/create_video.png" alt="Creating a template" /><br />
Creating a template</a></td>
<td><a href="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_import_and_create.swf" target="_blank"><img class="alignnone size-full wp-image-493" title="Importing a template" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/import_video.png" alt="Importing a template" /><br />
Importing the Neverfail Template into Zabbix</a></td>
</tr>
</tbody>
</table>
<p>Sharp eyes might notice that I&#8217;m capturing  bothUnsafeUpdateQueueSize and safeUpdateQueueSize twice.  In doing so these values are being treated differently. The first is a simple measurement of how much data is in the queue.</p>
<h2>About Zabbix_sender</h2>
<p>Now turning our attention to how we get the info into Zabbix let&#8217;s look at Zabbix_sender.  It&#8217;s available a pre-compiled binary for Windows from <a href="http://www.zabbix.com/download.php">Zabbix&#8217;s website</a>. Getting it ready is as simple as unzipping the download and putting the executable somewhere. By running <em>zabbix_sender -h</em> we can see it can take a number of options.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\Temp&amp;gt;zabbix_sender -h<br />
ZABBIX send v1.6.2 (16 January 2009)<br />
<br />
usage: zabbix_sender [-Vhv] {[-zpsI] -ko | [-zpI] -i &amp;lt;file&amp;gt;} [-c &amp;lt;file&amp;gt;]<br />
<br />
Options:<br />
-c Specify configuration file<br />
-z Hostname or IP address of ZABBIX Server.<br />
-p Specify port number of server trapper running on the server. Default is 10051.<br />
-s Specify hostname or IP address of a host.<br />
-I Specify source IP address<br />
-k Specify metric name (key) we want to send.<br />
-o Specify value of the key.<br />
-i<br />
<br />
&lt;input type=&quot;text&quot; /&gt; Load values from input file.<br />
Each line of file contains:<br />
.<br />
-v Verbose mode<br />
Other options:<br />
-h Give this help.<br />
-V Display version number.</div></div>
<p>The ones I use  are -s, -z, -k and -o.  So a typical command line for me would look something like:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C:\temp\Zabbix_sender -z zabbix.crtcorp.com -s neverfail01 -k&quot;nf_cluster[file_sync_status]&quot; -o &quot;/Synchronized&quot;</div></div>
<p>Breaking down the command line:</p>
<ul>
<li><em><strong>zabbix.crtcorp.com</strong></em> is the Zabbix server we&#8217;re sending this data to</li>
<li><strong><em>neverfail01</em></strong> is the Neverfail node we&#8217;re sending information about</li>
<li>the key for the Zabbix item (i.e. counter) we want the information associated with is <strong><em>nf_cluster[file_sync_status]</em></strong>;</li>
<li>the value we want in the key is  &#8221;<strong><em>/Synchronized</em></strong>&#8220;</li>
</ul>
<p>In the example the value we&#8217;re putting into Zabbix is a string rather than a numerical value. Here&#8217;s an example with a numeric value being put into Zabbix:</p>
<p>C:\temp\Zabbix_sender -z zabbix.crtcorp.com -s neverfail01 -k&#8221;nf_cluster[throughput]&#8221; -o &#8220;103453&#8243;</p>
<p>Here we&#8217;re specifying the item with key <strong><em>nf_cluster[throughput]</em></strong> and giving it a value of <strong><em>103453</em></strong>.</p>
<h3>Adding Zabbix_Sender</h3>
<p>Now what I needed to do is to combine the script I wrote earlier with zabbix_sender to actually put the registry data into Zabbix. So  I added a new function to the GetRegValue.vbs script to execute the actual zabbix_send. It is pretty straightforward it builds a formulaic command line and then executes it. You&#8217;ll notice there is no error checking.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">'###################################################################################<br />
Function Zabbix_Send(ZabbixKey,Value)<br />
Dim WshShell, oExec, CommandLine<br />
Set WshShell = CreateObject(&quot;WScript.Shell&quot;)<br />
'Build Our Command line so we can also echo it to console<br />
'Ex zbx send cmd line = C:\temp\Zabbix_sender -z&quot;wv-zabbix-01&quot; -s&quot;neverfail01&quot; -k&quot;nf_cluster[file_sync_status]&quot; -o &quot;/Synchronized&quot;<br />
CommandLine = ZBXSend &amp;amp; &quot; -v -z&quot;&quot;&quot; &amp;amp; ZBXServer &amp;amp; &quot;&quot;&quot; -s&quot;&quot;&quot; &amp;amp; ZBXClient &amp;amp; &quot;&quot;&quot; -k&quot;&quot;&quot; &amp;amp; ZabbixKey &amp;amp; &quot;&quot;&quot; -o &quot;&quot;&quot; &amp;amp; Value &amp;amp; &quot;&quot;&quot;&quot;<br />
WScript.Echo &quot;Commandline is [&quot; &amp;amp; CommandLine &amp;amp; &quot;]&quot;<br />
'Execute our command line<br />
Set oExec = WshShell.Exec(CommandLine)<br />
End Function</div></div>
<p>The next step is to modify the main body of the original GetRegValue script to turn it into a function. I then changed the WScript.Echos so that we were returning the registry value rather than simply writing it to the console.  (WScript.Echo HexToDec(HexValue) -&gt; GetRegValue = HexToDec(HexValue) , Wscript.Echo strValue -&gt; GetRegValue=strValue, and so on).  At the end we have this script which is good for reading <strong><em>one</em></strong> specified registry value and then inserting it into Zabbix.</p>
<p>Since there are a number of values we want to put into Zabbix we need to think about how to approach this given that the script only handles one value at a time.  What I settled on was a a batch file that used a<strong><em> for</em></strong> loop to go through a file with a list of registry based perf counters related to Neverfail.  The script as it now stands needs three arguments passed to it. It needs the ZabbixKey, the registry key path, and the registry value .  For values I want to get from the passive node the registry path needs to include the private IP address of the passive node (ex: \\10.0.0.2\HKLM\Software\Neverfail\R2\Performance) so that reg.exe knows where to go get them from.  The script can then query the registry using the path and value combination to get the data which it can then send to Zabbix using the key specified on the command line.  So having the list of registry values from the part 1 post I&#8217;m able to put together my file.</p>
<p>Because  I need to specify a delimiter to the <strong><em>for</em></strong> command and I use commas &#8216;,&#8217; in the Zabbix keys that I&#8217;ve defined, I need to use something else as a delimiter for my input file, so I&#8217;ve settled on using a pipe symbol as shown below.</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nf_cluster[throughput]|HKLM\Software\Neverfail\R2\Performance|CurrentThroughput<br />
nf_cluster[MB_sent]|HKLM\Software\Neverfail\R2\Performance|MegaBytessent<br />
nf_cluster[MB_recvd]|HKLM\Software\Neverfail\R2\Performance|MegabytesReceived<br />
nf_q[unsafe,age]|HKLM\Software\Neverfail\R2\Performance|OldestUnsafeupdatequeueentry<br />
nf_q[unsafe,size]|HKLM\Software\Neverfail\R2\Performance|UnsafeUpdateQueueSize<br />
nf_q[unsafe,rate]|HKLM\Software\Neverfail\R2\Performance|UnsafeUpdateQueueSize<br />
nf_q[unsafe,total_kb_sent]|HKLM\Software\Neverfail\R2\Performance|KBDispatchedFromUnsafeQueue<br />
nf_q[safe,age]|\\10.0.0.2\HKLM\Software\Neverfail\R2\Performance|Oldestsafeupdatequeueentry<br />
nf_q[safe,size]|\\10.0.0.2\HKLM\Software\Neverfail\R2\Performance|safeUpdateQueueSize<br />
nf_q[safe,rate]|\\10.0.0.2\HKLM\Software\Neverfail\R2\Performance|SafeUpdateQueueSize<br />
nf_q[safe,total_kb_sent]|\\10.0.0.2\HKLM\Software\Neverfail\R2\Performance|KBDispatchedFromsafeQueue<br />
nf_cluster[reg_sync_status]|HKLM\Software\JavaSoft\Prefs\Neverfail\current\/Registry/State/Manager\/Status|/Value<br />
nf_cluster[file_sync_status]|HKLM\Software\JavaSoft\Prefs\Neverfail\current\/New/File/State/Mgr\/Synchronization/Status|/Tag<br />
nf_cluster[primary]|HKLM\Software\JavaSoft\Prefs\Neverfail\current\/Controller|/Is/Primary/Server</div></div>
<p>While my batch file  is about 35 lines, it really boils down to one line which does all the real work:</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">for /F &quot;tokens=1-3 delims=|&quot; %%I in (%ZBXKEYS%) do cscript %SENDVALUES% &quot;%%I&quot; &quot;%%J&quot; &quot;%%K&quot;</div></div>
<p>With the environment variables expanded it would look more like;</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">for /F &quot;tokens=1-3 delims=|&quot; %%I in (zbx_keys_to_send.txt ) do cscript SENDVALUES.vbs &quot;%%I&quot; &quot;%%J&quot; &quot;%%K&quot;</div></div>
<p>This for loop reads in each line of  the text file zbx_keys_to_send.txt and using the pipe symbol as a delimiter reads in the first three tokens/strings of each line and call the SENDVALUES.vbs script with the three tokens/strings as arguments.  The script and input file worked fine when I ran them on the primary node, but not so well when I ran them while the secondary was active. After some troubleshooting I realized  that one thing I didn&#8217;t think through at first wat that I actually need two lists/input files. Since the private IP address I want to use to get data from the passive node&#8217;s registry will change depending on which node is active I&#8217;ll need one list for when the script is sending from the primary node (10.0.0.1)  and another for when the secondary (10.0.0.2) is active. The lists should essentially be identical with the only difference being the IP address specifed for the passive node.</p>
<p><img class="alignnone size-full wp-image-369" title="A generic Neverfail cluster" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/nf_cluster.png" alt="A generic Neverfail cluster" width="474" height="275" /></p>
<p>Now all that is left to do is copy the batch file, the vbscript file and the approapirate inputer to each node in the cluster. Prior to setting up the scehiled task I like to manually run the batch file a few time to make sure  the data is getting populated into Zabbix. To do this I need to use a local account that exists on both nodes (in my case I use the local Administrator account). This is so that the reg.exe util can seamlessly get values from the passive node (assuming the account has the same password on both nodes).</p>
<h3>A little troubleshooting hint.</h3>
<p>When running the script manually I can see each time the VBScript file calls zabbix_sender and whether or not that submission was successful. Running zabbix_sender and mistyping the key was not an common issue when I was putting this together. Fortunately zabbix_sender lets me know what happened when I attempted to submit data.  As an example, below is the output I get when trying to submit a value for the nf_q[safe,size] key, if I mistype the key as nfq[safe,size]</p>
<p><img class="alignnone size-full wp-image-390" title="zbx_send_failed" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_send_failed.png" alt="zbx_send_failed" width="739" height="86" /></p>
<p>I can see that it reports that I have 1 failed item, and no Processed items. When I run it without any typos (intentional or otherwise) I get:</p>
<p><img class="alignnone size-full wp-image-389" title="zbx_send_good" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_send_good.png" alt="zbx_send_good" width="718" height="85" /></p>
<p>Now I can see that I had 1 item processed successfully and no Failed ones.</p>
<h2>Setting up Alerting</h2>
<p>If you import the template I&#8217;ve provided it should have also created four triggers that can be used to generate actions within Zabbix.</p>
<p><img class="alignnone size-full wp-image-392" title="template_triggers" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/template_triggers.png" alt="template_triggers" width="851" height="151" /></p>
<p>These triggers are based on situations I&#8217;ve run into in my environment that I want to be aware of.  The first is when the size of either the Safe or Unsafe queue has been above 2GB for over an hour. Neverfail was great at letting me know the queue was full and it was going to stop replicating but not so much on the warning me it was happening front.  I generally wanted to be aware well before we got to that state where it stopped replicating and these triggers are a way of warning me something is going on.  The second situation is when data to be replicated has been sitting in one of the queue&#8217;s for more than a specified amount of time.  This is similar to watching the queue get beyond a certain size as the first two triggers do but is helpful in situations where there isn&#8217;t a whole of data changing on the active node(i.e. over weekends).</p>
<p>It is of course  possible to change these and set them to what fits for your environment and even to add other triggers. In later versions of this monitoring I&#8217;ve added some other counters/keys related to the task state using the nfcmd.exe command line tool. This allows me to see when a server is doing a full system check or even the dreaded &#8220;internal system task&#8221; as well as how much progress it&#8217;s made.  Some example screenshots are included below.</p>
<table border="0" width="100%">
<tbody>
<tr align="center">
<td><div id="attachment_394" class="wp-caption alignnone" style="width: 160px"><br />
<a rel="lightbox[nf]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_data.png"><img class="size-thumbnail wp-image-394" title="Sample Data for one cluster" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_data-150x150.png" alt="Sample Data for one cluster" width="150" height="150" /></a><p class="wp-caption-text">Sample Data for one cluster</p></div></td>
<td><div id="attachment_396" class="wp-caption alignnone" style="width: 160px"><a rel="lightbox[nf]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_landscape.png"><img class="size-thumbnail wp-image-396" title="Overview of all the clusters in my environment" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_landscape-150x150.png" alt="Overview of all the clusters in my environment" width="150" height="150" /></a><p class="wp-caption-text">Cluster Overview</p></div></td>
<td><div id="attachment_397" class="wp-caption alignnone" style="width: 160px"><a rel="lightbox[nf]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_safeq_size_graph.png"><img class="size-thumbnail wp-image-397 " title="Graph of the Safe Queue size" src="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_safeq_size_graph-150x150.png" alt="Graph of the Safe Queue size" width="150" height="150" /></a><p class="wp-caption-text">Sample Graph of the Safe Queue size</p></div></td>
<td><div id="attachment_395" class="wp-caption alignnone" style="width: 160px"><a rel="lightbox[nf]" href="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_fullcheck.png"><img class="size-thumbnail wp-image-395" title="Enhanced view showing a Full System Check that is 3% complete." src="http://cars.lostroncos.org/wp-content/uploads/2010/02/zbx_nf_fullcheck-150x150.png" alt="Enhanced view showing a Full System Check that is 3% complete." width="150" height="150" /></a><p class="wp-caption-text">Enhanced view</p></div></td>
</tr>
</tbody>
</table>
<p>The three files I use are included here:</p>
<ul>
<li><a href="http://cars.lostroncos.org/wp-content/uploads/2010/02/Do_Zabbix.cmd.txt">DO_Zabbix.cmd</a> &#8211; The batch file that reads the input file with reg values &amp; zabbix keys and calls SendRegValue.vbs</li>
<li><a href="http://cars.lostroncos.org/wp-content/uploads/2010/02/SendRegValue.vbs.txt">SendRegValue.vbs</a> &#8211; The vbscript file that actually reads the registry entry and does any necessary conversions to send the value to Zabbix</li>
<li><a href="http://cars.lostroncos.org/wp-content/uploads/2010/02/zabbix_keys_to_send.txt">zabbix_keys_to_send.txt</a> &#8211; the input file used by DO_Zabbix.cmd. This version is the one I run when the primary node is active. IP addresses would need to be changed for this to run on a passive node.</li>
</ul>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><em>A few additional notes:</em></p>
<p><em>Because Neverfail  is continually pushing the perf data to the registry it does happen on occasion that the script will catch spuriously large or odd values for some counters. </em></p>
<p><em>If I were to use the zabbix_agent on my Neverfail nodes it is possible to include all this same monitoring within the agents configuration so that the agent pushes the data rather than using zabbix_sender via a scheduled task. <em>However that&#8217;s a post for some other time&#8230;<br />
-crt</em></em></p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2010/02/23/simple-neverfail-monitoring-with-zabbix-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios ESX3i Scripts and ESX4i</title>
		<link>http://cars.lostroncos.org/2009/06/29/nagios-esx3i-scripts-and-esx4i/</link>
		<comments>http://cars.lostroncos.org/2009/06/29/nagios-esx3i-scripts-and-esx4i/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 22:57:09 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[NAgios]]></category>
		<category><![CDATA[VMware]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[3i]]></category>
		<category><![CDATA[4i]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[esx3i]]></category>
		<category><![CDATA[esx4i]]></category>
		<category><![CDATA[esxi]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=193</guid>
		<description><![CDATA[<p>This is just an update, but the scripts I wrote for use with Nagios and ESX3i seem to work just fine with ESX4i (at least in my home lab environment using Dell Poweredge 2850s).</p>
]]></description>
			<content:encoded><![CDATA[<p>This is just an update, but the <a href="http://cars.lostroncos.org/2008/03/07/updated-esx-3i-scripts-for-nagios/">scripts I wrote for use with Nagios and ESX3i</a> seem to work just fine with ESX4i (at least in my home lab environment using Dell Poweredge 2850s).</p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2009/06/29/nagios-esx3i-scripts-and-esx4i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple Neverfail monitoring with Zabbix part 1</title>
		<link>http://cars.lostroncos.org/2009/05/31/simple-monitoring-of-neverfail-with-zabbix-part-1/</link>
		<comments>http://cars.lostroncos.org/2009/05/31/simple-monitoring-of-neverfail-with-zabbix-part-1/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 05:01:54 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[VMware]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[neverfail]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[neverfail for Exchange]]></category>
		<category><![CDATA[neverfail heartbeat]]></category>
		<category><![CDATA[reg_dword_big_endian]]></category>
		<category><![CDATA[windows registry]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=157</guid>
		<description><![CDATA[Background
<p>This is the first of a couple of posts on how I&#8217;ve cobbled together some basic monitoring of Neverfail&#8217;s  Neverfail Heartbeat H/A software which is also now the basis for VMWare&#8217;s vCenter Server Heartbeat. Since Neverfail seems to consider their command lines privileged information I will only cover how to do some simple monitoring using [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>
<p>This is the first of a couple of posts on how I&#8217;ve cobbled together some basic monitoring of <a href="http://www.neverfailgroup.com/">Neverfail&#8217;s  Neverfail Heartbeat H/A</a> software which is also now the basis for <a href="http://www.vmware.com/products/vcenter-server-heartbeat/">VMWare&#8217;s vCenter Server Heartbeat</a>. Since Neverfail seems to consider their command lines privileged information I will only cover how to do some simple monitoring using the registry. When starting on this effort internally I was only interested initially in figuring out a quick and simple way to get the info I needed and not so much on the how to get it into something part.</p>
<p>I&#8217;ve been working with another team where I work to look at Zabbix as an alternative for some of the monitoring we do in our environment. We use Microsoft Operations Manager 2005 (MOM) but haven&#8217;t fully cut over from out previous monitoring solution. I had looked at Zabbix earlier as a potential solution for monitoring a bunch of VMware ESX boxes but another team ended up getting tasked with that particular duty. So I had had some experience with Zabbix but hadn&#8217;t done too much with it since.</p>
<p>One of the things that&#8217;d been rattling around in my brain is using the capabilities of using the zabbix_sender feature/client to monitor some of other components/things we can&#8217;t easily get into MOM.  Zabbix_Sender is a utility that is available for use with Zabbix that allows one to &#8220;send&#8221; information to Zabbix. In my case it was appealing because we&#8217;re already running two different monitoring agents on the Exchange servers where we have Neverfail installed.  Since I only wanted to use Zabbix to monitor a small set of data related specifically to Neverfail zabbix_sender lets me do that without having to run the fullblown zabbix_agent as a service on the boxes.</p>
<p><span id="more-157"></span></p>
<h2>Getting the Data</h2>
<p>Neverfail (at least the versions we have installed) doesn&#8217;t obviously expose performance data. However if you look in the registry on each Neverfail server you will find some registry values (see <strong><em>HKLM\Software\Neverfail\R2\Performance</em></strong>) that get updated on a regular and frequent basis that correspond to data presented in the Neverfail GUI . Because of the way Neverfail works some of this data (Unsafe Queue info) is available on the Active node and some of it (Safe Queue info) is in the registry on the Passive node. This presents a couple of issues when trying to put together the solution (at least in my environment).</p>
<p>The first of these is trying to find a single consistent way to get the data out of the registry, especially since all the counters involved are of the REG_DWORD_BIG_ENDIAN variety (you can see a <a href="http://cars.lostroncos.org/2009/03/09/big_endian-registry-values/">previous entry related to BIG_ENDIAN here</a>).  I ended up settling on using the Reg.exe util available in Windows.  This utility let&#8217;s you manipulate the registry locally and remotely. While it doesn&#8217;t necessarily deal happily with REG_DWORD_BIG_ENDIAN (RDBE) entries in the registry it is able to extract the data which we can then manipulate to get the correct values.</p>
<p>As an example if I have the following two values in the registry as shown by RegEdit</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_example_01.png"><img class="alignnone size-full wp-image-159" title="reg_example_01" src="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_example_01.png" alt="reg_example_01" width="462" height="166" /></a></p>
<p>When I run <strong><em>reg.exe</em></strong> I get the following output&#8230;</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_query_rdword_rdbe.png"><img class="alignnone size-full wp-image-160" title="reg_query_rdword_rdbe" src="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_query_rdword_rdbe.png" alt="reg_query_rdword_rdbe" width="576" height="129" /></a></p>
<p>So while Dword_example and DWORD_BE_Example nominally have the same value <strong><em>reg.exe</em></strong> doesn&#8217;t get the data out correctly for the latter. However as I said earlier once we have the data out we can actually do some magic to get the right value.</p>
<p>We can also use <strong><em>reg.exe</em></strong> to get values on a remote machine (i.e. our Passive Neverfail node) by pre-pending the host info to the query registry path. So in this case to reach the passive secondary node over the private channel at 10.0.0.2 I can do something like  reg.exe Query \\10.0.0.2\CRT_CORP\Performance. Testing this out leads us to  a second issue. Getting an  &#8221;Acces is denied&#8221; error.</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_error_access_denied.png"><img class="alignnone size-full wp-image-158" title="reg_error_access_denied" src="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_error_access_denied.png" alt="reg_error_access_denied" width="592" height="176" /></a></p>
<p>Since my passive Neverfail node is essentially off-net but still thinks the network cables is live I can&#8217;t use a domain based account to run the reg.exe command because it can&#8217;t contact a domain controller to authenticate my domain account. However if I use the local Administrator account which has a common password on both nodes I can get this work just fine. (It may be possible to use an account other than the local Administrator but in my case where I also run some Neverfail command lines I need an account that&#8217;s authorized in Neverfail)</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_remote_as_admin.png"><img class="alignnone size-full wp-image-161" title="reg_remote_as_admin" src="http://cars.lostroncos.org/wp-content/uploads/2009/05/reg_remote_as_admin.png" alt="reg_remote_as_admin" width="528" height="188" /></a></p>
<p>Given this info I was able to put together a<a href="http://cars.lostroncos.org/?attachment_id=168"> </a><a href="http://cars.lostroncos.org/?attachment_id=172">vbscript that takes two arguments</a>: a reg path and a value name;  and it returns the data value to the console converting REG_DWORD and REG_DWORD_BIG_ENDIAN to the correct decimal value. Using <a href="http://cars.lostroncos.org/wp-content/uploads/2009/06/getregvaluevbs.txt">this script</a> it&#8217;s then possible to get  any of the counters we&#8217;re interested in on either the active or passive node.  So based on the example above where I ran <em>reg.exe hklm\software\CRT_CORP\Performance /s</em> we can run the script for each of the values and see that we do in fact get the right decimal value for each one.</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/06/getregvalue_example_01.png"><img class="alignnone size-full wp-image-176" title="getregvalue_example_01" src="http://cars.lostroncos.org/wp-content/uploads/2009/06/getregvalue_example_01.png" alt="getregvalue_example_01" width="702" height="213" /></a></p>
<p>So now the trick is to figure out which of the registry based perf values we want to use and which host we need to draw them from.  Each of the Neverfail nodes has the same set of values present even though they&#8217;re not all populated the same way. That is to say that the counters related to the Safe Queue are not updated on the Active node since the Safe Queue exists on the passive node. And the converse is true with regard to the UnsafeQueue counters.  As I was mostly interested in alerting related to an issue we have occur occassionally I really wanted to get the SafeQueue and UnsafeQueue related counters (OldestSafeUpdateQueueEntry, SafeUpdateQueueSize etc). But since the other counters are also equally easy to get I decided I to include several more.  The image below shows the available values.</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/05/nf_perf_reg_values.png"><img class="alignnone size-full wp-image-164" title="nf_perf_reg_values" src="http://cars.lostroncos.org/wp-content/uploads/2009/05/nf_perf_reg_values.png" alt="nf_perf_reg_values" width="481" height="337" /></a></p>
<p>So now that I have a simple way of getting the information I want I can focus on how to get it into whatever system I want to monitor with whether it&#8217;s Zabbix (now) or Systems Center Operations Manager 2007 (later).  In the next article(s) I&#8217;ll talk about setting up the Zabbix part of this monitoring.</p>
<p><strong><em>Acknowledgement: The hex to decimal routine in the GetRegValue.vbs script is lifted directly from </em></strong><strong><em><a href="http://www.sonofsofaman.com/hobbies/code/hextodec.asp">http://www.sonofsofaman.com/hobbies/code/hextodec.asp</a> Thanks to Joel for keeping me from having to reinvent the wheel. -crt</em></strong></p>
<p><strong>Addendum</strong>: While traipsing through the registry in figuring this stuff out I also discovered that there&#8217;s a bunch of configuration information stored in a whole different key under HKLM\Software\Javasoft\Prefs\neverfail\current\* It&#8217;s also possible to watch a few entries here to help monitor the  file and registry synchronization status even though it&#8217;s not as granular/descriptive/timely as can be obtained by using the command line.</p>
<p>The two items I&#8217;ve found that might be of interest are the <strong>/Registry/State/Manager\/Statu</strong>s Key and the <strong>/Value</strong> entry</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/06/reg_java_prefs_reg.png"><img class="alignnone size-full wp-image-183" title="reg_java_prefs_reg" src="http://cars.lostroncos.org/wp-content/uploads/2009/06/reg_java_prefs_reg.png" alt="reg_java_prefs_reg" width="725" height="212" /></a></p>
<p>and  the <strong>/New/File/State/Mgr\/Synchronization/Status</strong> key and <strong>/Tag</strong> entry</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2009/06/reg_java_prefs_file.png"><img class="alignnone size-full wp-image-182" title="reg_java_prefs_file" src="http://cars.lostroncos.org/wp-content/uploads/2009/06/reg_java_prefs_file.png" alt="reg_java_prefs_file" width="713" height="221" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2009/05/31/simple-monitoring-of-neverfail-with-zabbix-part-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Simple Replay Report</title>
		<link>http://cars.lostroncos.org/2009/04/30/a-simple-replay-report/</link>
		<comments>http://cars.lostroncos.org/2009/04/30/a-simple-replay-report/#comments</comments>
		<pubDate>Fri, 01 May 2009 06:08:41 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[Replay]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=122</guid>
		<description><![CDATA[<p>Where I work we use AppAssure&#8217;s Replay product to back up some of our Exchange servers.  Because the servers in question are very geographically dispersed we have multiple servers running Replay.  Monitoring and keeping an eye on them to assure backups are happening properly was requiring more time than I wanted to spend because we [...]]]></description>
			<content:encoded><![CDATA[<p>Where I work we use AppAssure&#8217;s Replay product to back up some of our Exchange servers.  Because the servers in question are very geographically dispersed we have multiple servers running Replay.  Monitoring and keeping an eye on them to assure backups are happening properly was requiring more time than I wanted to spend because we had different versions of Replay running in the environment. I ended up having to RDP to multiple machines on a regular basis to ensure things were going smoothly.</p>
<p>In poking around the install directory I came across the <a href="https://support.appassure.com/ics/support/KBAnswer.asp?questionID=119" target="_blank">Replayc.exe command</a>. Replayc is a command line utilty that offers information about the Replay server and a way to manually mount and dismount Recovery Points (RPs). After playing with it a little and being the very lazy person that I am  I decided to write a Powershell script to help give me a high level status overview of my servers.  The script runs on each server at about the same time (relative to me here in Oregon) every day and emails me the output. So instead of having to muck around in the console Ionly have to spend a few seconds each to make sure everything&#8217;s running properly.</p>
<p>The <a href="http://cars.lostroncos.org/?attachment_id=145">script is available here</a> and needs to be renamed appropriately.</p>
<p>When the script runs the email (HTML formatted)  I get is like the one below.  It tells me a number of things:</p>
<ul>
<li>The status of the Replay Server (running/not running)</li>
<li>The name of the server that&#8217;s being protected</li>
<li>How much disk space is available and being used for RPs for that protected server</li>
<li>The size of the disk where those RPs are being stored</li>
<li>The # of valid and invalid RPs</li>
<li>The timespan between first and last valid RP</li>
<li>Last time an RP occurred.</li>
</ul>
<p>Example Email:</p>
<p style="padding-left: 60px;">Starting Script at 04/30/2009 23:20:12</p>
<p style="padding-left: 60px;">Replay Service is running</p>
<p style="padding-left: 60px;">Server <strong><em>mailserver.company.com</em></strong> snapshots are being stored on R: and currently using 818.54GB. This is 99.98% of the used space(818.68GB) on the volume which is 1,360.22GB</p>
<p style="padding-left: 60px;">The drive currently has 39.81% free space (e.g. 541.54GB)</p>
<p style="padding-left: 60px;">Number of reported Recovery Points is 395 of these 395 are valid, and 0 are invalid (100.00%).<br />
The valid RPs span 23.98 days</p>
<p style="padding-left: 60px;">The most recent valid RP was taken 1 Minutes ago</p>
<p style="padding-left: 60px;"> </p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2009/04/30/a-simple-replay-report/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Big_Endian values in the Windows Registry</title>
		<link>http://cars.lostroncos.org/2009/03/09/big_endian-registry-values/</link>
		<comments>http://cars.lostroncos.org/2009/03/09/big_endian-registry-values/#comments</comments>
		<pubDate>Mon, 09 Mar 2009 23:41:07 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[monitoring]]></category>
		<category><![CDATA[powershell]]></category>
		<category><![CDATA[reg_dword_big_endian]]></category>
		<category><![CDATA[windows registry]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/?p=97</guid>
		<description><![CDATA[<p>I was working today on trying to write some scripts to help me better monitor our various installations of Neverfail.  The command line tools they provide don&#8217;t provide all the performance information I need but (strangely enough) they do write some of it into the Registry where it gets updated very frequently.  In [...]]]></description>
			<content:encoded><![CDATA[<p>I was working today on trying to write some scripts to help me better monitor our various installations of Neverfail.  The command line tools they provide don&#8217;t provide all the performance information I need but (strangely enough) they do write some of it into the Registry where it gets updated very frequently.  In writing a Powershell script to read these values I was having issues with a set of the values I was reading.  Some values would be handled correctly and others were returning weird results. Below is an example of the &#8220;weird&#8221; ones.</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">PS</span> C:\Users\cars<span style="color: pink;">&gt;</span> <span style="color: #800080;">$badKey</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">Get-Item</span> <span style="color: #800000;">&quot;HKLM:\Software\CRTCORP\Product_B&quot;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\Users\cars<span style="color: pink;">&gt;</span> <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$badKey</span>.GetValueNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
<span style="color: pink;">&gt;&gt;</span> <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;$value | &quot;</span> <span style="color: #008080; font-style: italic;">-nonewline</span><br />
<span style="color: pink;">&gt;&gt;</span>Write<span style="color: pink;">-</span>Host <span style="color: #800080;">$badKey</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;$value&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: pink;">&gt;&gt;</span> <span style="color: #000000;">&#125;</span><br />
<span style="color: pink;">&gt;&gt;</span><br />
PerfCtr1 <span style="color: pink;">|</span> <span style="color: #804000;">0</span> <span style="color: #804000;">0</span> <span style="color: #804000;">0</span> <span style="color: #804000;">0</span><br />
PerfCtr2 <span style="color: pink;">|</span> <span style="color: #804000;">0</span> <span style="color: #804000;">13</span> <span style="color: #804000;">136</span> <span style="color: #804000;">8</span><br />
PerfCtr3 <span style="color: pink;">|</span> <span style="color: #804000;">0</span> <span style="color: #804000;">0</span> <span style="color: #804000;">3</span> <span style="color: #804000;">101</span><br />
<br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\Users\cars<span style="color: pink;">&gt;</span> <span style="color: #800080;">$example</span><span style="color: pink;">=</span><span style="color: #800080;">$badKey</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;PerfCtr1&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\Users\cars<span style="color: pink;">&gt;</span> <span style="color: #800080;">$example</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">gm</span><br />
<br />
TypeName: System.Byte<br />
<br />
Name MemberType Definition<br />
<span style="color: pink;">----</span> <span style="color: pink;">----------</span> <span style="color: pink;">----------</span><br />
CompareTo Method System.Int32 CompareTo<span style="color: #000000;">&#40;</span>Object value<span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> System.Int32 CompareTo<span style="color: #000000;">&#40;</span>Byte value<span style="color: #000000;">&#41;</span><br />
Equals Method System.Boolean Equals<span style="color: #000000;">&#40;</span>Object obj<span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> System.Boolean Equals<span style="color: #000000;">&#40;</span>Byte obj<span style="color: #000000;">&#41;</span><br />
GetHashCode Method System.Int32 GetHashCode<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
GetType Method System.<span style="color: #008080; font-weight: bold;">Type</span> GetType<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
GetTypeCode Method System.TypeCode GetTypeCode<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
ToString Method System.String ToString<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> System.String ToString<span style="color: #000000;">&#40;</span>String format<span style="color: #000000;">&#41;</span><span style="color: pink;">,</span> System.String ...</div></div>
<p>So what it it turns out I was getting from the GetValue method was a sequence of 4 bytes as an array.  This made me wonder what the heck was going on so I fired up RegEdit to take a look.  The contents of the Data column looked okay but the Type was different, so I expanded the column to see what was different and discovered REG_DWORD_BIG_ENDIAN as a type. This was one I don&#8217;t recall having seen before.</p>
<p>TechNet has the following to say about DWORD and it&#8217;s brethren:</p>
<p>REG_DWORD<br />
A 32-bit (4-byte) number. Boolean (&#8221;True&#8221; or &#8220;False&#8221;) values and many entries for device drivers and services use this data type. REG_DWORD data can be displayed and entered in hexadecimal or decimal format in the registry editor Regedit.exe. For an example, see the ActivityLogFlag entry.</p>
<p>REG_DWORD_BIG_ENDIAN<br />
Same as REG_DWORD. A 32-bit number in which the most significant byte is displayed as the leftmost (or high-order) byte. This is the most common format for storing numbers in computers that are running Windows Server 2003.</p>
<p>REG_DWORD_LITTLE_ENDIAN<br />
A 32-bit number in which the most significant byte is displayed as the rightmost (or low-order) byte. This is opposite of the order in which bytes are stored in the REG_DWORD and REG_DWORD_BIG_ENDIAN data types.</p>
<p>If you&#8217;re not paying attention it could be easy to miss the difference when using RegEedit since they appear almost identical to DWORD values.  The only obvious difference is the &#8220;Type&#8221; field.</p>
<p>So in the example above GetValue returns different values for &#8220;PerfCtr2&#8243; and &#8220;PerfCtr2 DWORD&#8221; which are nominally the same value (at least according to RegEdit).</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span>Write<span style="color: pink;">-</span>Host <span style="color: #800080;">$key</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;PerfCtr2&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #804000;">0</span> <span style="color: #804000;">13</span> <span style="color: #804000;">136</span> <span style="color: #804000;">8</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span>Write<span style="color: pink;">-</span>Host <span style="color: #800080;">$key</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;PerfCtr2 DWORD&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #804000;">886792</span></div></div>
<p>To help me figure out how to get the info I was looking for I put together a test and created a couple of dummy registry keys with each of the types of reg keys and some examples.</p>
<p>If we try to see what Powershell tells us about each of these keys we see that for our BIG_ENDIAN friend GetValueKind returns &#8220;unknown.&#8221;</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$key1</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Item</span> <span style="color: #800000;">&quot;HKLM:\Software\CRTCORP\Product_A&quot;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span>foreach <span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$key1</span>.GetValueNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span> <span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800080;">$value</span> <span style="color: #800000;">&quot; | &quot;</span> <span style="color: #800080;">$key1</span>.GetValueKind<span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span><span style="color: #000000;">&#41;</span> <span style="color: #800000;">&quot;|&quot;</span> <span style="color: #800080;">$key1</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br />
REG_SZ Example <span style="color: pink;">|</span> String <span style="color: pink;">|</span> This is a test of the emergency broadcast system<br />
REG_DWORD Example <span style="color: pink;">|</span> DWord <span style="color: pink;">|</span> <span style="color: #804000;">1</span><br />
REG_MULTI_SZ Example <span style="color: pink;">|</span> MultiString <span style="color: pink;">|</span> This is a test This is another Test<br />
REG_EXPAND_SZ <span style="color: pink;">|</span> ExpandString <span style="color: pink;">|</span> C:\ProgramData\Fred<br />
REG_DWORD_BIG_ENDIAN <span style="color: pink;">|</span> Unknown <span style="color: pink;">|</span> <span style="color: #804000;">161</span> <span style="color: #804000;">178</span> <span style="color: #804000;">195</span> <span style="color: #804000;">212</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span></div></div>
<p>GetValue converts each byte to a decimal value. Our key REG_DWORD_BIG_ENDIAN (0xa1b2c3d4) can be expressed as 4 bytes &#8220;a1&#8243; &#8220;b2&#8243; &#8220;c3&#8243; &#8220;d4&#8243; which when converted become the values &#8220;161&#8243; &#8220;178&#8243; &#8220;195&#8243; &#8220;212&#8243;. While this is mildly useful it doesn&#8217;t help us easily get the value we want 2712847316.   While it is possible to get the right value by doing some math [ (byte1 * 256^3) + (byte2 * 256^2) + (byte3 * 256) + byte4 ] I thought my resulting attempts to write a snippet to do this were ugly since it doesn&#8217;t appear Powershell has any easy way to do exponentiation.</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$key</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">Get-Item</span> <span style="color: #800000;">&quot;HKLM:\Software\CRTCorp\Product_A&quot;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$bytes</span><span style="color: pink;">=</span> <span style="color: #800080;">$key</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;REG_DWORD_BIG_ENDIAN&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$number</span><span style="color: pink;">=</span><span style="color: #804000;">0</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span>for <span style="color: #000000;">&#40;</span><span style="color: #800080;">$idx</span><span style="color: pink;">=</span><span style="color: #804000;">0</span>;$idx <span style="color: #FF0000;">-lt</span> <span style="color: #800080;">$bytes</span>.length;$idx<span style="color: pink;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
<span style="color: pink;">&gt;&gt;</span> <span style="color: #800080;">$pwr</span> <span style="color: pink;">=</span> <span style="color: #800080;">$bytes</span>.length<span style="color: pink;">-</span><span style="color: #800080;">$idx</span><span style="color: pink;">-</span><span style="color: #804000;">1</span>;<br />
<span style="color: pink;">&gt;&gt;</span> <span style="color: #800080;">$number</span><span style="color: pink;">+=</span> <span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #800080;">$idx</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">*</span> <span style="color: #000000;">&#91;</span>math<span style="color: #000000;">&#93;</span>::pow<span style="color: #000000;">&#40;</span><span style="color: #804000;">256</span><span style="color: pink;">,</span><span style="color: #800080;">$pwr</span><span style="color: #000000;">&#41;</span><br />
<span style="color: pink;">&gt;&gt;</span><span style="color: #000000;">&#125;</span><br />
<span style="color: pink;">&gt;&gt;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span>Write<span style="color: pink;">-</span>Host <span style="color: #800000;">&quot;The Value via method 1 is [$number]&quot;</span><br />
The Value via method <span style="color: #804000;">1</span> is <span style="color: #000000;">&#91;</span><span style="color: #804000;">2712847316</span><span style="color: #000000;">&#93;</span><br />
<br />
The second version uses the Math::Pow method to <span style="color: #0000FF;">do</span> help <span style="color: #0000FF;">do</span> the exponentiation:<span style="color: #000000;">&#40;</span>byte1 <span style="color: pink;">*</span> <span style="color: #804000;">256</span>^<span style="color: #804000;">3</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #000000;">&#40;</span>byte2 <span style="color: pink;">*</span> <span style="color: #804000;">256</span>^<span style="color: #804000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #000000;">&#40;</span>byte3 <span style="color: pink;">*</span> <span style="color: #804000;">256</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> byte4<br />
<span style="color: #000000;">&#91;</span>cc lang<span style="color: pink;">=</span><span style="color: #800000;">&quot;powershell&quot;</span> tab_size<span style="color: pink;">=</span><span style="color: #800000;">&quot;3&quot;</span><span style="color: #000000;">&#93;</span><span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$key</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">Get-Item</span> <span style="color: #800000;">&quot;HKLM:\Software\CRTCorp\Product_A&quot;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$bytes</span><span style="color: pink;">=</span> <span style="color: #800080;">$key</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;REG_DWORD_BIG_ENDIAN&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$number</span><span style="color: pink;">=</span><span style="color: #804000;">0</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$number</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">*</span> <span style="color: #000000;">&#91;</span>Math<span style="color: #000000;">&#93;</span>::pow<span style="color: #000000;">&#40;</span><span style="color: #804000;">256</span><span style="color: pink;">,</span><span style="color: #804000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">*</span> <span style="color: #000000;">&#91;</span>Math<span style="color: #000000;">&#93;</span>::Pow<span style="color: #000000;">&#40;</span><span style="color: #804000;">256</span><span style="color: pink;">,</span><span style="color: #804000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">*</span> <span style="color: #804000;">256</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">3</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span>Write<span style="color: pink;">-</span>Host <span style="color: #800000;">&quot;The Value via Method 2 is [$number]&quot;</span><br />
The Value via method <span style="color: #804000;">3</span> is <span style="color: #000000;">&#91;</span><span style="color: #804000;">2712847316</span><span style="color: #000000;">&#93;</span></div></div>
<p>The third method was to write out the formula a little more explicitly so that (byte1 * 256^3) + (byte2 * 256^2) + (byte3 * 256^1) + (byte4 *256^0) becomes (byte1 * 16777216) + (byte2 * 65536) + (byte3 * 256) + byte4</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$key</span><span style="color: pink;">=</span><span style="color: #008080; font-weight: bold;">Get-Item</span> <span style="color: #800000;">&quot;HKLM:\Software\CRTCorp\Product_A&quot;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$bytes</span><span style="color: pink;">=</span> <span style="color: #800080;">$key</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;REG_DWORD_BIG_ENDIAN&quot;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$number</span><span style="color: pink;">=</span><span style="color: #804000;">0</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span><span style="color: #800080;">$number</span><span style="color: pink;">=</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">*</span> <span style="color: #804000;">16777216</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">1</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">*</span> <span style="color: #804000;">65536</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">2</span><span style="color: #000000;">&#93;</span> <span style="color: pink;">*</span> <span style="color: #804000;">256</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">+</span> <span style="color: #800080;">$bytes</span><span style="color: #000000;">&#91;</span><span style="color: #804000;">3</span><span style="color: #000000;">&#93;</span><br />
<span style="color: #008080; font-weight: bold;">PS</span> C:\<span style="color: pink;">&gt;</span>Write<span style="color: pink;">-</span>Host <span style="color: #800000;">&quot;The Value via method 3 is [$number]&quot;</span><br />
The Value via method <span style="color: #804000;">3</span> is <span style="color: #000000;">&#91;</span><span style="color: #804000;">2712847316</span><span style="color: #000000;">&#93;</span></div></div>
<p>I was curious though as to why it was we could get the individual bytes converted but there wasn&#8217;t (to me) an obvious way to do the whole value. I came across a mention of the Convert Class on MSDN which does make it possible. Convert class in the .Net framework. After playing around some I was able to come up with a different way using the Convert Class that to me seems a little cleaner. The Convert class has several overloaded methods. One version of the ToInt64 method converts a string version of a number into 64-bit signed integer. Either this or ToUInt32 will work for our purposes here. ToInt32 won&#8217;t work because of the value may incorrectly (for our purposed) return a negative (i.e. signed) integer. The call to the ToInt64 method  requires an argument that specifies the base of the number the string represents (in this case hex= base 16).  So in theory that would work if we were able to represent the bytes as a hex string.. i.e. 0xA1B2C3D4.  That&#8217;s when I came across a VBScript to Powershell page describing converting numbers from decimal to hex that helped fill in the missing piece. Putting these two things together I was able to come up with a function to use in my script which seemed to work.</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">#############################################################################</span><br />
<span style="color: #008000;">#Convert a Reg_DWORD_BIG_ENDIAN value to a number that makes sense to a human</span><br />
<span style="color: #008000;"># $convertee should be a byte array</span><br />
<span style="color: #008000;">#--------------------------------------------</span><br />
<span style="color: #0000FF;">function</span> Convert<span style="color: pink;">-</span>RBEToDecimal<span style="color: #000000;">&#40;</span><span style="color: #800080;">$convertee</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
<span style="color: #800080;">$tmpString</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;0x&quot;</span><br />
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$byte</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$convertee</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
<span style="color: #800080;">$tmpString</span> <span style="color: pink;">+=</span> <span style="color: #800000;">&quot;{0:X}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$byte</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">Return</span> <span style="color: #000000;">&#91;</span>Convert<span style="color: #000000;">&#93;</span>::ToInt64<span style="color: #000000;">&#40;</span><span style="color: #800080;">$tmpString</span><span style="color: pink;">,</span><span style="color: #804000;">16</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #008000;">#############################################################################</span></div></div>
<p>The operative word here was &#8220;seemed&#8221;. I noticed in testing that there were instances where I got a very wrong answer.  As an example if the Registry value were (0xA102C4D4, or 2701312980 decimal) the function would return.  169001940 decimal as the value&#8230;I realized that in building $tmpString if the value of a particular byte was less than 16 it&#8217;d spit out a single character   0xC rather than 0&#215;0C. This was fine if I was interested in the value of a single byte but when concatenating the values together makes for a big difference in the resulting value as 0xA102C3D4 would become 0xA12C3D4. The resolution for this was to change the format string to pad the value with a leading 0 if necessary. So $tmpString += &#8220;{0:X}&#8221; -f $byte  became $tmpString += &#8220;{0:X2}&#8221; -f $byte.<br />
So the final function I ended up using looks like this:</p>
<div class="codecolorer-container powershell blackboard" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000;">############################################################################</span><br />
<span style="color: #008000;">#Convert a Reg_DWORD_BIG_ENDIAN value to a number that makes sense to a human</span><br />
<span style="color: #008000;"># $convertee should be a byte array</span><br />
<span style="color: #008000;">#--------------------------------------------</span><br />
<span style="color: #0000FF;">function</span> Convert<span style="color: pink;">-</span>RBEToDecimal<span style="color: #000000;">&#40;</span><span style="color: #800080;">$convertee</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
<span style="color: #800080;">$tmpString</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;0x&quot;</span><br />
<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$byte</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$convertee</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
<span style="color: #800080;">$tmpString</span> <span style="color: pink;">+=</span> <span style="color: #800000;">&quot;{0:X2}&quot;</span> <span style="color: #FF0000;">-f</span> <span style="color: #800080;">$byte</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #0000FF;">Return</span> <span style="color: #000000;">&#91;</span>Convert<span style="color: #000000;">&#93;</span>::ToInt64<span style="color: #000000;">&#40;</span><span style="color: #800080;">$tmpString</span><span style="color: pink;">,</span><span style="color: #804000;">16</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #008000;">###############################################################################</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2009/03/09/big_endian-registry-values/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating Monitoring Items in Zabbix for Nagios plugins &#8211; part 1 (Log data)</title>
		<link>http://cars.lostroncos.org/2008/04/03/creating-monitoring-items-in-zabbix-for-nagios-plugins-part-1-log-data/</link>
		<comments>http://cars.lostroncos.org/2008/04/03/creating-monitoring-items-in-zabbix-for-nagios-plugins-part-1-log-data/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 05:11:12 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[zabbix]]></category>
		<category><![CDATA[3i]]></category>
		<category><![CDATA[ESX]]></category>
		<category><![CDATA[external check]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/2008/04/03/creating-monitoring-items-in-zabbix-for-nagios-plugins-part-1-log-data/</guid>
		<description><![CDATA[<p style="margin-left: 1pt">One of the things I wanted to check in looking at Zabbix was how hard it would be to use the Nagios plugins I wrote/modified for monitoring ESX 3i in Zabbix.</p>
<p style="margin-left: 1pt">It turns out that they are usable pretty much as is though there is a minor modification that needs to be [...]]]></description>
			<content:encoded><![CDATA[<p style="margin-left: 1pt">One of the things I wanted to check in looking at Zabbix was how hard it would be to use the <a href="http://cars.lostroncos.org/2008/03/07/updated-esx-3i-scripts-for-nagios/">Nagios plugins</a> I wrote/modified for monitoring ESX 3i in Zabbix.</p>
<p style="margin-left: 1pt">It turns out that they are usable pretty much as is though there is a minor modification that needs to be made on how they accept/expect parameters. There are however a couple of ways to approach setting them up. Zabbix supports maintaining a couple of different kinds of data for external checks (as well as in general). These include:</p>
<ul>
<li>
<p style="margin-left: 28pt">Float</p>
</li>
<li>
<p style="margin-left: 28pt">Integer</p>
</li>
<li>
<p style="margin-left: 28pt">Text</p>
</li>
<li>
<p style="margin-left: 28pt">Log</p>
</li>
<li>
<p style="margin-left: 28pt">Character</p>
</li>
</ul>
<p style="margin-left: 1pt">The Nagios plugins I &#8216;m concerned in looking at will probably work with either the Log type or Integer. The external check &#8220;Item&#8221; type is just that a check. In and of itself it doesn&#8217;t make anything happen in terms of alerting or notifications. For that we need to set up &#8220;Triggers.&#8221; I&#8217;ll cover setting up an Item using Log type data in this post.</p>
<p style="margin-left: 1pt"><span id="more-76"></span></p>
<p style="margin-left: 1pt">I&#8217;ve created a template in Zabbix for my 3i boxes to which I&#8217;ll be attaching these &#8220;Items&#8221; so that they&#8217;re available for anything built off this template.</p>
<p style="margin-left: 1pt">To start we&#8217;ll need to log into the Zabbix web console, select &#8220;Configuration&#8221; and then Items. Then we need to narrow down object we&#8217;re working on using the Group and Host dropdowns. Here I&#8217;ve used the group GO_ESX and the template Template_GO_ESX_3i. Next click &#8220;Create Item&#8221;</p>
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/04/040408-0510-creatingmon1.png" /><span style="font-size: 12pt; font-family: Times New Roman"><br />
</span></p>
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/04/040408-0510-creatingmon2.png" /><span style="font-size: 12pt; font-family: Times New Roman"><br />
</span></p>
<p style="margin-left: 1pt">We need to fill in the &#8220;description&#8221; field with something meaningful to us. In this case we&#8217;re going to be using the script <strong><em>check_3i_sensors</em></strong> which returns info about the various sensors in the machine (of particular interest are the power supplies and their redundancy) So we&#8217;ll use &#8220;Check 3i Sensors&#8221; as the description. The &#8220;Type&#8221; needs to be changed to External Check. The key in this case is actually the name of the script to run and any parameters. For external checks the format is:</p>
<p style="margin-left: 28pt">Script(parameters)</p>
<p style="margin-left: 28pt">Where:</p>
<p style="margin-left: 55pt">script &#8211; is the name of the script</p>
<p style="margin-left: 55pt">Parameters is the list of command line parameters</p>
<p style="margin-left: 1pt">Zabbix will execute the script from the directory specified by the ExternalScripts option in zabbix_server.conf. (By default this /etc/zabbix/externalscripts) Zabbix will add the hostname as the first parameter and then append the list specified in the (parameters) piece of the definition. As an example:</p>
<table border="0" style="border-collapse: collapse">
<tr>
<td style="border: #a3a3a3 1pt solid; padding: 5px"><span style="font-size: 10pt">Example 1: </span></td>
<td style="border-right: #a3a3a3 1pt solid; border-top: #a3a3a3 1pt solid; border-left: medium none; border-bottom: #a3a3a3 1pt solid; padding: 5px"><span style="font-size: 10pt">Execute script check_oracle.sh with parameters &#8220;-h 192.168.1.4&#8243;.<br />
</span><span style="font-size: 10pt">Host name &#8216;www1.company.com&#8217;.</span></td>
</tr>
</table>
<p style="margin-left: 28pt"><span style="font-size: 10pt; font-family: Courier New">check_oracle.sh[-h 192.168.1.4]<br />
</span></p>
<p style="margin-left: 28pt"><span style="font-size: 10pt">ZABBIX will execute:<br />
</span></p>
<p style="margin-left: 28pt"><span style="font-size: 10pt; font-family: Courier New">check_oracle.sh www1.company.com -h 192.168.1.4.<br />
</span></p>
<p style="margin-left: 28pt">&nbsp;</p>
<p style="margin-left: 1pt"><em>[ Here is where one of the drawbacks of Zabbix appears when compared to Nagios. I haven't yet found a way to alter the parameters that are sent to the script on a per host basis. It is of course possible to set up the checks on each host rather than using the template, but the template should in theory be used to save us some of that repetitive work. If we were to go forward with this it ought to be possible to automate the process. If we define our process to include creating a monitoring user on each ESX host with the same name and password then using the template becomes much more feasible ]<br />
</em></p>
<p style="margin-left: 1pt">So for the sensors script we would enter the following for the key: check_3i_sensors( &#8211;username zabbix &#8211;password zabbix)</p>
<p style="margin-left: 1pt">Since zabbix already includes the hostname for us we don&#8217;t need to specify it. (But this is where the modification to the nagios plugins becomes necessary to properly handle the way the argument is passed) On my test ESX 3i server I&#8217;ve created a local user called &#8216;zabbix&#8217; which has read-only privileges to use for connecting and running the external check.</p>
<p style="margin-left: 1pt">In the &#8220;Type of information&#8221; field select &#8220;Log&#8221; via the dropdown menu. This will cause the fields on the screen to change. Specify a value for the update interval (I usually use 60 seconds) and any flexible intervals if necessary as well as the number of days to keep history and trend data (see image below) Then click the &#8220;Save&#8221; button.</p>
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/04/040408-0510-creatingmon3.png" /><span style="font-size: 12pt; font-family: Times New Roman"><br />
</span></p>
<p style="margin-left: 1pt">This needs to be repeated for any other plugins that are applicable to the template. As show below I&#8217;ve created two External checks, one for Sensor data, one for Storage status.</p>
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/04/040408-0510-creatingmon4.png" /><span style="font-size: 12pt; font-family: Times New Roman"><br />
</span></p>
<p style="margin-left: 1pt">Next you&#8217;ll need to create a host based on your template. Here I&#8217;ve created a host call &#8220;Steve_ESX_2950&#8243; based on the template. Next if you wait a few minutes and then go the &#8220;Monitoring&#8221; tab and select overview (and if necessary narrow down the show servers to see your new host) you should see something like the image below:</p>
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/04/040408-0510-creatingmon5.png" /><span style="font-size: 12pt; font-family: Times New Roman"><br />
</span></p>
<p style="margin-left: 1pt">Looking at this we can tell out external check has run and in this particular case it appears the sensor status is &#8220;GREEN&#8221;. If you click on the field you can see the last couple of hundred values for that particular item. You&#8217;ll notice the &#8220;Severity&#8221; is not classified. What we need to do next (in the next post) is to set up a trigger based on the Value of the Item (i.e. when it&#8217;s not &#8220;Green&#8221;).</p>
<p style="margin-left: 1pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/04/040408-0510-creatingmon6.png" /><span style="font-size: 12pt; font-family: Times New Roman"><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2008/04/03/creating-monitoring-items-in-zabbix-for-nagios-plugins-part-1-log-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zabbix and external scripts &#8211; Getting them to work (v1.4.1)</title>
		<link>http://cars.lostroncos.org/2008/04/02/zabbix-and-external-scripts-getting-them-to-work-v141/</link>
		<comments>http://cars.lostroncos.org/2008/04/02/zabbix-and-external-scripts-getting-them-to-work-v141/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 20:56:54 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[monitoring]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/2008/04/02/zabbix-and-external-scripts-getting-them-to-work-v141/</guid>
		<description><![CDATA[<p>I&#8217;ve been working with one of my coworkers in looking at Zabbix for monitoring rather than Nagios for the Global Ops Virtualization rollout. I&#8217;ve already done work on some monitoring of ESX3i with Nagios by writing some plugins to monitor different hardware components. (For more info see this blog post)</p>
<p>Zabbix supports multiple methods of checking [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with one of my coworkers in looking at Zabbix for monitoring rather than Nagios for the Global Ops Virtualization rollout. I&#8217;ve already done work on some monitoring of ESX3i with Nagios by writing some plugins to monitor different hardware components. (For more info see <a href="http://cars.lostroncos.org/2008/02/21/checking-storage-on-a-dell-poweredge-2900-running-esx-3i/">this blog post</a>)</p>
<p>Zabbix supports multiple methods of checking on hosts/services with a preference for agents running on the monitored node. It also supports simple ping, http and ftp port type tests. There is also an option for what&#8217;s termed an &#8220;external check&#8221; which is more akin to how Nagios works.</p>
<p>We set up a VM running Ubuntu 7.10 and used apt-get to install Zabbix. This installed packages for version 1.4.1. (Version 1.4.5 is the most recent stable release.) In my testing I discovered that I wasn&#8217;t able to get external checks working. I kept getting an &#8220;agent not support&#8221; message when trying to set them up. In troubleshooting I downloaded the source and discovered a discrepancy between the what the front-end php (items.php) expects in the configuration when setting up an external check and what the c-code (zabbix-1.4.1./src/zabbix_server/poller/checks_external.c) was expecting to have submitted to it.</p>
<p>The documentation Zabbix provides says the following about external checks.</p>
<p style="margin-left: 27pt"><span style="font-size: 10pt">5.12.8. External checks<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt">External check is a check executed by ZABBIX Server by running a shell script or </span><span style="font-size: 10pt">a binary.<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt">External checks do not require any agent running on a host being monitored.<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt">Syntax of item&#8217;s key:<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt; font-family: Courier New">script(parameters) </span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt"><strong>script</strong> – name of the script.<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt"><strong>parameters</strong> – list of command line parameters.<br />
</span></p>
<p style="margin-left: 27pt">&nbsp;</p>
<p style="margin-left: 27pt"><span style="font-size: 10pt">ZABBIX server will find and executed the script in directory defined in </span><span style="font-size: 10pt">configuration parameter ExternalScripts. First command line parameter is host </span><span style="font-size: 10pt">name, other parameters are substituted by parameters.<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt"><em>Note: Do not overuse external checks! It can decrease performance for ZABBIX </em></span><span style="font-size: 10pt"><em>system very much.<br />
</em></span></p>
<p style="margin-left: 24pt">
<table style="border-collapse: collapse" border="0">
<tr>
<td style="border: 1pt solid #a3a3a3; padding: 5px"><span style="font-size: 10pt">Example 1: </span></td>
<td style="border-style: solid solid solid none; border-color: rgb(163, 163, 163) rgb(163, 163, 163) rgb(163, 163, 163) -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 5px"><span style="font-size: 10pt">Execute script check_oracle.sh with parameters &#8220;-h 192.168.1.4&#8243;.<br />
</span><span style="font-size: 10pt">Host name &#8216;www1.company.com&#8217;.</span></td>
</tr>
</table>
<p style="margin-left: 27pt"><span style="font-size: 10pt; font-family: Courier New">check_oracle.sh[-h 192.168.1.4]<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt">ZABBIX will execute:<br />
</span></p>
<p style="margin-left: 27pt"><span style="font-size: 10pt; font-family: Courier New">check_oracle.sh www1.company.com -h 192.168.1.4.<br />
</span></p>
<p>I noticed the server side piece was actually looking for parens &#8220;(&#8221; rather than square brackets &#8220;[". I tried to use parens <span style="font-family: Courier New">check_oracle.sh(-h 192.168.1.4)</span> but the front end wouldn't accept them. I was able to modify the front-end php code so that it accepted the parentheses and it worked fine after that.</p>
<p>The zabbix frontend files are installed (on this particular vm) at /usr/share/zabbix. In /usr/share/zabbix/include/defines.inc.php (line 391) change the definition of ZBX_EREG_ITEM_KEY_FORMAT from:</p>
<p><span style="font-size: 10pt">define('ZBX_EREG_ITEM_KEY_FORMAT', '('.ZBX_EREG_INTERNAL_NAMES.'(\<span style="color: red"><strong>[</strong></span>'.ZBX_EREG_PARAMS.'\<span style="color: red"><strong>]</strong></span>){0,1})&#8217;);<br />
</span></p>
<p><span style="font-size: 10pt">To<br />
</span></p>
<p><span style="font-size: 10pt">define(&#8217;ZBX_EREG_ITEM_KEY_FORMAT&#8217;, &#8216;(&#8217;.ZBX_EREG_INTERNAL_NAMES.&#8217;(\<span style="color: red"><strong>(</strong></span>&#8216;.ZBX_EREG_PARAMS.&#8217;\<span style="color: red"><strong>)</strong></span>){0,1})&#8217;);<br />
</span><br />
I don&#8217;t know yet if this has been fixed in newer releases or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2008/04/02/zabbix-and-external-scripts-getting-them-to-work-v141/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modifying Neverfail permissions to be able to run client utils remotely.</title>
		<link>http://cars.lostroncos.org/2008/03/12/modifying-neverfail-permissions-to-be-able-to-run-client-utils-remotely/</link>
		<comments>http://cars.lostroncos.org/2008/03/12/modifying-neverfail-permissions-to-be-able-to-run-client-utils-remotely/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 05:22:09 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[neverfail]]></category>
		<category><![CDATA[addtrustedclient]]></category>
		<category><![CDATA[neverfail for Exchange]]></category>
		<category><![CDATA[neverfail group]]></category>
		<category><![CDATA[neverfail heartbeat]]></category>
		<category><![CDATA[nfclient]]></category>
		<category><![CDATA[permissions]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/2008/03/12/modifying-neverfail-permissions-to-be-able-to-run-client-utils-remotely/</guid>
		<description><![CDATA[<p>In early June I received a call at work from the Neverfail sales rep I had been working with on a recent purchase expressing concern about the Neverfail related content here. In contacting one the PR folks at Neverfail I got the following response.</p>
<p>Glad to hear from you. I can shed some light on this [...]]]></description>
			<content:encoded><![CDATA[<p>In early June I received a call at work from the Neverfail sales rep I had been working with on a recent purchase expressing concern about the Neverfail related content here. In contacting one the PR folks at Neverfail I got the following response.</p>
<blockquote><p><em>Glad to hear from you. I can shed some light on this concern. While your blog is not copying information from the KB&#8217;s, it is making direct reference to KB numbers and <strong><span style="color: #ff0000;">more importantly, giving out exact command syntax</span></strong> which is intended only for Neverfail customers/partners. <span style="color: #ff0000;">We don&#8217;t put this information into our technical documentation as it is competitive/proprietary to our intellectual property. </span>We post this information on the extranet which is only available to registered users via password for this reason. We&#8217;re happy to work with you, as we do many bloggers, to provide information that you can post. Please let me know if you have further questions and I&#8217;ll be happy to help.</em></p></blockquote>
<p>Given that I&#8217;m trying to run a technical blog for which posting &#8220;exact command syntax&#8221; might be useful I&#8217;ve decided to pull the content.</p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2008/03/12/modifying-neverfail-permissions-to-be-able-to-run-client-utils-remotely/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Updated ESX 3i scripts for Nagios</title>
		<link>http://cars.lostroncos.org/2008/03/07/updated-esx-3i-scripts-for-nagios/</link>
		<comments>http://cars.lostroncos.org/2008/03/07/updated-esx-3i-scripts-for-nagios/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 08:23:55 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[NAgios]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[virtualization]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/2008/03/07/updated-esx-3i-scripts-for-nagios/</guid>
		<description><![CDATA[<p>I had a little time today and needed to mentally switch gears so I took a look again at the 3i storage script for Nagios and made some changes to it to clean it up a little bit. I also made clones&#8230;er &#8230;versions rather&#8230;. for monitoring CPU status, memory status, and sensor data (i.e. fan [...]]]></description>
			<content:encoded><![CDATA[<p>I had a little time today and needed to mentally switch gears so I took a look again at the 3i storage script for Nagios and made some changes to it to clean it up a little bit. I also made clones&#8230;er &#8230;versions rather&#8230;. for monitoring CPU status, memory status, and sensor data (i.e. fan speeds, power supply status etc). The new version takes one less command line option and connects to the host managed object a little more directly.</p>
<p>As discussed earlier you could use IPMI just as easily to get the sensor data as the VMware APIs, but I added it just for consistency&#8217;s sake rather than having to manage two interfaces and sets of ids and passwords. Since the only servers I have access to at the moment are new Dell Poweredge&#8217;s right now I can only assume that these will also work with other manufacturers servers as they become supported.</p>
<p>As a reminder you need to install the appropriate VMware pieces for these scripts to run. Namely the VMware VI-Perl toolkit.</p>
<p>Script arguments are the same for all four of these scripts :</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2008/03/check_3i_storage.txt" target="_blank">check_3i_storage</a> –password &lt;passwd&gt; –username &lt;user&gt; –server &lt;ip addr/hostname&gt;</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2008/03/check_3i_cpu.txt" title="check_3i_cpu" target="_blank">check_3i_cpu</a> –password &lt;passwd&gt; –username &lt;user&gt; –server &lt;ip addr/hostname&gt;</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2008/03/check_3i_memory.txt" target="_blank">check_3i_memory</a> –password &lt;passwd&gt; –username &lt;user&gt; –server &lt;ip addr/hostname&gt;</p>
<p><a href="http://cars.lostroncos.org/wp-content/uploads/2008/03/check_3i_sensors.txt" target="_blank">check_3i_sensors</a> –password &lt;passwd&gt; –username &lt;user&gt; –server &lt;ip addr/hostname&gt;</p>
<p>I’ve also included the updated service and command definitions I’ve used in my test Nagios environment for reference.</p>
<pre>define service{
use                             generic-service
host_name                       svr-esx-test-01.company.com
service_description             ESX 3i Storage Status
check_command                   check_3i_storage!root!mypassword!
}</pre>
<hr />
<pre>define command{
command_name    check_3i_storage
command_line    $USER1$/check_3i_storage --server $HOSTADDRESS$ --username $ARG1$ --password $ARG2$
}</pre>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2008/03/07/updated-esx-3i-scripts-for-nagios/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Nagios Monitoring of ESX 3i on our PowerEdge</title>
		<link>http://cars.lostroncos.org/2008/02/26/nagios-monitoring-of-esx-3i-on-our-poweredge/</link>
		<comments>http://cars.lostroncos.org/2008/02/26/nagios-monitoring-of-esx-3i-on-our-poweredge/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 20:06:33 +0000</pubDate>
		<dc:creator>cars</dc:creator>
				<category><![CDATA[NAgios]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[monitoring]]></category>

		<guid isPermaLink="false">http://cars.lostroncos.org/2008/02/26/nagios-monitoring-of-esx-3i-on-our-poweredge/</guid>
		<description><![CDATA[<p>In earlier posts when I mentioned the use of IPMI I don&#8217;t think I ever circled back around on where we stood with that. While we can get some information about the status of the hardware via IPMI I haven&#8217;t been able to figure out how to get at the array controller to get the [...]]]></description>
			<content:encoded><![CDATA[<p>In earlier posts when I mentioned the use of IPMI I don&#8217;t think I ever circled back around on where we stood with that. While we can get some information about the status of the hardware via IPMI I haven&#8217;t been able to figure out how to get at the array controller to get the status. I&#8217;ve looked at sites like Nagios Exchange and some others, but none of those had what I was looking for.  I found one script that came close but would only tell me when the RAID disk was actually rebuilding, not when it was degraded. If we were to use RAID5 it might have been useful, but since we&#8217;re talking about going forward with RAID 6 to minimize our window of vulnerability and we&#8217;re using  large disks. So that&#8217;s why I went back and looked at the VMware SDK and VI-Perl toolkit.</p>
<p>Now that I have a script that will work from the command line I needed to take it and make it work for Nagios since that&#8217;s what we&#8217;ll probably end up using to monitor these servers once they&#8217;re deployed. (We&#8217;ll look at Dell&#8217;s IT Assistant again since we&#8217;re a dot version or two behind but I&#8217;m not holding out high hopes.)</p>
<p><span id="more-51"></span></p>
<p>While the simple version of this script will tell us when a disk is missing (i.e. we pulled one out to test it) it won&#8217;t tell us which one is missing but looking at the VI client can provide a clue. If we look at the <a href="http://http://cars.lostroncos.org/wp-content/uploads/2008/02/022208-0803-checkingsto1.png" target="_blank">screenshot from the earlier post</a> we can see Disks 0-9, but that Disk 7 is missing from the list. That&#8217;s the one we pulled. If the disk were bad my assumption (yet to be tested/seen) is that the drive would show up with a status of RED.  While it&#8217;d be possible to figure this out in the script I would need to keep configuration data for each class of server (or even each individual server). I&#8217;m more interested in a general purpose script to alert us, and then leave it up to the responsible admin to figure out what&#8217;s going on.</p>
<p style="margin-left: 54pt"><img src="http://cars.lostroncos.org/wp-content/uploads/2008/02/022608-2006-nagiosmonit1.png" /><span style="font-family: Times New Roman; font-size: 12pt"><br />
</span></p>
<p>One of the nice things that does happen though is when the disk is put back in and the RAID set is rebuilding we do see the new disk that was plugged in because it also starts in a Yellow state until the volume is rebuilt.</p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2008/02/022608-2006-nagiosmonit2.png" /></p>
<p><span style="color: #4f81bd; font-size: 9pt"><strong>Figure 1 &#8211; The Nagios View<br />
</strong></span></p>
<p><img src="http://cars.lostroncos.org/wp-content/uploads/2008/02/022608-2006-nagiosmonit3.png" /></p>
<p><span style="color: #4f81bd"><strong><span style="font-size: 9pt">Figure 2 &#8211; The view from the VI client</span><br />
</strong></span></p>
<p>Anyhow without further ado <a href="http://cars.lostroncos.org/wp-content/uploads/2008/02/check_3i_storage.txt">here&#8217;s the script</a>. Again it comes with the usual caveats: it&#8217;s rough, it mostly works, use at your own risk etc….</p>
<p>Script arguments are the same as before:</p>
<p>check_3i_storage –password &lt;passwd&gt; –username &lt;user&gt; –server &lt;ip addr/hostname&gt; –datacenter ha-datacenter</p>
<p>I&#8217;ve also included the preliminary service and command definitions I&#8217;ve used in my test environment for reference.</p>
<pre>define service{
use                             generic-service
host_name                       svr-esx-test-01.company.com
service_description             ESX 3i Storage Status
check_command                   check_3i_storage!root!mypassword!
}</pre>
<hr />
<pre>define command{
command_name    check_3i_storage
command_line    $USER1$/check_3i_storage --server $HOSTADDRESS$ --username $ARG1$ --password $ARG2$ --datacenter ha-datacenter
}</pre>
<p>My next steps would be to clean up the code and see if I can speed it up a little by starting with the host object directly rather than the &#8220;datacenter&#8221; managed object. It&#8217;d also be nice if it checked to make sure this was an ESX 3i box and not 3.5</p>
]]></content:encoded>
			<wfw:commentRss>http://cars.lostroncos.org/2008/02/26/nagios-monitoring-of-esx-3i-on-our-poweredge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
