Enhance ospfd_simple check #19
|
@ -3,10 +3,16 @@
|
||||||
. /usr/local/libexec/nagios/utils.sh
|
. /usr/local/libexec/nagios/utils.sh
|
||||||
|
|
||||||
# check if ospfd is running
|
# check if ospfd is running
|
||||||
if [[ "$(ospfctl show 2>&1)" = *"/var/run/ospfd.sock:"* ]]; then
|
if ! ls /var/run/ospfd* > /dev/null 2>&1; then
|
||||||
echo "CRITICAL - OSPFD not running"
|
echo "CRITICAL - OSPFD not running, no socket found"
|
||||||
exit "$STATE_CRITICAL"
|
exit "$STATE_CRITICAL"
|
||||||
else
|
else
|
||||||
echo "OK - OSPFD is running"
|
if ospfctl show 2>&1 | grep -q "Uptime"; then
|
||||||
exit "$STATE_OK"
|
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
|
fi
|
||||||
|
|
Loading…
Reference in a new issue
Is OSPFD not running or in a failed state but running ?
If we got there, then the socket file was not found, and the ospfctl command failed. I don't think OSPFD can be running with a failure on a ospfctl command. Conversely, I think that if the ospfctl command successes, then OSPFD surely is running.
OK for now, well see if we have to make it more descriptive in the future.