Page 1 of 1

Nagios Plugin not Working

Posted: Mon Jul 11, 2022 1:24 am
by MurbiesWalto
I'm having an issue when i try to port my bash script to nagios.The scripts works fine when I run on console, but when I run it from Nagios i get the msg "(null)" - In the nagios debug log I see that it parse the script well but it returns the error msg..

I'm not very good at scripting so i guess i'll need some help

The objective of the script is to check *.ears version from some servers, md5 them and compare the output to see if the version matches or not. To do that, i have a json on these servers that prints the name of the *.ear and his md5.

so.. The first part of the script gets that info from the json with curl and stores just the md5 number on a .tempfile , then it compares both temp files and if they match i got the $STATE_OK msg. If they dont , it creates a .datetmp file with the date ( the objective of this is to print a message after 48hs of inconsistence). Then, i make a diff of the .datetmp file and the days i wanna check if the result is less than 48hrs it prints the $STATE_WAR, if the result is more than 48 hrs it Prints the $STATE_CRI

The sintaxis of the script is " $ sh script.sh nameoftheear.ear server1 omeglz server2 "

Thanks in advance

Re: Nagios Plugin not Working

Posted: Mon Jul 11, 2022 4:57 pm
by gormank
Are you running it as the nagios user?