Over at INEX we’ve embarked on a forklift upgrade of the primary peering LAN using Extreme Networks Summit x670’s and x460’s. As usual, we need to monitor these 24/7 and we have just written a new Extreme Networks chassis monitoring script which should work with most Extreme devices.
It will check and generate alerts on the following items:
- a warning if the device was recently rebooted;
- a warning / critical if any found temperature sensors are in a non-normal state;
- a warning / critical if any found fans are in a non-normal state;
- a warning / critical if any found PSUs are in a non-normal state (or missing);
- a warning / critical if the 5 sec CPU utilisation is above set thresholds;
- a warning / critical if the memory utilisation is above set thresholds.
You’ll find the script in this Github repository: barryo/nagios-plugins.
A some verbose output follows:
./check_chassis_extreme.php -c -h 10.11.12.13 -v
CPU: 5sec - 4%
Last reboot: 4007.7666666667 minutes ago
Uptime: 2.8 days.
PSU: 1 - presentOK (Serial: 1429W-xxxxx; Source: ac)
PSU: 2 - presentOK (Serial: 1429W-xxxxx; Source: ac)
Fan: 101 - OK (4388 RPM)
Fan: 102 - OK (9273 RPM)
Fan: 103 - OK (4428 RPM)
Fan: 104 - OK (9273 RPM)
Fan: 105 - OK (4551 RPM)
Fan: 106 - OK (9452 RPM)
Over temp alert: NO
Memory used in slot 1: 29%
OK - CPU: 5sec - 4%. Uptime: 2.8 days. PSUs: 1 - presentOK;
2 - presentOK;. Overall system power state: redundant power
available. Fans: [101 - OK (4388 RPM)]; [102 - OK (9273 RPM)];
[103 - OK (4428 RPM)]; [104 - OK (9273 RPM)]; [105 - OK (4551
RPM)]; [106 - OK (9452 RPM)];. Temp: 39'C.
Memory (slot:usage%): 1:29%.
I came across Pushover recently which makes it easy to send real-time notifications to your Android and iOS devices. And easy it is. It also allows you to set up applications with logos so that you can have multiple Nagios installations shunting alerts to you via Pushover with each one easily identifiable. After just a day playing with this, it’s much nicer than SMS’.
So, to set up Pushover with Nagios, first register for a free Pushover account. Then create a new application for your Nagios instance. I set the type to Script and also upload a logo. After this, you will be armed with two crucial pieces of information: your application API tokan/key (
$APP_KEY) and your user key (
To get the notification script, clone this GitHub repository or just down this file – notify-by-pushover.php.
You can test this immediately with:
echo "Test message" | \
./notify-by-pushover.php HOST $APP_KEY $USER_KEY RECOVERY OK
The parameters are:
USAGE: notify-by-pushover.php <$APP_KEY> \
Now, set up the new notifications in Nagios / Icinga:
# 'notify-by-pushover-service' command definition
command_line /usr/bin/printf "%b" "$NOTIFICATIONTYPE$: \
$SERVICEDESC$@$HOSTNAME$: $SERVICESTATE$ \
($SERVICEOUTPUT$)" | \
SERVICE $APP_KEY $CONTACTADDRESS1$ \
# 'notify-by-pushover-host' command definition
command_line /usr/bin/printf "%b" "Host '$HOSTALIAS$' \
is $HOSTSTATE$: $HOSTOUTPUT$" | \
HOST $APP_KEY $CONTACTADDRESS1$ $NOTIFICATIONTYPE$ \
Then, in your contact definition(s) add / update as follows:
Make sure you break something to test that this works!
It is good practice to separate Nagios checks of your web server being available from checking SSL certificate expiry. The latter need only be run once per day and should not add unnecessary noise to a more immediately important web service failure.
check_http to monitor SSL certificate expiry dates, first ensure you have a daily service definition – let’s call this
service-daily. Now create two service commands as follows:
command_line /usr/lib/nagios/plugins/check_http -S \
-I $HOSTADDRESS$ -w 5 -c 10 -p $ARG1$ -C $ARG2$
command_line /usr/lib/nagios/plugins/check_http -S \
-I $ARG3$ -w 5 -c 10 -p $ARG1$ -C $ARG2$
The second is useful for checking named certificates on additional IP addresses on web servers serving multiple SSL domains.
We can use these to check SSL certificates for POP3, IMAP, SMTP and HTTP:
service_description POP3 SSL Certificate
service_description IMAP SSL Certificate
service_description SMPT SSL Certificate
service_description SSL Cert: www.example.com
service_description SSL Cert: www.example.net
We’ve just added a check_rsnapshot.php script to our nagios-plugins bundle on Github. This script will verify rsnapshot backups via Nagios using a number of checks / tests:
- minfiles – checks the number of files in a snapshot against a minimum expected number;
- minsize – checks the size of a snapshot against a minimum expected size;
- log – parses the rsnapshot log to ensure the most recent runs for each retention period completed successfully;
- timestamp – checks for files created server side containing a timestamp and thus ensuring snapshots are succeeding;
- rotation – checks that retention directories are being rotated; and
- dir-creation – checks that retention directories are being created.
Please see this Github wiki page for more information including instructions.
We create a lot of Nagios installations for our own systems over, for customer systems which we manage and as a service over at Open Solutions. We’ve written a lot of custom Nagios plugins over the years as part of this process.
We are now making a concerted effort to find them, clean them, maintain them centrally and release them for the good of others.
To that end, we have created a repository on GitHub for the task with a detailed readme file:
They main goal of Nagios plugins that we write and release are:
- BSD (or BSD like) license so you can hack away to wield into something that may be more suitable for your own environment;
- scalable in that if we are polling power supply units (PSUs) in a Cisco switch then it should not matter if there is one or a hundred – the script should handle them all;
- WARNINGs are designed for email notifications during working hours; CRITICAL means an out of hours text / SMS message;
- each script should be an independant unit with no dependancies on each other or unusual Perl module requirements;
- the scripts should all be run with the
--verbose on new kit. This will provide an inventory of what it finds as well as show anything that is being skipped. OIDs searched for by the script but reported as not supported on the target device should really be skipped via various
- useful help available via