<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: OpenVZ Bean Counters Nagios Script</title>
	<atom:link href="http://www.kbrandt.com/2008/10/openvz-beancounters-nagios-script.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kbrandt.com/2008/10/openvz-beancounters-nagios-script.html</link>
	<description>Original computing articles by a systems administrator</description>
	<lastBuildDate>Wed, 07 Sep 2011 00:44:02 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Sourygna</title>
		<link>http://www.kbrandt.com/2008/10/openvz-beancounters-nagios-script.html/comment-page-1#comment-3090</link>
		<dc:creator>Sourygna</dc:creator>
		<pubDate>Mon, 01 Jun 2009 08:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.kbrandt.com/?p=32#comment-3090</guid>
		<description>Hello,

Seems to me that the script has two bugs.

First a string/int type bug from cmd_parser.add_option (as default, add_option method enforces the &quot;string&quot; type).
Here are the changes I&#039;ve made :
19,21c19,21
&lt; cmd_parser.add_option(&#039;-w&#039;, action=&#039;store&#039;, dest=&#039;warning_range&#039;, type=&quot;int&quot;, nargs=1, default=10, help=&quot;Set increment for warning response, default=10&quot;)
&lt; cmd_parser.add_option(&#039;-c&#039;, action=&#039;store&#039;, dest=&#039;critical_range&#039;, type=&quot;int&quot;, nargs=1, default=20, help=&quot;Set increment for critical response, default=20&quot;)
 cmd_parser.add_option(&#039;-w&#039;, action=&#039;store&#039;, dest=&#039;warning_range&#039;, nargs=1, default=10, help=&quot;Set increment for warning response, default=10&quot;)
&gt; cmd_parser.add_option(&#039;-c&#039;, action=&#039;store&#039;, dest=&#039;critical_range&#039;, nargs=1, default=20, help=&quot;Set increment for critical response, default=20&quot;)
&gt; cmd_parser.add_option(&#039;-f&#039;, action=&#039;store&#039;, dest=&#039;check_file&#039;, nargs=1, default=&#039;/tmp/bean_check.txt&#039;, 

Second is a math bug. For instance I you have the case where error[1] = options.critical_range, the script will never report the error.
So I&#039;ve done :
82c82
= options.warning_range and error[1]  		if error[1] &gt; options.warning_range and error[1] &lt; options.critical_range:
87c87
= options.critical_range:
---
&gt; 		if error[1] &gt; options.critical_range:

Once changed, the script works great. Thanks!</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Seems to me that the script has two bugs.</p>
<p>First a string/int type bug from cmd_parser.add_option (as default, add_option method enforces the &#8220;string&#8221; type).<br />
Here are the changes I&#8217;ve made :<br />
19,21c19,21<br />
&lt; cmd_parser.add_option(&#8216;-w&#8217;, action=&#8217;store&#8217;, dest=&#8217;warning_range&#8217;, type=&#8221;int&#8221;, nargs=1, default=10, help=&#8221;Set increment for warning response, default=10&#8243;)<br />
&lt; cmd_parser.add_option(&#8216;-c&#8217;, action=&#8217;store&#8217;, dest=&#8217;critical_range&#8217;, type=&#8221;int&#8221;, nargs=1, default=20, help=&#8221;Set increment for critical response, default=20&#8243;)<br />
 cmd_parser.add_option(&#8216;-w&#8217;, action=&#8217;store&#8217;, dest=&#8217;warning_range&#8217;, nargs=1, default=10, help=&#8221;Set increment for warning response, default=10&#8243;)<br />
&gt; cmd_parser.add_option(&#8216;-c&#8217;, action=&#8217;store&#8217;, dest=&#8217;critical_range&#8217;, nargs=1, default=20, help=&#8221;Set increment for critical response, default=20&#8243;)<br />
&gt; cmd_parser.add_option(&#8216;-f&#8217;, action=&#8217;store&#8217;, dest=&#8217;check_file&#8217;, nargs=1, default=&#8217;/tmp/bean_check.txt&#8217;, </p>
<p>Second is a math bug. For instance I you have the case where error[1] = options.critical_range, the script will never report the error.<br />
So I&#8217;ve done :<br />
82c82<br />
= options.warning_range and error[1]  		if error[1] &gt; options.warning_range and error[1] &lt; options.critical_range:<br />
87c87<br />
= options.critical_range:<br />
&#8212;<br />
&gt; 		if error[1] &gt; options.critical_range:</p>
<p>Once changed, the script works great. Thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

