EvoBSD/roles/nagios-nrpe/files/plugins_bsd/check_ospfd_simple

19 lines
561 B
Bash
Executable file

#!/bin/sh
. /usr/local/libexec/nagios/utils.sh
# check if ospfd is running
if ! ls /var/run/ospfd* > /dev/null 2>&1; then
echo "CRITICAL - OSPFD not running, no socket found"
exit "$STATE_CRITICAL"
else
if ospfctl show 2>&1 | grep -q "Uptime"; then
uptime=$(ospfctl show | grep Uptime | awk '{print $2}')
echo "OK - OSPFD has been running for $uptime"
exit "$STATE_OK"
else
echo "CRITICAL - OSPFD not running"
exit "$STATE_CRITICAL"
fi
fi