Trouble adding check-aacraid.py to Nagios

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.
Grizzly
Posts: 11
Joined: Sun Mar 03, 2013 9:11 am

Re: Trouble adding check-aacraid.py to Nagios

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Trouble adding check-aacraid.py to Nagios

Post 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:

Code: Select all

which python
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 
} 
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Grizzly
Posts: 11
Joined: Sun Mar 03, 2013 9:11 am

Re: Trouble adding check-aacraid.py to Nagios

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Trouble adding check-aacraid.py to Nagios

Post by abrist »

So running it from the command line works, but running it from nagios (as a check) returns (null). Is that correct?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Grizzly
Posts: 11
Joined: Sun Mar 03, 2013 9:11 am

Re: Trouble adding check-aacraid.py to Nagios

Post 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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Trouble adding check-aacraid.py to Nagios

Post 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".
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Grizzly
Posts: 11
Joined: Sun Mar 03, 2013 9:11 am

Re: Trouble adding check-aacraid.py to Nagios

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Trouble adding check-aacraid.py to Nagios

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Grizzly
Posts: 11
Joined: Sun Mar 03, 2013 9:11 am

Re: Trouble adding check-aacraid.py to Nagios

Post 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!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Trouble adding check-aacraid.py to Nagios

Post 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.
Locked