ec2 ami/XI... Return code of 127 is out of bounds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
metadojo
Posts: 7
Joined: Thu Mar 29, 2012 1:16 pm

ec2 ami/XI... Return code of 127 is out of bounds

Post by metadojo »

Hello,

I am running a small instance of
AMI: nagiosxi/centos/6/2.2-SNAPSHOT-1/x86_64 (ami-8f8d53e6)
the nagios image in AWS EC2.

I tried installing the check_mongo.py plugin into nagios XI with these directions....
http://www.doug.kerr-net.us/mediawiki/i ... _Configure

in short...
define command {
command_name check_mongodb
command_line $USER1$/nagios-plugin-mongodb/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
}

define service {
use generic-service
hostgroup_name Mongo Servers
service_description Mongo Connect Check
check_command check_mongodb!connect!27017!2!4

}

and then i go to the XI UI and
create a command
a host to point to my mongodb install
and a nagios service that runs the check command

unfortunately i get Return code of 127 is out of bounds, plugin may be missing

I tried installing pymongo manually with yum install pymongo.

I tried changing the command structure from

$USER1$/nagios-plugin-mongodb/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
To
$USER1$ /check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
To
/usr/local/nagios/libexec/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$

and i chmod the check_mongo.py file to 777

nothing has worked so far.

any ideas?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: ec2 ami/XI... Return code of 127 is out of bounds

Post by scottwilkerson »

it should be
$USER1$/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$

No space between $USER1$ and /check_mongodb.py

just to verify, can you run

Code: Select all

cd /usr/local/nagios/libexec/
ls -l check_mongodb.py
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
metadojo
Posts: 7
Joined: Thu Mar 29, 2012 1:16 pm

Re: ec2 ami/XI... Return code of 127 is out of bounds

Post by metadojo »

thanks .. my problems were multiple fold.

• The nagios XI web interface uploads the plugin to a directory different than my command path is referering.
• Since I opened in windows before upload its DOS based carriage returns
• The first line in the plugin needed to be edited to do !#/usr/local/python as opposed to what it had !#/usr/local/env python
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: ec2 ami/XI... Return code of 127 is out of bounds

Post by scottwilkerson »

Yep those DOS based carriage returns can sure throw things off...

Glad you got it resolved.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked