z

Commercial Support Clients: Clients with support contracts can get escalated support assistance by visiting Nagios Answer Hub. These forums are for community support services. Although we at Nagios try our best to help out on the forums here, we always give priority support to our support clients.

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.

Nagios Plugin not Working

Postby MurbiesWalto » Mon Jul 11, 2022 1:24 am

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
Last edited by MurbiesWalto on Fri Jul 15, 2022 6:19 am, edited 1 time in total.
MurbiesWalto
 
Posts: 10
Joined: Sun Jun 19, 2022 3:28 am

Re: Nagios Plugin not Working

Postby gormank » Mon Jul 11, 2022 4:57 pm

Are you running it as the nagios user?
gormank
 
Posts: 1125
Joined: Tue Dec 02, 2014 12:00 pm


Return to Open Source Nagios Projects

Who is online

Users browsing this forum: Google [Bot], sdenjuopl148 and 36 guests