check_blackberry5 and error (Return code of 127)
check_blackberry5 and error (Return code of 127)
Hello,
I'm attempting to configure the Blackberry 5.03 BES check found at the link below.
http://exchange.nagios.org/directory/Pl ... E3/details
I've installed the plugin, changed the permission to root(0).
Created the following commands...
check_blackberry_version
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q bes-version
$ARG1$= smtp community (ddgpublic)
e.g. output: BlackBerry Enterprise Server Version: 5.0.3.19
check_blackberry_srpconnect
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q srpconnect
$ARG1$= smtp community (ddgpublic)
e.g. output: OK: Successful connected to SRP-Router. Last Connection: Fri Dec 11 13:47:46 EST 2009
check_blackberry_pendingmail
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q pending $ARG2$
$ARG1$= smtp community (ddgpublic)
$ARG2$= warning values (-w 10 -c 20)
e.g. output: CRITICAL: Pending Mails: 1260554597|Pending=1260554597;10;20;;
check_blackberry_LicensesUsed
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q licenses $ARG2$
$ARG1$= smtp community (ddgpublic)
$ARG2$= warning values (-w 85 -c 90)
e.g. output: OK: Licenses used: 81|Licenses=81;85;90;;
Created HostGroup
SVC - Blackberry BES 5.03
Created Services
SVC - Blackberry 5.03 LicensesUsed
SVC - Blackberry 5.03 PendingMail
SVC - Blackberry 5.03 SrpConnect
SVC - Blackberry 5.03 Version
Installed SNMP Service on Blackberry server and configured SNMP Trap community name ddgpublic linked to Nagios IP.
When I view the services in Nagios XI I find that the each have the following error.
(Return code of 127 is out of bounds - plugin may be missing)
Suggestions
I'm attempting to configure the Blackberry 5.03 BES check found at the link below.
http://exchange.nagios.org/directory/Pl ... E3/details
I've installed the plugin, changed the permission to root(0).
Created the following commands...
check_blackberry_version
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q bes-version
$ARG1$= smtp community (ddgpublic)
e.g. output: BlackBerry Enterprise Server Version: 5.0.3.19
check_blackberry_srpconnect
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q srpconnect
$ARG1$= smtp community (ddgpublic)
e.g. output: OK: Successful connected to SRP-Router. Last Connection: Fri Dec 11 13:47:46 EST 2009
check_blackberry_pendingmail
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q pending $ARG2$
$ARG1$= smtp community (ddgpublic)
$ARG2$= warning values (-w 10 -c 20)
e.g. output: CRITICAL: Pending Mails: 1260554597|Pending=1260554597;10;20;;
check_blackberry_LicensesUsed
$ /usr/local/nagios/libexec/check_blackberry5 -H $HOSTADDRESS$ -C $ARG1$ -Q licenses $ARG2$
$ARG1$= smtp community (ddgpublic)
$ARG2$= warning values (-w 85 -c 90)
e.g. output: OK: Licenses used: 81|Licenses=81;85;90;;
Created HostGroup
SVC - Blackberry BES 5.03
Created Services
SVC - Blackberry 5.03 LicensesUsed
SVC - Blackberry 5.03 PendingMail
SVC - Blackberry 5.03 SrpConnect
SVC - Blackberry 5.03 Version
Installed SNMP Service on Blackberry server and configured SNMP Trap community name ddgpublic linked to Nagios IP.
When I view the services in Nagios XI I find that the each have the following error.
(Return code of 127 is out of bounds - plugin may be missing)
Suggestions
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: check_blackberry5 and error (Return code of 127)
127 generally means that the nagios daemon either cannot access it or it does not have execute rights. So I would first suggest listing the permissions on that check
Then also su to the nagios user and attempt to execute it.
Code: Select all
ls -lva /usr/local/nagios/libexec/check_blackberry5Code: Select all
su nagios
cd /usr/local/nagios/libexec
check_blackberry5 -H $HOSTADDRESS$ -C ddgpublic -Q pending -w 10 -c 20Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Re: check_blackberry5 and error (Return code of 127)
Hi there,
Here's some output you were asking about...
The permission I changed to root after importing the plugin...
[root@Mis1SmMo02 ~]# ls -lva /usr/local/nagios/libexec/check_blackberry5
-rwxr-xr-x 1 root root 4465 Jan 28 08:45 /usr/local/nagios/libexec/check_blackberry5
[root@Mis1SmMo02 ~]#
Then also su to the nagios user and attempt to execute it...
[nagios@Mis1SmMo02 libexec]$ check_blackberry5 -H <IP REMOVED> -C ddgpublic -Q pending -w 10 -c 20
bash: check_blackberry5: command not found
Let me know what you think.
Thanks
Here's some output you were asking about...
The permission I changed to root after importing the plugin...
[root@Mis1SmMo02 ~]# ls -lva /usr/local/nagios/libexec/check_blackberry5
-rwxr-xr-x 1 root root 4465 Jan 28 08:45 /usr/local/nagios/libexec/check_blackberry5
[root@Mis1SmMo02 ~]#
Then also su to the nagios user and attempt to execute it...
[nagios@Mis1SmMo02 libexec]$ check_blackberry5 -H <IP REMOVED> -C ddgpublic -Q pending -w 10 -c 20
bash: check_blackberry5: command not found
Let me know what you think.
Thanks
Re: check_blackberry5 and error (Return code of 127)
Ahh, typo. You need to run
while in that directory.
Code: Select all
./check_blackberry5 -H $HOSTADDRESS$ -C ddgpublic -Q pending -w 10 -c 20Former Nagios employee
Re: check_blackberry5 and error (Return code of 127)
THis is what I got...
[root@Mis1SmMo02 libexec]# su nagios
[nagios@Mis1SmMo02 libexec]$ cd /usr/local/nagios/libexec
[nagios@Mis1SmMo02 libexec]$ ./check_blackberry5 -H <IP REMOVED> -C ddgpublic -Q pending -w 10 -c 20
bash: ./check_blackberry5: /bin/bash^M: bad interpreter: No such file or directory
[nagios@Mis1SmMo02 libexec]$
[root@Mis1SmMo02 libexec]# su nagios
[nagios@Mis1SmMo02 libexec]$ cd /usr/local/nagios/libexec
[nagios@Mis1SmMo02 libexec]$ ./check_blackberry5 -H <IP REMOVED> -C ddgpublic -Q pending -w 10 -c 20
bash: ./check_blackberry5: /bin/bash^M: bad interpreter: No such file or directory
[nagios@Mis1SmMo02 libexec]$
Re: check_blackberry5 and error (Return code of 127)
Looks like you copy+pasted the plugin code? That happens often when you see the ^M issue.
Run the following and try it again. In order to type the ^M character, hold CTRL and pres v then m:
sed 's/^M//g' check_blackberry5 > check_blackberry5.new
mv check_blackberry5.new check_blackberry5
Run the following and try it again. In order to type the ^M character, hold CTRL and pres v then m:
sed 's/^M//g' check_blackberry5 > check_blackberry5.new
mv check_blackberry5.new check_blackberry5
Former Nagios employee
Re: check_blackberry5 and error (Return code of 127)
Response
[nagios@Mis1SmMo02 libexec]$ sed 's/^M//g' check_blackberry5 > check_blackberry5.new
[nagios@Mis1SmMo02 libexec]$ mv check_blackberry5.new check_blackberry5
mv: try to overwrite `check_blackberry5', overriding mode 0755 (rwxr-xr-x)? y
[nagios@Mis1SmMo02 libexec]$
What would you like me to do next.
[nagios@Mis1SmMo02 libexec]$ sed 's/^M//g' check_blackberry5 > check_blackberry5.new
[nagios@Mis1SmMo02 libexec]$ mv check_blackberry5.new check_blackberry5
mv: try to overwrite `check_blackberry5', overriding mode 0755 (rwxr-xr-x)? y
[nagios@Mis1SmMo02 libexec]$
What would you like me to do next.
Re: check_blackberry5 and error (Return code of 127)
You need to run the check itself:
tmcdonald wrote:Code: Select all
./check_blackberry5 -H $HOSTADDRESS$ -C ddgpublic -Q pending -w 10 -c 20
Former Nagios employee
Re: check_blackberry5 and error (Return code of 127)
This is what I get...
[root@Mis1SmMo02 ~]# su nagios
[nagios@Mis1SmMo02 root]$ cd /usr/local/nagios/libexec
[nagios@Mis1SmMo02 libexec]$ ./check_blackberry5 -H 172.16.***.*** -C ddgpublic -Q pending -w 10 -c 20
bash: ./check_blackberry5: Permission denied
[nagios@Mis1SmMo02 libexec]$
[root@Mis1SmMo02 ~]# su nagios
[nagios@Mis1SmMo02 root]$ cd /usr/local/nagios/libexec
[nagios@Mis1SmMo02 libexec]$ ./check_blackberry5 -H 172.16.***.*** -C ddgpublic -Q pending -w 10 -c 20
bash: ./check_blackberry5: Permission denied
[nagios@Mis1SmMo02 libexec]$
Re: check_blackberry5 and error (Return code of 127)
You will of course need to run it as root or chmod/chown it so you can run it as nagios.heritages wrote: [nagios@Mis1SmMo02 libexec]$ ./check_blackberry5 -H 172.16.***.*** -C ddgpublic -Q pending -w 10 -c 20
bash: ./check_blackberry5: Permission denied
Former Nagios employee