I have updated the Nagios plugin for Barracuda Spam & 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.

Installation
Place the check_cuda file in the nagios libexec folder along with all your other check plugins. Don’t forget to
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.
Usage
Usage: check_cuda <host-ip> <community-string> <queue> <warning-threshold> <critical-threshold>
Queue can be either in, out or bounce for firmware version 3 firewalls; for version 4 firewalls the values are
in, out, deferred or latency
Warning and Critical values should be positive integers
Prerequisites
This plugin requires php and php_snmp support (as noted this version has been tested with PHP 5)
Nagios Configuration
Commands
Define commands as shown below:
define command {
command_name Check Barracuda Inbound Mail Queue
command_line $USER1$/check_cuda $HOSTADDRESS$ public in 500 1000
}
define command {
command_name Check Barracuda Outbound Mail Queue
command_line $USER1$/check_cuda $HOSTADDRESS$ public out 500 1000
}
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.
Contact Groups
Add a service group like the one below (customizing for your site of course):
# contactgroups Cuda Admins
define contactgroup {
contactgroup_name Cuda_Admins
alias Cuda_Admins
members joe,sally,fred
}
Service Templates
define service {
name Check Barracuda Mail Queue Template
use generic-service
contact_groups Cuda_Admins
register 0
}
Services
Add the service as needed to your hosts, sample shown below:
define service {
service_description Check Barracuda Inbound Mail Queue
use Check Barracuda Mail Queue Template
host_name yourcuda
check_command Check Barracuda Inbound Mail Queue
}
define service {
service_description Check Barracuda Outbound Mail Queue
use Check Barracuda Mail Queue Template
host_name yourcuda
check_command Check Barracuda Outbound Mail Queue
}
Here is an excerpt from the Barracuda version 4 release notes that describes the new OID/Objects and their meanings:
| Object |
Description |
| inQueueSize |
Number of messages waiting to be processed by the Barracuda Spam & Virus Firewall |
| outQueueSize |
Number of messages waiting to be sent to the mail server |
| deferredQueueSize |
Number of messages deferred because they could not be processed, and will be requeued for processing |
| avgEmailLatency |
Difference between the time a message was received by the Barracuda Spam & Virus Firewall and the time it is sent to the mail server |
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!