I can run the curl request on the nagios server and it returns the values I am expecting.
Where I am running into the issue is figuring out how to tell nagios what fields to look at for the exit codes.
I found a snippet of code that seems to do this, but I need to tie the $CHECK variable to the correct field in the response.
Code: Select all
if [[ "$CHECK" == "OK" ]]; then
echo "SERVICE OK"
exit 0
elif [[ "$CHECK" == "Failed" ]]; then
echo "Service not working: ${SERVER}"
exit 2
else
echo "Check failed"
exit 3
fiHow would I go about doing that?
Thank you!