Nagios Plugin for Barracuda Spam Firewalls
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.
Downloaded a total of 338 times
Or click on this link to see the code within this post.
Usage
Usage: check_cuda host-ip community-string queue warning-threshold critical-threshold
Queue can be either in, out or bounce
Warning and Critical values should be positive integers
Prerequisites
This plugin requires php_snmp support
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 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.
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
}
If you have any questions, comments or problems then just post a comment on this post and I’ll get back to you.
Update (January 2008)
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 here.
3 Comments »
Filed under: Network Monitoring
