i am writing a bash script to monitor netapp volumes which are greater than 90%
Code: Select all
#!/bin/bash
OK=0
CRITICAL=2
sshpass -p 'test_user' ssh -o StrictHostKeyChecking=no -l test_user 10.0.01 'volume show -percent-used > 90%' |awk '{print $2,$6,$7,$8}' | column -t >> strcritical
cat strcritical;
if [[ `cat strcritical` == *"your"* ]]
then
echo "OK"
exit $OK
rm -rf strcritical;
else
echo "CRITICAL"
rm -rf strcritical;
exit $CRITICAL;
fiBut even though i have given the exit codes for critical and ok in the script, nagiosxi is not understanding that.
When i am integating this with nagios xi, it is not changing the service state. Seems like some syntax issue.
Could you please how to change the above script make it work.
Regards
Venk