Page 2 of 3
Re: Trouble adding check-aacraid.py to Nagios
Posted: Mon Mar 04, 2013 4:23 pm
by Grizzly
I already had the command configured in nrpe.cfg as:
Code: Select all
command[check_aacraid]=/usr/local/sbin/check-aacraid.py
But since it wasn't working I went ahead and tried removing NRPE from the equation anyway, nothing I've tried works.
Here are all the different "command_line"s I tried to use in the command definition:
Code: Select all
$USER1$/check_aacraid
$USER1$/check_aacraid.py
/usr/local/sbin/check_aacraid
/usr/local/sbin/check_aacraid.py
all return: Return code of 127 is out of bounds - plugin may be missing, I put a copy of check_aacraid.py into /usr/local/nagios/libexec for the commands that used $USER1$,
Code: Select all
python /usr/local/sbin/check_aacraid
python /usr/local/sbin/check_aacraid.py
both return (null). Not sure if any of these errors are better/worse/tell us any more about the NRPE error I was getting before, or even if I was doing the right thing to cut out NRPE. Afraid I can't work any more on this tonight but I will check back in tomorrow.
Re: Trouble adding check-aacraid.py to Nagios
Posted: Mon Mar 04, 2013 5:35 pm
by abrist
Cutting NRPE out is the right decision as NRPE is for remote checks. Not sure why you are getting null. You may have to put the full path to python and the beginning of the command definition:
Will output the path to python (/usr/bin/python in my case)
And here is the redefined command:
Code: Select all
define command {
command_name check_aacraid
command_line /usr/bin/python $USER1$/check_aacraid.py
}
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 12:16 pm
by Grizzly
The path to python for me was also /usr/bin/python. Changed the command, restarted nagios and still getting null in status information.
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 12:33 pm
by abrist
So running it from the command line works, but running it from nagios (as a check) returns (null). Is that correct?
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 1:55 pm
by Grizzly
I'm a noob, the filename uses a - not a _ like NRPE used.
Code: Select all
/usr/bin/python $USER1$/check-aacraid.py
The above gives me the correct status information, still getting a critical status though.
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 1:59 pm
by abrist
What is full output you are receiving? I will dig through the plugin source and see if I can get you an answer on "why".
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 2:26 pm
by Grizzly
Output is
Code: Select all
Logical Device 0 Optimal, Controller Optimal, Battery Status ZMM not installed
I'll take a look through as well but I've never used python so may not get very far, have a feeling it's to do with that batter status though.
EDIT: the plugin I'm using is actually a patched version of the original:
http://exchange.nagios.org/directory/Pl ... ch/details
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 2:36 pm
by abrist
It is most definitely the battery that is causing the alert. You may be able to edit the plugin to ignore that or always return "0" for the battery.
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 2:59 pm
by Grizzly
Commented out all the code to do with the battery in check-aacraid.py and I'm now getting a status OK and status info is the same as before but with the battery status chopped off!
Thanks for all the help abrist, I suppose all that's left to do now is check I get a critical when one of the arrays is having trouble, will have to leave that until tomorrow though.
Thanks again!
Re: Trouble adding check-aacraid.py to Nagios
Posted: Tue Mar 05, 2013 3:02 pm
by slansing
Great! Glad to hear you got it working they way you needed. Let us know how the rest of the configuration goes tomorrow.