<?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>thoughts of a doug &#187; Nagios</title>
	<atom:link href="http://somethingdoug.com/thoughts/tag/nagios/feed/" rel="self" type="application/rss+xml" />
	<link>http://somethingdoug.com/thoughts</link>
	<description></description>
	<lastBuildDate>Fri, 21 Oct 2011 05:03:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Net::NSCA::Client Introduction</title>
		<link>http://somethingdoug.com/thoughts/2010/11/03/netnscaclient-introduction/</link>
		<comments>http://somethingdoug.com/thoughts/2010/11/03/netnscaclient-introduction/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 07:27:17 +0000</pubDate>
		<dc:creator>Douglas Wilson</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Perl5]]></category>

		<guid isPermaLink="false">http://somethingdoug.com/thoughts/2010/11/03/netnscaclient-introduction/</guid>
		<description><![CDATA[I have realized that I’ve never announced my Perl module Net::NSCA::Client. This module was created to make it easy for Perl applications to report to a NSCA server. NSCA (which stands for NetSaint Check Acceptor) is not very good at it’s job, but there is no replacement for it that I am aware of (though [...]]]></description>
			<content:encoded><![CDATA[<p>I have realized that I’ve never announced my Perl module <a href="http://search.cpan.org/perldoc?Net::NSCA::Client">Net::NSCA::Client</a>. This module was created to make it easy for Perl applications to report to a NSCA server. NSCA (which stands for NetSaint Check Acceptor) is not very good at it’s job, but there is no replacement for it that I am aware of (though I hope to change this in the future).</p>
<p>I needed to be able to send reports back to NSCA easily from Perl programs (and without needing to go through the <code>send_nsca</code> program that comes with NSCA). I came across <a href="http://search.cpan.org/perldoc?Net%3A%3ANsca">Net::Nsca</a>, which mostly works, besides for the fact that I need to change the packet version in the code to 3 (which is not easy to do since it wasn’t made to be changed).</p>
<p>I decided to make my own NSCA client, using <a href="http://search.cpan.org/perldoc?Moose">Moose</a> and would be hopefully more flexible. A sort example of sending a report in some routine in a server would be:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">sub</span> nsca_heart_beat <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">my</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$self</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">nsca_client</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">send_report</span><span style="color: #009900;">&#40;</span>
        hostname <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$self</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">hostname</span><span style="color: #339933;">,</span>
        service  <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'server'</span><span style="color: #339933;">,</span>
        message  <span style="color: #339933;">=&gt;</span> <span style="color: #ff0000;">'Running'</span><span style="color: #339933;">,</span>
        status   <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">$Net</span><span style="color: #339933;">::</span><span style="color: #006600;">NSCA</span><span style="color: #339933;">::</span><span style="color: #006600;">Client</span><span style="color: #339933;">::</span><span style="color: #006600;">STATUS_OK</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000066;">return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>This is good and all, but not really a killer feature by any means. What really is a winner here is the <a href="http://search.cpan.org/perldoc?Net::NSCA::Client::ServerConfig">Net::NSCA::Client::ServerConfig</a> class that was added in version 0.007. One of the biggest problems with NSCA is that what is sent over the network is not portable. Yes, the data is made to be aligned in network order, but it actually sends a native C structure over the network. The problem is what happens when the server and client happen to compile different structures? This is what ServerConfig is for. It also makes it easy if it any of the constants defined in the NSCA source files were changed when NSCA was built. This client is the only one of the currently three others on the CPAN to support this.</p>
<p>I’ve currently been working on this module in my spare time and coming up is support for encryption methods besides XOR (like AES) as well as complete support for the standard <code>send_nsca.cfg</code> configuration file, plus much more.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingdoug.com/thoughts/2010/11/03/netnscaclient-introduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Big Updates to Nagios::Plugin::OverHTTP</title>
		<link>http://somethingdoug.com/thoughts/2010/04/07/big-updates-to-nagios-plugin-overhttp/</link>
		<comments>http://somethingdoug.com/thoughts/2010/04/07/big-updates-to-nagios-plugin-overhttp/#comments</comments>
		<pubDate>Wed, 07 Apr 2010 16:48:53 +0000</pubDate>
		<dc:creator>Douglas Wilson</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Perl5]]></category>

		<guid isPermaLink="false">http://somethingdoug.com/thoughts/?p=172</guid>
		<description><![CDATA[I was contacted by Peter van Eijk who was interested in getting performance data support added to Nagios-Plugin-OverHTTP and I quickly moved to add it in. Version 0.14 added performance data support and a major overhaul was made to the class layout. I was inspired by the layout of Plack and thought that it was [...]]]></description>
			<content:encoded><![CDATA[<p>I was contacted by Peter van Eijk who was interested in getting performance data support added to <a href="http://search.cpan.org/dist/Nagios-Plugin-OverHTTP/">Nagios-Plugin-OverHTTP</a> and I quickly moved to add it in. Version 0.14 added performance data support and a major overhaul was made to the class layout. I was inspired by the layout of <a href="http://search.cpan.org/dist/Plack/">Plack</a> and thought that it was a great layout for a pluggable system. I hope to a &#8220;builder&#8221; class similar to <a href="http://search.cpan.org/perldoc?Plack::Builder">Plack::Builder</a> so users can create all kinds of plugins based off Nagios-Plugin-OverHTTP. As soon as the builder class comes out, I will created a very detailed post on the greatness of this plugin.</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingdoug.com/thoughts/2010/04/07/big-updates-to-nagios-plugin-overhttp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios::Plugin::OverHTTP Planned Additions</title>
		<link>http://somethingdoug.com/thoughts/2010/02/05/nagios-plugin-overhttp-planned-additions/</link>
		<comments>http://somethingdoug.com/thoughts/2010/02/05/nagios-plugin-overhttp-planned-additions/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 22:12:25 +0000</pubDate>
		<dc:creator>Douglas Wilson</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Perl5]]></category>

		<guid isPermaLink="false">http://somethingdoug.com/thoughts/?p=160</guid>
		<description><![CDATA[I usually get e-mails about my Nagios::Plugin::OverHTTP asking about little things being added here and there. The last e-mail I got was from Peter van Eijk asking for support for performance data. I looked over the code and realized that it really needs some refactoring before I can easily add support for performance data, and [...]]]></description>
			<content:encoded><![CDATA[<p>I usually get e-mails about my <a href="http://search.cpan.org/dist/Nagios-Plugin-OverHTTP/">Nagios::Plugin::OverHTTP</a> asking about little things being added here and there. The last e-mail I got was from Peter van Eijk asking for support for performance data. I looked over the code and realized that it really needs some refactoring before I can easily add support for performance data, and so I am currently hung up on that before the feature will get added.</p>
<p>My current thoughts on support for getting performance data from the remote page would be to just scrape it from the standard plugin output, which is supported as the body:</p>
<pre>PLUGIN OK - Good to go! | time=0.012s;1;10;10;0</pre>
<p>I was also thinking about how to add support for receiving as headers, since the other supported aspects of the plugin may be transmitted as headers. My current thoughts are for a header named <code>X-Nagios-Performance</code> which would hold the <code>name=value</code> pair, separated by spaces like the normal plugin and would also allow more than one header with the data to be present:</p>
<pre>X-Nagios-Performance: time=0.012s;1;10;10;0
X-Nagios-Performance: count=2;;;50;0 other=4;;;4;0</pre>
<p>For Nagios::Plugin::OverHTTP itself, since the remote plugin can provide critical and warning thresholds, I was thinking of allowing for actually changing the status based on that to be made optional by default (because if the remote plugin said the status was OK but yet a performance metric it sent said that it should really be in a WARNING state, by default Nagios would have kept that as OK so I believe that my plugin should honor that as well by default). New options for the plugin would be:</p>
<pre>--warning name=threshold
--critical name=threshold
--use-transmitted-thresholds
--override-transmitted-thresholds</pre>
<p>The last option <code>--override-transmitted-thresholds</code> would cause the performance data written as the plugin&#8217;s output to be changed to match the thresholds given as the plugin&#8217;s options. This means a plugin with the given options <code>--override-transmitted-thresholds --critical time=4</code> would cause the performance data to say <code>time=0.012s;1;4;10;0</code> instead of <code>time=0.012s;1;10;10;0</code> (note that this setting does not affect the decision of the final status code).</p>
]]></content:encoded>
			<wfw:commentRss>http://somethingdoug.com/thoughts/2010/02/05/nagios-plugin-overhttp-planned-additions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New check_over_http features</title>
		<link>http://somethingdoug.com/thoughts/2009/05/14/new-check_over_http-features/</link>
		<comments>http://somethingdoug.com/thoughts/2009/05/14/new-check_over_http-features/#comments</comments>
		<pubDate>Thu, 14 May 2009 16:20:04 +0000</pubDate>
		<dc:creator>Douglas Wilson</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[cpan]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Perl5]]></category>

		<guid isPermaLink="false">http://somethingdoug.com/thoughts/2009/05/14/new-check_over_http-features/</guid>
		<description><![CDATA[Yesterday I finished up some more features to Plugin::Nagios::OverHTTP. Before the only parameter that could be passed was url. Now this parameter can still be passed, but you may also pass other individual parameters, including hostname, path, and ssl. This helps improve the check_over_http utility which would be used in the Nagios checking. Typically the [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I finished up some more features to <a href="http://search.cpan.org/dist/Nagios-Plugin-OverHTTP/">Plugin::Nagios::OverHTTP</a>. Before the only parameter that could be passed was <span style="font-family: Courier New;">url</span>. Now this parameter can still be passed, but you may also pass other individual parameters, including <span style="font-family: Courier New;">hostname</span>, <span style="font-family: Courier New;">path</span>, and <span style="font-family: Courier New;">ssl</span>. This helps improve the check_over_http utility which would be used in the Nagios checking. Typically the command definition would have been something like the following:</p>
<pre>define command{
        command_name check_over_http
        command_line check_over_http --url=$ARG1$ $ARG2$
        }</pre>
<p>This means the following would need to be in a service definition:</p>
<pre>define service{
        use                            noncritical-service

        host_name                      server1
        service_description            Connection to MySQL
        notes                          Checks if the server can connect to remote MySQL
        check_command                  check_over_http!http://server1/nagios/check_remote_mysql
        }</pre>
<p>As you can see, the check command duplicates the hostname, which is not the way of Nagios plugins. Now With version 0.04 and up, we can have the following definitions:</p>
<pre>define command{
        command_name check_over_http
        command_line check_over_http --hostname=$HOSTADDRESS$ --path=$ARG1$ $ARG2$
        }</pre>
<pre>define service{
        use                            noncritical-service

        host_name                      server1
        service_description            Connection to MySQL
        notes                          Checks if the server can connect to remote MySQL
        check_command                  check_over_http!/nagios/check_remote_mysql
        }</pre>
]]></content:encoded>
			<wfw:commentRss>http://somethingdoug.com/thoughts/2009/05/14/new-check_over_http-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

