Hi Guys
I am once again looking for assistance.
I am busy reading up on Nagios in order to have the installation properly set up as the person who did oour last installation did not do it properly.
I found a 'ping plugin script' in the book but I felt that there was somehting not right in the script so I tested it...guess what? It didn;t work (as it should)
The script reads as follows:
#!/bin/sh
OUTPUT='ping -c5 server | tail -n2'
if [ $? -gt 0 ]
then
echo "CRITICAL!! $OUTPUT"
exit 2
else
echo "OK! $OUTPUT"
exit 0
fi
This is supposed to do a ping and returns a message accordingly then exits with a specified status.
However, even if I put in a server name or garbage where the server name is supposed to be, it still returns that the ping was successful.
Can someone assist me to identify what is missing in this script?
Thank you