Page 1 of 2

Return code of 255 is out of bounds

Posted: Fri Aug 24, 2018 5:44 am
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.

Re: Return code of 255 is out of bounds

Posted: Fri Aug 24, 2018 10:48 am
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.

Re: Return code of 255 is out of bounds

Posted: Mon Aug 27, 2018 4:24 am
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 :)

Re: Return code of 255 is out of bounds

Posted: Mon Aug 27, 2018 1:03 pm
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?

Re: Return code of 255 is out of bounds

Posted: Tue Aug 28, 2018 2:39 am
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.

Re: Return code of 255 is out of bounds

Posted: Tue Aug 28, 2018 11:49 am
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%

Re: Return code of 255 is out of bounds

Posted: Thu Aug 30, 2018 2:20 am
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 ~]$

Re: Return code of 255 is out of bounds

Posted: Thu Aug 30, 2018 10:34 am
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%

Re: Return code of 255 is out of bounds

Posted: Fri Aug 31, 2018 12:37 am
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.

Re: Return code of 255 is out of bounds

Posted: Fri Aug 31, 2018 8:51 am
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.