mongoDB Nagios Monitoring
-
- Posts: 27
- Joined: Sat Dec 13, 2014 4:02 am
mongoDB Nagios Monitoring
Dear All,
I am unable to monitor the mongoDB and stuck in an error: (Return code of 126 is out of bounds - plugin may not be executable).
1) When i execute directly
# /usr/lib64/nagios/plugins/check_mongodb -H 192.168.2.8 -A connections -W 10 -C 20
OK - 0 percent (1 of 51200 connections used)
it gives acurate output.
2) But when i execute it through service/command it gives the mentioned error.
define service {
use generic-service
host_name mongoDB
service_description MongoDB
check_command check_mongodb!connections!27017!10!20
}
defince command {
command_name check_mongodb
command_line $USER1$/check_mongodb -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
}
3) service nagios restart executied but on updating nagios console found "Return code of 126 is out of bounds - plugin may not be executable" with Status-Critical.
Please help out to manage this issue.
Regards
RMA
I am unable to monitor the mongoDB and stuck in an error: (Return code of 126 is out of bounds - plugin may not be executable).
1) When i execute directly
# /usr/lib64/nagios/plugins/check_mongodb -H 192.168.2.8 -A connections -W 10 -C 20
OK - 0 percent (1 of 51200 connections used)
it gives acurate output.
2) But when i execute it through service/command it gives the mentioned error.
define service {
use generic-service
host_name mongoDB
service_description MongoDB
check_command check_mongodb!connections!27017!10!20
}
defince command {
command_name check_mongodb
command_line $USER1$/check_mongodb -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
}
3) service nagios restart executied but on updating nagios console found "Return code of 126 is out of bounds - plugin may not be executable" with Status-Critical.
Please help out to manage this issue.
Regards
RMA
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: mongoDB Nagios Monitoring
Can you please share what value $USER1$ holds in:
It's possible that that value is pointing to the wrong directory, or do all of your other checks with $USER1$ work fine? Also, what is the output of:
Code: Select all
~nagios/etc/resource.cfg
Code: Select all
ls -la /usr/lib64/nagios/plugins/check_mongodb
Re: mongoDB Nagios Monitoring
Also, is the plugin executable by the nagios user?
The permissions on the plugin should look like this (check_ping as an example):
Code: Select all
sudo -u nagios /usr/lib64/nagios/plugins/check_mongodb -H 192.168.2.8 -A connections -W 10 -C 20
Code: Select all
-rwxr-xr-x. 1 nagios nagios 176433 May 19 2014 /usr/local/nagios/libexec/check_ping
-
- Posts: 27
- Joined: Sat Dec 13, 2014 4:02 am
Re: mongoDB Nagios Monitoring
PS: slansing
Nagios Resource file contains the $USER1$ value "/usr/lib64/nagios/plugins" & Output of
PS: emislivec
Write permissions for check_mongody.py is as
Nagios Resource file contains the $USER1$ value "/usr/lib64/nagios/plugins" & Output of
Code: Select all
/usr/lib64/nagios/plugins/check_mongodb
OK - Connection took 0 seconds
Write permissions for check_mongody.py is as
Code: Select all
-rwxr-xr-x. 1 root root 59053 Nov 25 20:24 /usr/lib64/nagios/plugins/check_mongodb.py
-
- Posts: 27
- Joined: Sat Dec 13, 2014 4:02 am
Re: mongoDB Nagios Monitoring
Dear All,
Cannot understand this execution, according to me every this fine but unable to get manage, please help me out.
Cannot understand this execution, according to me every this fine but unable to get manage, please help me out.
Re: mongoDB Nagios Monitoring
Can you run the check through nrpe on the remote box?
Code: Select all
./check_nrpe -H localhost -p 5666 -c check_mongo_free
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.
"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.
Re: mongoDB Nagios Monitoring
Did you get your original problem fixed? It's easier for us to help you if we keep threads to one topic.rmuhammadali wrote:Dear All,
Cannot understand this execution, according to me every this fine but unable to get manage, please help me out.
Does your plugin live at "/usr/lib64/nagios/plugins/check_mongodb"? Where did "/usr/lib64/nagios/plugins/check_mongodb.py" come from?
Are you trying to run
Code: Select all
/usr/lib64/nagios/plugins/check_mongodb -H 192.168.2.8 -A connections -W 10 -C 20
Code: Select all
/usr/lib64/nagios/plugins/check_mongodb -A connections -P 27017 -W 80 -C 90
What happens when you run your command on the NRPE box (run these exact commands):
Code: Select all
ssh root@192.168.1.10
/usr/lib64/nagios/plugins/check_mongodb -A connections -P 27017 -W 80 -C 90
sudo -u nagios /usr/lib64/nagios/plugins/check_mongodb -A connections -P 27017 -W 80 -C 90
You may need to add "sudo " to the start of your command definition in nrpe.cfg, and add a sudoers rule for the nagios user. The doc I linked shows an example of this.
-
- Posts: 27
- Joined: Sat Dec 13, 2014 4:02 am
Re: mongoDB Nagios Monitoring
Dear,
let me define myself again.
1) plugin is placed @ /usr/lib64/nagios/plugins directory
2) command @ my client /etc/nagios/nrpe.cfg
& allowed hosts @ my client /etc/nagios/nrpe.cfg
3) as i write befone about error "Return code of 126 is out of bounds - plugin may not be executable", its already resolved, as i change file permoissions.
4) both commands show same results on nagios server
commands running good but when i tried to fetch through service it gives below error.
5) my configurations @ nagios server /etc/nagios/myconf
6) nagios core result
Now suggest what to do.
let me define myself again.
1) plugin is placed @ /usr/lib64/nagios/plugins directory
Code: Select all
[root@cent plugins]# ls -al check_mongodb*
lrwxrwxrwx. 1 root root 42 Dec 15 15:47 check_mongodb -> /usr/lib64/nagios/plugins/check_mongodb.py
-rwxr-xr-x. 1 root root 59053 Nov 25 20:24 check_mongodb.py
Code: Select all
command[check_mongo_free]=/usr/lib64/nagios/plugins/check_mongodb -A connections -P 27017 -W 80 -C 90
Code: Select all
allowed_hosts=127.0.0.1,192.168.2.10
4) both commands show same results on nagios server
Code: Select all
/usr/lib64/nagios/plugins/check_mongodb -A connections -P 27017 -W 80 -C 90
OK - 0 percent (1 of 51200 connections) used
sudo -u nagios /usr/lib64/nagios/plugins/check_mongodb -A connections -P 27017 -W 80 -C 90
OK - 0 percent (1 of 51200 connections) used
5) my configurations @ nagios server /etc/nagios/myconf
Code: Select all
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$ -t 160
}
Code: Select all
define command {
command_name check_mongodb
command_line $USER1$/check_mongodb.py -H $HOSTADDRESS$ -A $ARG1$ -P $ARG2$ -W $ARG3$ -C $ARG4$
}
Code: Select all
define service{
use generic-service
host_name CENT
service_description Mongo Free Connections
check_command check_nrpe!check_mongo_free!connections!27017!70!80
}
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: mongoDB Nagios Monitoring
If nrpe on the remote host is being started under xinetd then please check:rmuhammadali wrote:& allowed hosts @ my client /etc/nagios/nrpe.cfg
Code: Select all
allowed_hosts=127.0.0.1,192.168.2.10
Code: Select all
/etc/xinetd.d/nrpe
Code: Select all
only_from = 127.0.0.1 192.168.2.10
Then restart the xinetd service.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 27
- Joined: Sat Dec 13, 2014 4:02 am
Re: mongoDB Nagios Monitoring
no dear, its not running under xinetd.