check_blackberry5 and error (Return code of 127)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
heritages
Posts: 58
Joined: Thu Jan 16, 2014 11:55 am

Re: check_blackberry5 and error (Return code of 127)

Post by heritages »

[root@Mis1SmMo02 ~]# cd /usr/local/nagios/libexec
[root@Mis1SmMo02 libexec]# ./check_blackberry5 -H 172.16.***.*** -C ddgpublic -Q pending -w 10 -c 20
-bash: ./check_blackberry5: Permission denied
[root@Mis1SmMo02 libexec]#

This is what happens when I run it as root.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_blackberry5 and error (Return code of 127)

Post by tmcdonald »

Please run

ls -l /usr/local/nagios/libexec/check_blackberry5

and share the output
Former Nagios employee
heritages
Posts: 58
Joined: Thu Jan 16, 2014 11:55 am

Re: check_blackberry5 and error (Return code of 127)

Post by heritages »

when run as root....

[root@Mis1SmMo02 libexec]# ./check_blackberry5 -H 172.16.***.*** -C ddgpublic -Q pending -w 10 -c 20
-bash: ./check_blackberry5: Permission denied
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_blackberry5 and error (Return code of 127)

Post by tmcdonald »

That's not the command I asked you to run. Please run:

ls -l /usr/local/nagios/libexec/check_blackberry5
Former Nagios employee
heritages
Posts: 58
Joined: Thu Jan 16, 2014 11:55 am

Re: check_blackberry5 and error (Return code of 127)

Post by heritages »

[root@Mis1SmMo02 ~]# ls -l /usr/local/nagios/libexec/check_blackberry5
-rw-r--r-- 1 nagios users 4465 Jan 29 14:54 /usr/local/nagios/libexec/check_blackberry5
[root@Mis1SmMo02 ~]#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_blackberry5 and error (Return code of 127)

Post by tmcdonald »

There's your problem. Nobody has permission to execute the plugin.

chmod 755 /usr/local/nagios/libexec/check_blackberry5

and it should work
Former Nagios employee
heritages
Posts: 58
Joined: Thu Jan 16, 2014 11:55 am

Re: check_blackberry5 and error (Return code of 127)

Post by heritages »

[root@Mis1SmMo02 libexec]# ls -l /usr/local/nagios/libexec/check_blackberry5
-rwxr-xr-x 1 nagios users 4465 Jan 29 14:54 /usr/local/nagios/libexec/check_blackberry5
[root@Mis1SmMo02 libexec]# ./check_blackberry5 -H 172.16.***.*** -C ddgpublic -Q pending -w 10 -c 20
-bash: ./check_blackberry5: /bin/bash^M: bad interpreter: No such file or directory
[root@Mis1SmMo02 libexec]#
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_blackberry5 and error (Return code of 127)

Post by tmcdonald »

Same issue we tackled back on the first page:

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
heritages
Posts: 58
Joined: Thu Jan 16, 2014 11:55 am

Re: check_blackberry5 and error (Return code of 127)

Post by heritages »

Ok, getting closer....

[root@Mis1SmMo02 libexec]# ./check_blackberry5 -H 172.16.***.*** -C ddgpublic -Q pending -w 10 -c 20
Timeout: No Response from 172.16.124.149
./check_blackberry5: line 82: [: : integer expression expected
./check_blackberry5: line 86: [: : integer expression expected
OK: Pending Mails: |Pending=;10;20;;

Not sure that the below two lines are correct.
./check_blackberry5: line 82: [: : integer expression expected
./check_blackberry5: line 86: [: : integer expression expected
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: check_blackberry5 and error (Return code of 127)

Post by tmcdonald »

Means that on those lines there should be a numeric variable but the variable is not being set. The variable is set by running snmpwalk and parsing the output:

Code: Select all

PENDINGMSGOID=`$SNMPWALK_BIN -v 2c -c $community -On $hostname $PENDINGMSG | awk '{print $4}' | tr -d '\n'`;
SNMPWALK_BIN is set to be /usr/bin/snmpwalk, so let's look at the following:

Code: Select all

which snmpwalk
ls -l /usr/bin/snmpwalk
/usr/bin/snmpwalk -v 2c -c <your community string here> -On <hostname here> '1.3.6.1.4.1.3530.6.7.10.40.10.1.16'
/usr/bin/snmpwalk -v 2c -c <your community string here> -On <hostname here> '1.3.6.1.4.1.3530.6.7.10.40.10.1.16' | awk '{print $4}'
/usr/bin/snmpwalk -v 2c -c <your community string here> -On <hostname here> '1.3.6.1.4.1.3530.6.7.10.40.10.1.16' | awk '{print $4}' | tr -d '\n'
Of course make the replacements in <brackets> as necessary.
Former Nagios employee
Locked