#!/bin/sh # check_pfsense_carp Version 0.1 # Copyright 2015, Justin Edmands, justinedmands@gmail.com # Info available from http://justinedmands.com/?q=nagios_check_pfsense_rtt # License for use: http://www.opensource.org/licenses/bsd-license.php # # NOTES: # Place this file in your pfsense nagios plugin directory. # As of pfsense 2.2.2, this is /usr/pbi/nrpe-amd64/local/libexec/nagios. # # Make the plugin executable with chmod 755. # # This does not account for INIT states which are unplugged cables # # $1 needs to be an interface such as em0,em1,em2,igb0,igb1,igb2,igb3,etc. # $2 needs to be MASTER or BACKUP if [ `ifconfig | grep carp | tr -s " " | cut -f 2 -d " " | grep -v INIT | uniq` == $1 ] then echo "Status OK - ALL interfaces are $1" stateid=0 else echo "Status ERROR - ALL interfaces are not $1" stateid=2 fi exit $stateid