<?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>seigafuse.com &#187; Network Monitoring</title>
	<atom:link href="http://seigafuse.com/category/technology/network-monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://seigafuse.com</link>
	<description>Mike Seigafuse&#039;s Technology and IT Security Blog</description>
	<lastBuildDate>Fri, 20 Aug 2010 16:23:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Barracuda plug-in for Nagios V3.1</title>
		<link>http://seigafuse.com/2010/08/20/barracuda-plug-in-for-nagios-v3-1/</link>
		<comments>http://seigafuse.com/2010/08/20/barracuda-plug-in-for-nagios-v3-1/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 16:22:00 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false">http://seigafuse.com/?p=253</guid>
		<description><![CDATA[Right on the heels of version 3.0 is the 3.1 version of the plug-in.  Once again thanks to Ray, this version now includes error checking for the SNMP get.  The previous version would not go critical on the failure to retrieve SNMP values. See the previous post for more details on usage, the only difference [...]]]></description>
			<content:encoded><![CDATA[<p>Right on the heels of version 3.0 is the 3.1 version of the plug-in.  Once again thanks to Ray, this version now includes error checking for the SNMP get.  The previous version would not go critical on the failure to retrieve SNMP values.</p>
<p><a class="downloadlink dlimg" href="http://seigafuse.com/wp-content/plugins/download-monitor/download.php?id=9" title="Version 3.1 downloaded 689 times" ><img src="http://seigafuse.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download Barracuda Plugin V3.1 Version 3.1" /></a></p>
<p>See the <a href="http://seigafuse.com/2010/08/11/barracuda-plugin-for-nagios-v3/">previous post</a> for more details on usage, the only difference in this version is the SNMP error checking which does not impact usage or installation.</p>
]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2010/08/20/barracuda-plug-in-for-nagios-v3-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Version 3 of the Barracuda plugin for Nagios</title>
		<link>http://seigafuse.com/2010/08/11/barracuda-plugin-for-nagios-v3/</link>
		<comments>http://seigafuse.com/2010/08/11/barracuda-plugin-for-nagios-v3/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 13:44:02 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false">http://seigafuse.com/?p=239</guid>
		<description><![CDATA[I have updated the Nagios plugin for Barracuda Spam &#38; Virus firewalls to V3.  This release has been tested under PHP5 and works with Barracuda firmware versions 3 and 4.  Barracuda Networks changed their MIB with version 4 firmware and the plugin now supports the new OIDs or the old by way of a configuration [...]]]></description>
			<content:encoded><![CDATA[<p>I have updated the Nagios plugin for Barracuda Spam &amp; Virus firewalls to V3.  This release has been tested under PHP5 and works with Barracuda firmware versions 3 and 4.  Barracuda Networks changed their MIB with version 4 firmware and the plugin now supports the new OIDs or the old by way of a configuration setting within the plugin script.  Read more below for details.</p>
<p><a class="downloadlink dlimg" href="http://seigafuse.com/wp-content/plugins/download-monitor/download.php?id=8" title="Version 3.0 downloaded 532 times" ><img src="http://seigafuse.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download Barracuda Plugin V3 Version 3.0" /></a></p>
<h1>Installation</h1>
<p>Place the check_cuda file in the nagios libexec folder along with all your other check plugins.  Don&#8217;t forget to<br />
set permissions and ownership as appropriate for your installation.  Version 3 was tested under PHP5 and should work with either 4 or 5 by simply using check_cuda.  Be sure to edit the check_cuda script and set the value of $cuda_firmware (line 10) to either 3 or 4 depending on the firmware version of the Barracdua Spam and Virus firewalls you will be using the plugin to check.</p>
<h1>Usage</h1>
<p>Usage: check_cuda &lt;host-ip&gt; &lt;community-string&gt; &lt;queue&gt; &lt;warning-threshold&gt; &lt;critical-threshold&gt;</p>
<p>Queue can be either in, out or bounce for firmware version 3 firewalls; for version 4 firewalls the values are<br />
in, out, deferred or latency</p>
<p>Warning and Critical values should be positive integers</p>
<h1>Prerequisites</h1>
<p>This plugin requires php and php_snmp support (as noted this version has been tested with PHP 5)</p>
<h1>Nagios Configuration</h1>
<h2>Commands</h2>
<p>Define commands as shown below:</p>
<p>define command {<br />
command_name Check Barracuda Inbound Mail Queue<br />
command_line $USER1$/check_cuda $HOSTADDRESS$ public in 500 1000<br />
}</p>
<p>define command {<br />
command_name Check Barracuda Outbound Mail Queue<br />
command_line $USER1$/check_cuda $HOSTADDRESS$ public out 500 1000<br />
}</p>
<p>Obviously you will need to change the SNMP community string from public to match your community string. If you wish you could also add a check command to track the bounce/deferred queue and even averagelatency on version 4 firmware. You may also want to use different warning and critical threshold than I did (500 and 1000 respectively). These numbers may not be right for your situation.<br />
Contact Groups</p>
<p>Add a service group like the one below (customizing for your site of course):</p>
<p># contactgroups Cuda Admins<br />
define contactgroup {<br />
contactgroup_name Cuda_Admins<br />
alias Cuda_Admins<br />
members joe,sally,fred<br />
}</p>
<h2>Service Templates</h2>
<p>define service {<br />
name Check Barracuda Mail Queue Template<br />
use generic-service<br />
contact_groups Cuda_Admins<br />
register 0<br />
}<br />
Services</p>
<p>Add the service as needed to your hosts, sample shown below:</p>
<p>define service {<br />
service_description Check Barracuda Inbound Mail Queue<br />
use Check Barracuda Mail Queue Template<br />
host_name yourcuda<br />
check_command Check Barracuda Inbound Mail Queue<br />
}</p>
<p>define service {<br />
service_description Check Barracuda Outbound Mail Queue<br />
use Check Barracuda Mail Queue Template<br />
host_name yourcuda<br />
check_command Check Barracuda Outbound Mail Queue<br />
}</p>
<p>Here is an excerpt from the Barracuda version 4 release notes that describes the new OID/Objects and their meanings:</p>
<table>
<tbody>
<tr>
<th>Object</th>
<th>Description</th>
</tr>
<tr>
<td>inQueueSize</td>
<td>Number of messages waiting to be processed by the Barracuda Spam &amp; Virus Firewall</td>
</tr>
<tr>
<td>outQueueSize</td>
<td>Number of messages waiting to be sent to the mail server</td>
</tr>
<tr>
<td>deferredQueueSize</td>
<td>Number of messages deferred because they could not be processed, and will be requeued for processing</td>
</tr>
<tr>
<td>avgEmailLatency</td>
<td>Difference between the time a message was received by the Barracuda Spam &amp; Virus Firewall and the time it is sent to the mail server</td>
</tr>
</tbody>
</table>
<p>A special note of thanks to Ray who pointed out that the plugin needed an update to support the new firmware and for testing the new version.  Thanks Ray!</p>
]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2010/08/11/barracuda-plugin-for-nagios-v3/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>The check_cuda plugin for Nagios has been updated</title>
		<link>http://seigafuse.com/2010/03/16/the-check_cuda-plugin-for-nagios-has-been-updated/</link>
		<comments>http://seigafuse.com/2010/03/16/the-check_cuda-plugin-for-nagios-has-been-updated/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 13:38:03 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false">http://seigafuse.com/?p=234</guid>
		<description><![CDATA[Thanks to Ray who pointed out a problem with the script under PHP5, the download of the plugin now includes a version that functions under PHP5, it can be found on this site here.]]></description>
			<content:encoded><![CDATA[<p>Thanks to Ray who pointed out a problem with the script under PHP5, the download of the plugin now includes a version that functions under PHP5, it can be found on this site <a href="http://seigafuse.com/2007/10/19/nagios-plugin-for-barracuda-spam-firewalls/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2010/03/16/the-check_cuda-plugin-for-nagios-has-been-updated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios Plugin for Barracuda Spam Firewalls</title>
		<link>http://seigafuse.com/2007/10/19/nagios-plugin-for-barracuda-spam-firewalls/</link>
		<comments>http://seigafuse.com/2007/10/19/nagios-plugin-for-barracuda-spam-firewalls/#comments</comments>
		<pubDate>Fri, 19 Oct 2007 18:53:38 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false">http://seigafuse.com/?p=38</guid>
		<description><![CDATA[In our environment we use Barracuda Spam Firewalls to handle in and outbound mail delivery. Wanting to keep an eye on the in and outbound queues to make sure we are not seeing any delays with delivery I went looking for ways to monitor the queues and alert when they are above certain thresholds. Barracuda [...]]]></description>
			<content:encoded><![CDATA[<p>In our environment we use Barracuda Spam Firewalls to handle in and outbound mail delivery.  Wanting to keep an eye on the in and outbound queues to make sure we are not seeing any delays with delivery I went looking for ways to monitor the queues and alert when they are above certain thresholds.  Barracuda exposes the queue lengths in a number of ways (CGI/API, web interface and SNMP) and since we wanted this automated and we already use Nagios I chose to use SNMP.  I tried some of the other SNMP plugins to try to use those, but after a bit of struggling without success I decided to write my own in PHP (mainly because that is what is easiest for me).  Use the download link below to download a zip file of the plugin.</p>
<p><a class="downloadlink dlimg" href="http://seigafuse.com/wp-content/plugins/download-monitor/download.php?id=4" title="Version 1.5 downloaded 1298 times" ><img src="http://seigafuse.com/wp-content/plugins/download-monitor/img/download.gif" alt="Download Barracuda Plugin Version 1.5" /></a></p>
<p>Or click on this link to see the code within this post.</p>
<p><a href="javascript:showme('6031_1');"> <b>> check_cuda</b></a>
<div style="display: none; background:white;" id=6031_1>
<pre class="php"><span style="color: #808080; font-style: italic;">#!/usr/bin/php -q</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># check_cuda - nagios plugin</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Copyright (C) 2007 Mike Seigafuse</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># This program is free software; you can redistribute it and/or</span>
<span style="color: #808080; font-style: italic;"># modify it under the terms of the GNU General Public License</span>
<span style="color: #808080; font-style: italic;"># as published by the Free Software Foundation; either version 2</span>
<span style="color: #808080; font-style: italic;"># of the License, or (at your option) any later version.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># This program is distributed in the hope that it will be useful,</span>
<span style="color: #808080; font-style: italic;"># but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<span style="color: #808080; font-style: italic;"># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<span style="color: #808080; font-style: italic;"># GNU General Public License for more details.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># You should have received a copy of the GNU General Public License</span>
<span style="color: #808080; font-style: italic;"># along with this program; if not, write to the Free Software</span>
<span style="color: #808080; font-style: italic;"># Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Report bugs to: mike@seigafuse.net</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># This script will check counters of a Barracuda Spam Firewall using PHP SNMP functions</span>
<span style="color: #808080; font-style: italic;"># and return them along with the status.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #0000ff;">$numbparams</span> = <a href="http://www.php.net/sizeof"><span style="color: #000066;">sizeof</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #808080; font-style: italic;"># should be 5</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$numbparams</span> &lt; <span style="color: #cc66cc;">5</span> <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"Usage: check_cuda &lt;host ip&gt; &lt;community string&gt; &lt;queue&gt; &lt;warn&gt; &lt;crit&gt;<span style="color: #000099; font-weight: bold;">\\n</span>"</span>;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"     Queue can be either in, out or bounce<span style="color: #000099; font-weight: bold;">\\n</span>"</span>;
	<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"     Warning and Critical values should be positive integers<span style="color: #000099; font-weight: bold;">\\n</span>"</span>;
	<a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #0000ff;">$host</span> = <span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #0000ff;">$cstring</span> = <span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #0000ff;">$checkqueue</span> = <a href="http://www.php.net/strtoupper"><span style="color: #000066;">strtoupper</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$warn</span> = <span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #0000ff;">$crit</span> = <span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
<span style="color: #0000ff;">$mailinqueue</span> = <span style="color: #ff0000;">"1.3.6.1.4.1.2021.8.1.101.1"</span>;
<span style="color: #0000ff;">$mailoutqueue</span> = <span style="color: #ff0000;">"1.3.6.1.4.1.2021.8.1.101.2"</span>;
<span style="color: #0000ff;">$mailbouncequeue</span> = <span style="color: #ff0000;">"1.3.6.1.4.1.2021.8.1.101.3"</span>;
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> getsnmpvalue<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #0000ff;">$cstring</span>, <span style="color: #0000ff;">$oid</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
     <span style="color: #0000ff;">$valuestring</span> = snmpget<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #0000ff;">$cstring</span>, <span style="color: #0000ff;">$oid</span><span style="color: #66cc66;">&#41;</span>;
     <span style="color: #0000ff;">$colpos</span> = <a href="http://www.php.net/strpos"><span style="color: #000066;">strpos</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$valuestring</span>, <span style="color: #ff0000;">":"</span><span style="color: #66cc66;">&#41;</span>;
     <span style="color: #0000ff;">$subvalue</span> = <a href="http://www.php.net/trim"><span style="color: #000066;">trim</span></a><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #000066;">substr</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$valuestring</span>, <span style="color: #0000ff;">$colpos</span><span style="color: #cc66cc;">+1</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
     <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$subvalue</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Ready set go, time to do the real work</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$checkqueue</span> == <span style="color: #ff0000;">"IN"</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0000ff;">$queuelen</span> = getsnmpvalue<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #0000ff;">$cstring</span>, <span style="color: #0000ff;">$mailinqueue</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$checkqueue</span> == <span style="color: #ff0000;">"OUT"</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
         <span style="color: #0000ff;">$queuelen</span> = getsnmpvalue<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #0000ff;">$cstring</span>, <span style="color: #0000ff;">$mailoutqueue</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$checkqueue</span> == <span style="color: #ff0000;">"BOUNCE"</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
         <span style="color: #0000ff;">$queuelen</span> = getsnmpvalue<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #0000ff;">$cstring</span>, <span style="color: #0000ff;">$mailbouncequeue</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$queuelen</span> &lt; <span style="color: #0000ff;">$warn</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0000ff;">$format</span> = <span style="color: #ff0000;">'%s OK - %d messages queued |Mail%sQueue=%d;%d;%d'</span>;
	<a href="http://www.php.net/printf"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$format</span>, <span style="color: #0000ff;">$checkqueue</span>, <span style="color: #0000ff;">$queuelen</span>, <span style="color: #0000ff;">$checkqueue</span>, <span style="color: #0000ff;">$queuelen</span>, <span style="color: #0000ff;">$warn</span>, <span style="color: #0000ff;">$crit</span><span style="color: #66cc66;">&#41;</span>;
	<a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$queuelen</span> &gt; <span style="color: #0000ff;">$warn</span><span style="color: #66cc66;">&#41;</span> &amp;&amp; <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$queuelen</span> &lt; <span style="color: #0000ff;">$crit</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0000ff;">$format</span> = <span style="color: #ff0000;">'%s Warning - %d messages queued |Mail%sQueue=%d;%d;%d'</span>;
	<a href="http://www.php.net/printf"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$format</span>, <span style="color: #0000ff;">$checkqueue</span>, <span style="color: #0000ff;">$queuelen</span>, <span style="color: #0000ff;">$checkqueue</span>, <span style="color: #0000ff;">$queuelen</span>, <span style="color: #0000ff;">$warn</span>, <span style="color: #0000ff;">$crit</span><span style="color: #66cc66;">&#41;</span>;
	<a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$queuelen</span> &gt; <span style="color: #0000ff;">$crit</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
	<span style="color: #0000ff;">$format</span> = <span style="color: #ff0000;">'%s Critical - %d messages queued |Mail%sQueue=%d;%d;%d'</span>;
	<a href="http://www.php.net/printf"><span style="color: #000066;">printf</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$format</span>, <span style="color: #0000ff;">$checkqueue</span>, <span style="color: #0000ff;">$queuelen</span>, <span style="color: #0000ff;">$checkqueue</span>, <span style="color: #0000ff;">$queuelen</span>, <span style="color: #0000ff;">$warn</span>, <span style="color: #0000ff;">$crit</span><span style="color: #66cc66;">&#41;</span>;
	<a href="http://www.php.net/exit"><span style="color: #000066;">exit</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
</div>
<h1>Usage</h1>
<p>Usage: <em>check_cuda host-ip community-string queue warning-threshold critical-threshold</em></p>
<p>Queue can be either in, out or bounce<br />
Warning and Critical values should be positive integers</p>
<p><em><strong>Note:</strong></em> Version 1.5 of the zip file includes check_cuda5, which is a version of the script that works under PHP5</p>
<h1>Prerequisites</h1>
<p>This plugin requires php_snmp support</p>
<h1>Nagios Configuration</h1>
<h2>Commands</h2>
<p>Define commands as shown below:</p>
<p>define command {<br />
command_name                    Check Barracuda Inbound Mail Queue<br />
command_line                    $USER1$/check_cuda $HOSTADDRESS$ public in 500 1000<br />
}</p>
<p>define command {<br />
command_name                    Check Barracuda Outbound Mail Queue<br />
command_line                    $USER1$/check_cuda $HOSTADDRESS$ public out 500 1000<br />
}</p>
<p>Obviously you will need to change the SNMP community string from public to match your community string.  If you wish you could also add a check command to track the bounce queue.  You may also want to use different warning and critical threshold than I did (500 and 1000 respectively).  These numbers may not be right for your situation.</p>
<h2>Contact Groups</h2>
<p>Add a service group like the one below (customizing for your site of course):</p>
<p># contactgroups Cuda Admins<br />
define contactgroup {<br />
contactgroup_name               Cuda_Admins<br />
alias                                    Cuda_Admins<br />
members                        joe,sally,fred<br />
}</p>
<h2>Service Templates</h2>
<p>define service {<br />
name                            Check Barracuda Mail Queue Template<br />
use                             generic-service<br />
contact_groups                  Cuda_Admins<br />
register                        0<br />
}</p>
<h2>Services</h2>
<p>Add the service as needed to your hosts, sample shown below:</p>
<p>define service {<br />
service_description             Check Barracuda Inbound Mail Queue<br />
use                             Check Barracuda Mail Queue Template<br />
host_name                       yourcuda<br />
check_command                   Check Barracuda Inbound Mail Queue<br />
}</p>
<p>define service {<br />
service_description             Check Barracuda Outbound Mail Queue<br />
use                             Check Barracuda Mail Queue Template<br />
host_name                       yourcuda<br />
check_command                   Check Barracuda Outbound Mail Queue<br />
}</p>
<p>If you have any questions, comments or problems then just post a comment on this post and I&#8217;ll get back to you.</p>
<p><strong>Update (January 2008) </strong></p>
<p>There are now some additional plug-ins available to perform the same functions written in PERL and with hooks to graphing solutions.  You can find them <a href="http://www.nagiosexchange.org/Search_Projects.43.0.html?tx_netnagext_pi1%5Bphrase%5D=barracuda&amp;tx_netnagext_pi1%5Bsubmit%5D=search&amp;tx_netnagext_pi1%5Boptions%5D%5Bshort%5D=1&amp;tx_netnagext_pi1%5Boptions%5D%5Bdescription%5D=1&amp;tx_netnagext_pi1%5Bsearch%5D=1">here.</a></p>
<p><strong>Update (March 2010)</strong></p>
<p>The new version (1.5) of the zip file contains check_cuda5, which has been updated to work with PHP5 (check_cuda was originally written under php4 and seemed to have an issue under php5 with the shebang line)</p>
]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2007/10/19/nagios-plugin-for-barracuda-spam-firewalls/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Graphing Nortel Contivity Switch user sessions in Cacti</title>
		<link>http://seigafuse.com/2007/01/26/graphing-nortel-contivity-switch-user-sessions-in-cacti/</link>
		<comments>http://seigafuse.com/2007/01/26/graphing-nortel-contivity-switch-user-sessions-in-cacti/#comments</comments>
		<pubDate>Sat, 27 Jan 2007 01:37:28 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false">http://seigafuse.com/?p=25</guid>
		<description><![CDATA[We have looked for how to monitor user sessions on our Contivity Switches for some time and couldn&#8217;t find an easy way to do so. Ultimately I wrote a small script to collect the information and return it for graphing in Cacti. To get this setup, use the script below along with the instructions on [...]]]></description>
			<content:encoded><![CDATA[<p>We have looked for how to monitor user sessions on our Contivity Switches for some time and couldn&#8217;t find an easy way to do so. Ultimately I wrote a small script to collect the information and return it for graphing in Cacti.  To get this setup, use the script below along with the instructions on the Cacti site that you can find <a href="http://cacti.net/downloads/docs/html/script_to_graph.html">here.</a></p>
<p><a href="javascript:showme('7812_1');"> <b>> nortel_users.php</b></a>
<div style="display: none; background:white;" id=7812_1>
<pre class="php"><span style="color: #808080; font-style: italic;">#!/usr/bin/php -q</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #0000ff;">$no_http_headers</span> = <span style="color: #000000; font-weight: bold;">true</span>;
<span style="color: #0000ff;">$hostname</span> = <span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #0000ff;">$snmp_community</span> = <span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #0000ff;">$snmp_version</span> = <span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #808080; font-style: italic;"># This is a small utility to count the number of user sessions on a nortel </span>
<span style="color: #808080; font-style: italic;"># OID to use to get list of active users</span>
<span style="color: #0000ff;">$oid</span> = <span style="color: #ff0000;">".1.3.6.1.2.1.31.1.1.1.1"</span>;
<span style="color: #0000ff;">$resultarray</span> = <a href="http://www.php.net/array"><span style="color: #000066;">array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">if</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$argv</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span> != <span style="color: #ff0000;">''</span> <span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
	<span style="color: #0000ff;">$resultarray</span> = snmpwalk<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$hostname</span>,<span style="color: #0000ff;">$snmp_community</span>, <span style="color: #0000ff;">$oid</span><span style="color: #66cc66;">&#41;</span>;
	<span style="color: #0000ff;">$numb_users</span> = <span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#40;</span><a href="http://www.php.net/sizeof"><span style="color: #000066;">sizeof</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$resultarray</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">-3</span><span style="color: #66cc66;">&#41;</span>;
	<a href="http://www.php.net/print"><span style="color: #000066;">print</span></a> <span style="color: #ff0000;">"users:$numb_users<span style="color: #000099; font-weight: bold;">\\n</span>"</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #808080; font-style: italic;"># Thats all folks</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2007/01/26/graphing-nortel-contivity-switch-user-sessions-in-cacti/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A tweak to PHP Network Weathermap</title>
		<link>http://seigafuse.com/2007/01/25/a-tweak-to-php-network-weathermap/</link>
		<comments>http://seigafuse.com/2007/01/25/a-tweak-to-php-network-weathermap/#comments</comments>
		<pubDate>Fri, 26 Jan 2007 03:41:42 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false">http://seigafuse.com/?p=24</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2007/01/25/a-tweak-to-php-network-weathermap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily link to Cacti or Perfparse graphs from Nagios</title>
		<link>http://seigafuse.com/2006/11/04/easily-link-to-cacti-graphs-from-nagios/</link>
		<comments>http://seigafuse.com/2006/11/04/easily-link-to-cacti-graphs-from-nagios/#comments</comments>
		<pubDate>Sat, 04 Nov 2006 13:19:55 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Nagios (http://www.nagios.org) is a great network monitoring tool. Cacti (http://www.cacti.net) is a great network graphing tool. Perfparse (http://perfparse.sourceforge.net/ is a great add-on to Nagios that collects host performance data as part of the Nagios check command. Perfparse is great at collecting performance data when you are running Nagios client software, but short of doing a [...]]]></description>
			<content:encoded><![CDATA[<p><font size="2" face="'MS Sans Serif',Geneva,sans-serif">Nagios (<a href="http://www.nagios.org">http://www.nagios.org</a>) is a great network monitoring tool.  Cacti (<a href="http://www.cacti.net">http://www.cacti.net</a>) is a great network graphing tool.  Perfparse (<a href="http://perfparse.sourceforge.net/">http://perfparse.sourceforge.net/</a> is a great add-on to Nagios that collects host performance data as part of the Nagios check command.  Perfparse is great at collecting performance data when you are running Nagios client software, but short of doing a lot of SNMP MIB and OID tweaking, it is easier to use Cacti to collect performance data on devices where you can&#8217;t run Nagios client software (on routers, switches or network appliances for example).  But, having three different user interfaces can be annoying.  I wanted a way to to link to the Cacti and Perfparse graphs for a host or device directly from Nagios using the Notes URL without having to enter a unique URL for each host or device.   I created a PHP script to handle Cacti, and entered the URL for the scripts in the Notes URL in the Nagios configuration (extended information templates).  In the extended information templates for Cacti hosts I entered:</font></p>
<p><font size="-3">http://yourhost/nagtocacti.php?hostip=$HOSTADDRESS$&#038;hostname=$HOSTNAME$</font></p>
<p><font size="2" face="'MS Sans Serif',Geneva,sans-serif">And in the extended information template for Perfparse hosts I entered:</font></p>
<p><font size="-3">http://yourhost/path-to/perfparse.cgi?select_metric=1&#038;host_name=$HOSTNAME$ </font></p>
<p><font size="2" face="'MS Sans Serif',Geneva,sans-serif">This procedure assumes you have Nagios, Perfparse and Cacti installed on the same host, and that you have saved the code below in the web root of that server as nagtocacti.php and modified the dbhost, dbname, dbuser and dbpass values to match your environment.</font></p>
<p><code> <a href="javascript:showme('5690_1');"> <b>> nagtocacti.php</b></a>
<div style="display: none; background:white;" id=5690_1>
<pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #0000ff;">$dbhost</span> = <span style="color: #ff0000;">"localhost"</span>;
<span style="color: #0000ff;">$dbname</span> = <span style="color: #ff0000;">"cacti"</span>;
<span style="color: #0000ff;">$dbuser</span> = <span style="color: #ff0000;">"DB username"</span>;
<span style="color: #0000ff;">$dbpass</span> = <span style="color: #ff0000;">"DB user's password"</span>;
<span style="color: #0000ff;">$hostip</span> = <span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'hostip'</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #0000ff;">$hostname</span> = <a href="http://www.php.net/strtoupper"><span style="color: #000066;">strtoupper</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'hostname'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #0000ff;">$hostid</span> = <span style="color: #ff0000;">""</span>;
<span style="color: #0000ff;">$link</span> = <a href="http://www.php.net/mysql_connect"><span style="color: #000066;">mysql_connect</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$dbhost</span>, <span style="color: #0000ff;">$dbuser</span>, <span style="color: #0000ff;">$dbpass</span><span style="color: #66cc66;">&#41;</span>
or <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Could not connect : "</span> . <a href="http://www.php.net/mysql_error"><span style="color: #000066;">mysql_error</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/mysql_select_db"><span style="color: #000066;">mysql_select_db</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$dbname</span><span style="color: #66cc66;">&#41;</span> or <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Could not select database"</span><span style="color: #66cc66;">&#41;</span>;
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"Searching for host by IP..."</span>;
<span style="color: #0000ff;">$query</span> = <span style="color: #ff0000;">"select id from host where hostname='$hostip'"</span>;
<span style="color: #0000ff;">$result</span> = <a href="http://www.php.net/mysql_query"><span style="color: #000066;">mysql_query</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #66cc66;">&#41;</span>
or <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Query failed : "</span> . <a href="http://www.php.net/mysql_error"><span style="color: #000066;">mysql_error</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$row</span> = <a href="http://www.php.net/mysql_fetch_array"><span style="color: #000066;">mysql_fetch_array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$result</span>, MYSQL_NUM<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0000ff;">$hostid</span> = <span style="color: #0000ff;">$row</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$hostid</span> != <span style="color: #ff0000;">""</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0000ff;">$myurl</span> = <span style="color: #ff0000;">"&lt;meta content="</span>\\<span style="color: #ff0000;">" http-equiv="</span>refresh<span style="color: #ff0000;">" /&gt;"</span>;
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"$myurl"</span>;
<a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"Searching for host by name"</span>;
<span style="color: #0000ff;">$query</span> = <span style="color: #ff0000;">"select id from host where hostname like '$hostname%'"</span>;
<span style="color: #0000ff;">$result</span> = <a href="http://www.php.net/mysql_query"><span style="color: #000066;">mysql_query</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #66cc66;">&#41;</span>
or <a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">"Query failed : "</span> . <a href="http://www.php.net/mysql_error"><span style="color: #000066;">mysql_error</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$row</span> = <a href="http://www.php.net/mysql_fetch_array"><span style="color: #000066;">mysql_fetch_array</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$result</span>, MYSQL_NUM<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0000ff;">$hostid</span> = <span style="color: #0000ff;">$row</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$hostid</span> != <span style="color: #ff0000;">""</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
<span style="color: #0000ff;">$myurl</span> = <span style="color: #ff0000;">"&lt;meta content="</span>\\<span style="color: #ff0000;">" http-equiv="</span>refresh<span style="color: #ff0000;">" /&gt;"</span>;
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"$myurl"</span>;
<a href="http://www.php.net/die"><span style="color: #000066;">die</span></a><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;
<span style="color: #66cc66;">&#125;</span>
<a href="http://www.php.net/echo"><span style="color: #000066;">echo</span></a> <span style="color: #ff0000;">"Host not found in Cacti..."</span>;
<span style="color: #66cc66;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;</pre>
</div>
<p></code><font size="2" face="'MS Sans Serif',Geneva,sans-serif"><br />
</font></p>
]]></content:encoded>
			<wfw:commentRss>http://seigafuse.com/2006/11/04/easily-link-to-cacti-graphs-from-nagios/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

