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

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

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

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post by slansing »

Can you show the command you are using to run the plugin?
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

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

Post 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$
}
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

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

Post 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."
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

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

Post 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.
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

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

Post 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
yancy
Posts: 523
Joined: Thu Oct 06, 2011 10:12 am

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

Post by yancy »

w14219,

Is SNMP enabled on the MikroTik?


regards,

-Yancy
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

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

Post 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)
w14219
Posts: 33
Joined: Wed Feb 15, 2012 2:04 am

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

Post 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
Locked