Return code of 255 is out of bounds

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Return code of 255 is out of bounds

Post by RIDS_I2MP »

Hello Team,

I am monitoring a Windows server in Nagios. All the services are being monitored properly but, I am facing issue with only one service, i.e., "Physical Memory Utilization". I was getting error "Socket timeout after 30 seconds" which I could resolve by creating a copy of check_nrpe command and changing the "-t" value to 300 which was 30 by default ($USER1$/check_nrpe -H $HOSTADDRESS$ -t 300 -c $ARG1$ $ARG2$).

Now I am getting another error as "(Return code of 255 is out of bounds)". I googled about it and found that it usually comes if NSC++ is not running. I reinstalled the NSC++ client and started the service, but I am still getting the same error.

Kindly, please help me with this issue.
Thanks & Regards,
I2MP Team.
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Return code of 255 is out of bounds

Post by npolovenko »

Hello, @RIDS_I2MP. Please upload the nsclient.ini file from the Windows server as well as the nsclient.log file. Also, please show the command you're using to check the Memory Utilization.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Return code of 255 is out of bounds

Post by RIDS_I2MP »

Hello,

I am attaching the nsclient.ini file from the Windows server as well as the nsclient.log file.
Also, attaching the details related to command for physical memory utilization.

Thank you for your reply :)
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Return code of 255 is out of bounds

Post by ssax »

Does it give the same output when you run it from the command line?
- Note: Make sure to change X.X.X.X to the IP address of the host

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H X.X.X.X -t 300 -c CheckMEM -a ShowAll type=physical MaxWarn=90% MaxCrit=95%
Additionally, what version of NSClient++ do you have running?
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Return code of 255 is out of bounds

Post by RIDS_I2MP »

Hello,

I have ran the below command by opening command prompt in Windows server.
/usr/local/nagios/libexec/check_nrpe -H X.X.X.X -t 300 -c CheckMEM -a ShowAll type=physical MaxWarn=90% MaxCrit=95%

It returned an error saying "The system cannot find the path specified". I am attchiing the output here.

Also, I tried checking NSClient++ version in properties, attaching the output for the same.
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Return code of 255 is out of bounds

Post by ssax »

Sorry, you need to run this command from the XI server:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H X.X.X.X -t 300 -c CheckMEM -a ShowAll type=physical MaxWarn=90% MaxCrit=95%
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Return code of 255 is out of bounds

Post by RIDS_I2MP »

Hello,

I ran the below command in Nagios XI server:

Nagios server : 10.144.223.155
Monitoring server: 10.151.1.90

[nagios@eu1papu002 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.144.223.155 -t 300 -c CheckMEM -a ShowAll type=physical MaxWarn=90% MaxCrit=95%
CHECK_NRPE: Error - Could not complete SSL handshake.
[nagios@eu1papu002 ~]$

[nagios@eu1papu002 ~]$ /usr/local/nagios/libexec/check_nrpe -H 10.151.1.90 -t 300 -c CheckMEM -a ShowAll type=physical MaxWarn=90% MaxCrit=95%
connect to address 10.151.1.90 port 5666: Connection timed out
connect to host 10.151.1.90 port 5666: Connection timed out[nagios@eu1papu002 ~]$ ^C
[nagios@eu1papu002 ~]$
Thanks & Regards,
I2MP Team.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Return code of 255 is out of bounds

Post by lmiltchev »

Looking at the config name (NSC.ini), I would guess that you are using a very old version of NSClient++, probably 0.3.9? Let't try to find out the version number, so that we could try recreating the issue in-house.

Run the following command from the command line on the Nagios XI server, and show the output (obfuscate sensitive info):

Code: Select all

/usr/local/nagios/libexec/check_nt -H <windows server ip> -p 12489 -s <password> -v CLIENTVERSION
Also, can you try adding "-2" to your command to see if this is going to fix the issue?

Code: Select all

/usr/local/nagios/libexec/check_nrpe -2 -H 10.144.223.155 -t 300 -c CheckMEM -a ShowAll type=physical MaxWarn=90% MaxCrit=95%
Be sure to check out our Knowledgebase for helpful articles and solutions!
RIDS_I2MP
Posts: 751
Joined: Thu Mar 13, 2014 9:25 am

Re: Return code of 255 is out of bounds

Post by RIDS_I2MP »

Hello,

I have ran the commands in XI server and attached the output here.

Just wanted to add one more thing, there are other services like CPU utilization, C drive disk pace utilization, etc. are also being monitored on that server, but all of them are running fine. I am just facing issue with physical memory utilization. So I do not think that there would be any version problem here.
You do not have the required permissions to view the files attached to this post.
Thanks & Regards,
I2MP Team.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Return code of 255 is out of bounds

Post by lmiltchev »

You must have special characters in the password as bash complained. Try wrapping the password in single quotes, rerun the command and show the output:

Code: Select all

/usr/local/nagios/libexec/check_nt -H <windows server ip> -p 12489 -s '<password>' -v CLIENTVERSION
The "-2" flag didn't work as this option was not available in the old NRPE (v. 2.15) - I didn't realize you were using that version.
Just wanted to add one more thing, there are other services like CPU utilization, C drive disk pace utilization, etc. are also being monitored on that server, but all of them are running fine. I am just facing issue with physical memory utilization. So I do not think that there would be any version problem here.
Are the "working" services use check_nrpe or check_nt?

Change the following line in the NSC.ini under the [NRPE] section from this:

Code: Select all

;allow_nasty_meta_chars=0
to this:

Code: Select all

allow_nasty_meta_chars=1
Next, change the following lines under the [External Script] section from this:

Code: Select all

;allow_arguments=0
;allow_nasty_meta_chars=0
to this:

Code: Select all

allow_arguments=1
allow_nasty_meta_chars=1
and restart nsclient++ service.

Next run the commands below, and show the output:

Code: Select all

/usr/local/nagios/libexec/check_nrpe -H 10.144.223.155
/usr/local/nagios/libexec/check_nrpe -H 10.144.223.155 -c alias_cpu
/usr/local/nagios/libexec/check_nrpe -H 10.144.223.155 -c alias_mem
/usr/local/nagios/libexec/check_nrpe -H 10.144.223.155 -c CheckMEM -a MaxWarn=90% MaxCrit=95% ShowAll type=physical
If these commands fail, upload the nsclient.log on the forum.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked