nsclient error"UNKNOWN: No handler for that command"

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

nsclient error"UNKNOWN: No handler for that command"

Post by inas.labib »

Hi Team,

We are trying to execute a batch script in Windows machine from Nagios to get the results from the script executed.

We are getting UNKNOWN: No handler for that command error form Nagios. Port 5666 is enabled between two machines


/check_nrpe -H 10.10.98.24 -t 120 -p 5666 -c check_mon
UNKNOWN: No handler for that command

Attached nsc.ini file for your reference.


Nsclient log error:
2018-07-18 14:21:00: debug:CACHENSClient++.cpp:557: Attempting to start NSCLient++ - 0.3.9.328 2011-08-16
2018-07-18 14:21:00: message:CACHEmodules\FileLogger\FileLogger.cpp:87: Log path is: C:\Program Files\NSClient++\\nsclient.log
2018-07-18 14:21:00: error:include\Socket.h:691: bind failed: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2018-07-18 14:21:00: error:include\Socket.h:691: bind failed: 10048: Only one usage of each socket address (protocol/network address/port) is normally permitted.
2018-07-18 14:21:00: error:include\Socket.h:722: Socket did not start properly, we will now do nothing...
2018-07-18 14:21:00: error:include\Socket.h:722: Socket did not start properly, we will now do nothing...
You do not have the required permissions to view the files attached to this post.
swolf

Re: nsclient error"UNKNOWN: No handler for that command"

Post by swolf »

Hello,

Based on other threads, it looks to me as though NSClient check scripts cannot use an absolute path (though I may be wrong on this).

Are you able to use your other checks (check_sms, check_gfs, check_freeway)? If not, try the following:

Copy D:\TPN_Monitor_Scripts\TPN_Mon.bat to C:\Program Files\NSClient++\scripts\TPN_Mon.bat
Remove the following line from nsc.ini:

Code: Select all

check_mon="D:\TPN_Monitor_Scripts\TPN_Mon.bat"
Add the following line to nsc.ini in the same place:

Code: Select all

check_mon=scripts\TPN_Mon.bat
then, restart NSClient and let us know if your issues persist.
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: nsclient error"UNKNOWN: No handler for that command"

Post by inas.labib »

Thanks for your suggestion. It actually helped in setting up and executing one of the batch script.

/usr/local/nagios/libexec$ ./check_nrpe -H XX.XX.XX.XXX -t 30 -c check_mon1
mysql: [Warning] Using a password on the command line interface can be insecure.
"OK: No Error Found.

IS there any way can we parse the above warning.

============================================================================
Also at the same time the other scripts in the same path were unable to execute which given the nrpe socket timeout error.

/usr/local/nagios/libexec$ ./check_nrpe -H x.xx.xx.xx -t 30 -c check_sms
CHECK_NRPE: Socket timeout after 30 seconds
=============================================================================
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nsclient error"UNKNOWN: No handler for that command"

Post by scottwilkerson »

inas.labib wrote:/usr/local/nagios/libexec$ ./check_nrpe -H XX.XX.XX.XXX -t 30 -c check_mon1
mysql: [Warning] Using a password on the command line interface can be insecure.
"OK: No Error Found.

IS there any way can we parse the above warning.
You would have to modify the batch file to parse that out
inas.labib wrote:Also at the same time the other scripts in the same path were unable to execute which given the nrpe socket timeout error.

/usr/local/nagios/libexec$ ./check_nrpe -H x.xx.xx.xx -t 30 -c check_sms
CHECK_NRPE: Socket timeout after 30 seconds
if you execute the script that check_sms calls on the remote machine, how long does it take to execute?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
inas.labib
Posts: 170
Joined: Tue Sep 11, 2012 3:48 am

Re: nsclient error"UNKNOWN: No handler for that command"

Post by inas.labib »

Hi,

The batch script which executed on Windows machines for check_sms takes less than 5 seconds.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nsclient error"UNKNOWN: No handler for that command"

Post by scottwilkerson »

Does D:\TPN_Monitor_Scripts\TPN_SMS.bat require any elevated permissions?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked