Enhance ospfd_simple check #19

Merged
jdubois merged 2 commits from enhance_check_ospfd_simple into dev 2020-04-29 15:46:21 +02:00

View file

@ -3,10 +3,16 @@
. /usr/local/libexec/nagios/utils.sh
# check if ospfd is running
if [[ "$(ospfctl show 2>&1)" = *"/var/run/ospfd.sock:"* ]]; then
echo "CRITICAL - OSPFD not running"
if ! ls /var/run/ospfd* > /dev/null 2>&1; then
echo "CRITICAL - OSPFD not running, no socket found"
exit "$STATE_CRITICAL"
else
echo "OK - OSPFD is running"
exit "$STATE_OK"
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"
Review

Is OSPFD not running or in a failed state but running ?

Is OSPFD not running or in a failed state but running ?
Review

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.

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.
Review

OK for now, well see if we have to make it more descriptive in the future.

OK for now, well see if we have to make it more descriptive in the future.
fi
fi