Page 1 of 1

Return code of 127 is out of bounds - plugin may be missing

Posted: Thu Aug 23, 2012 3:41 pm
by w14219
OS: Ubuntu
Nagios Core: 3.3.1

Issue: When using a plugin, check_mikrotik_mem, I am getting the following error.
(Return code of 127 is out of bounds - plugin may be missing)

I added the plugin to the following directory:
/usr/local/nagios/libexec

Permissions:
-rwxr-xr-x 1 nagios nagios

Question:
What is causing the Return code of 127 when trying to use the plugin?

Thank you

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Thu Aug 23, 2012 4:03 pm
by slansing
Can you show the command you are using to run the plugin?

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Thu Aug 23, 2012 4:12 pm
by w14219
Here are the files and needed modifications I made:

Added following lines into the commands.cfg file
# 'check_mikrotik_mem' command definition
define command{
command_name check_mikrotik_mem
command_line $USER2$/check_mikrotik_mem -H $HOSTADDRESS$ $ARG1$
}

Added following lines into the resource.cfg file
# Store some usernames and passwords (hidden from the CGIs)
$USER3$=monitoring
$USER4$=SecretPasswd
$USER5$=AnotherSecretPasswd


Added following lines into the nagios.cfg file
cfg_file=/usr/local/nagios/etc/objects/mikrotik.cfg


Defined a new service for the device, mikrotik.cgf

define host{
use generic-switch ; Inherit default values from a template
host_name TestUnit1 ; The name we're giving to this printer
alias Mikrotik Router Board ; A longer name associated with the printer
address 10.2.1.9 ; IP address of the printer
hostgroups aps ; Host groups this printer is associated with
}

define hostgroup{
hostgroup_name aps ; The name of the hostgroup
alias Mikrotik Routers ; Long name of the group
}

define service{
use generic-service ; Inherit values from a template
hostgroup_name aps ; Apply to all our APs
service_description Memory usage.
check_command check_mikrotik_mem!-P 3 -L authPriv -U $USER3$ -a SHA -A $USER4$ -x DES -X $USER5$
}

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Thu Aug 23, 2012 4:32 pm
by slansing
Can you post the command you run from the terminal, with the information you use? You can hide the sensitive information "passwords etc."

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Thu Aug 23, 2012 6:20 pm
by w14219
I do not have a command from the terminal to test with. I am leveraging a plugin for Mikrotik routers.

I can try command line later this evening.

Do you see anything wrong with the commands I am using now?

Thanks for your help.

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Fri Aug 24, 2012 2:19 am
by w14219
Here is the information I am getting from the command line:

w14219@Nagios:/usr/local/nagios/libexec$ ./check_mikrotik_mem -H 10.2.1.9 -P 3 -L authPriv -U SecurityName -a SHA -A 123456789 -x DES -X 123456789

./check_mikrotik_mem: line 188: No Such Instance currently exists at this OID*100/No Such Instance currently exists at this OID: syntax error in expression (error token is "Such Instance currently exists at this OID*100/No Such Instance currently exists at this OID")
./check_mikrotik_mem: line 191: No Such Instance currently exists at this OID/1000: syntax error in expression (error token is "Such Instance currently exists at this OID/1000")
./check_mikrotik_mem: line 192: [: -gt: unary operator expected
./check_mikrotik_mem: line 194: [: -gt: unary operator expected


w14219@Nagios:/usr/local/nagios/libexec$ snmpget --version
NET-SNMP version: 5.6.2

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Fri Aug 24, 2012 10:32 am
by yancy
w14219,

Is SNMP enabled on the MikroTik?


regards,

-Yancy

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Sat Aug 25, 2012 9:37 am
by w14219
I am now able to connect to the device with snmpget commands, Net-Snmp was not installed....

However, I am still getting in the dashboard: (Return code of 127 is out of bounds - plugin may be missing)

Re: Return code of 127 is out of bounds - plugin may be miss

Posted: Sat Aug 25, 2012 10:16 am
by w14219
Found the issue:

I found that the commands.cfg path for the plugin was pointing to the wrong path.
Once I corrected the path to the plugin directory, I was able to resolve the issue.

Thank you for your help.

Mike