Nagios Plugin not Working

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Post Reply
Posts: 10
Joined: Sun Jun 19, 2022 3:28 am

Nagios Plugin not Working

Post 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 nameoftheear.ear server1 omeglz server2 "

Thanks in advance
Last edited by MurbiesWalto on Fri Jul 15, 2022 6:19 am, edited 1 time in total.
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: Nagios Plugin not Working

Post by gormank »

Are you running it as the nagios user?
Post Reply