UNKNOWN: No handler for that command NSClient++


#1

Hi,

Im getting the following error when running this command:

 /usr/local/nagios/libexec/check_nrpe -n -H 10.0.0.14 -c check_cpu
UNKNOWN: No handler for that command

The log shows:

2010-03-24 12:23:29: message:NSClient++.cpp:1124: No handler for command: 'check_cpu' 2010-03-24 12:23:29: message:include\NSCHelper.cpp:238: No handler for command 'check_cpu'.
However I know nrpe is working:

/usr/local/nagios/libexec/check_nrpe -n -H 10.0.0.14
I (0.3.7.493 2009-10-12) seem to be doing fine...

Can anyone help my nsc.ini file is below:

[modules]
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
CheckWMI.dll
;CheckExternalScripts.dll
;NSCAAgent.dll
;LUAScript.dll
;RemoteConfiguration.dll
;NRPEClient.dll
;CheckTaskSched.dll

[Settings]
;obfuscated_password=Jw0KAUUdXlAAUwASDAAB
;password=secret-password
allowed_hosts=127.0.0.1/32,10.0.4.1/32
use_file=1
;shared_session=0

[log]
;debug=1
;file=nsclient.log
;date_mask=%Y-%m-%d %H:%M:%S
;root_folder=exe

[NSClient]
;allowed_hosts=
;port=12489
;bind_to_address=
;socket_timeout=30

[NRPE]
port=5666
command_timeout=60
allow_arguments=1
;allow_nasty_meta_chars=0
use_ssl=0
; bind_to_address=
allowed_hosts=127.0.0.1/32,10.0.4.1/32
script_dir=scripts\
;socket_timeout=30

[Check System]
;CPUBufferSize=1h
;CheckResolution=10
;check_all_services[SERVICE_BOOT_START]=ignored
;check_all_services[SERVICE_SYSTEM_START]=ignored
;check_all_services[SERVICE_AUTO_START]=started
;check_all_services[SERVICE_DEMAND_START]=ignored
;check_all_services[SERVICE_DISABLED]=stopped

[External Script]
;command_timeout=60
allow_arguments=0
;allow_nasty_meta_chars=0
;script_dir=c:\my\script\dir

[External Scripts]
check_es_long=scripts\long.bat
check_es_ok=scripts\ok.bat
check_es_nok=scripts\nok.bat
check_vbs_sample=cscript.exe //T:30 //NoLogo scripts\check_vb.vbs
check_powershell_warn=cmd /c echo scripts\powershell.ps1 | powershell.exe -command -

[External Alias]
alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s
alias_cpu_ex=checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s
alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED
alias_service=checkServiceState CheckAll
alias_process=checkProcState $ARG1$=started
alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=physical
alias_up=checkUpTime MinWarn=1d MinWarn=1h
alias_file_age=checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%"
alias_file_size=checkFile2 filter=out "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%"
alias_file_size_in_dir=checkFile2 filter=out pattern=*.txt "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%"
alias_event_log=CheckEventLog file=application file=system filter=new filter=out MaxWarn=1 MaxCrit=1 filter-generated=>2d filter-severity==success filter-severity==informational truncate=1023 unique descriptions  "syntax=%severity%: %source%: %message% (%count%)"
alias_event_log2=CheckEventLog file=application file=system filter=new filter=in MaxWarn=1 MaxCrit=1 filter+generated=<2d "filter+eventSource==Service Control Manager" filter+severity==error truncate=1023 unique descriptions  "syntax=%severity%: %source%: %message% (%count%)"
check_ok=CheckOK Everything is fine!

; [includes]

; myotherfile.ini
; real.ini


[NSCA Agent]
;interval=5
;encryption_method=14
;password=
;bind_to_address=
;hostname=
;nsca_host=192.168.0.1
;nsca_port=5667

[NSCA Commands]
;my_cpu_check=chFeckCPU warn=80 crit=90 time=20m time=10s time=4
;my_mem_check=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=page
;my_svc_check=checkServiceState CheckAll exclude=wampmysqld exclude=MpfService
;host_check=check_ok

[NRPE Client Handlers]
;check_other=-H 192.168.0.1 -p 5666 -c remote_command -a arguments
command[check_cpu]=checkCPU warn=80 crit=90 5 10 15

;# LUA SCRIPT SECTION
;  A list of all Lua scripts to load.
;[LUA Scripts]
;scripts\test.lua

#2

ehrm… you are using NRPE to go to another box which in turn sends an nsclient++ request to another server?

or are you trying to use nrpe on a windows client running nsclient++ ?


#3

Hi,

I have a linux nagios server, which is trying to monitor a windows xp client, the nsc.ini file was from the windows client. Hope that makes sense.


#4

you need to use check_nt not nrpe on the nagios server…

Luca


#5

thanks, I have check_nt working, but I thought the nsclient allowed me to also check throug nrpe? I would prefer to use nrpe as I have graphing that works on the name of a service, and as I cant have a service named twice the graphing wont work for the Windows service.


#6

i dont’ know if it’s possible… i never used it on windows.


#7

check_nrpe work fine in windows.

/usr/local/nagios/libexec/check_nrpe -H 10.99.99.99 -c checkcpu
ERROR: Missing argument exception.

This is the format and then you have to define the argument or defince an alias… I copied this from wiki.


#8

I though it did, but I have defined the commands in my config file (shown in the first post) but all i get is unknown handler which I assume means it cant resolve the command.


#9

That part of the ini is for something else I think. You need to do it like in my example or define a command in the alias section,


#10

I have updated my config file too contain:

[External Alias] alias_cpu=checkCPU warn=80 crit=90 time=5m time=1m time=30s alias_cpu_ex=checkCPU warn=$ARG1$ crit=$ARG2$ time=5m time=1m time=30s alias_disk=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED alias_service=checkServiceState CheckAll alias_process=checkProcState $ARG1$=started alias_mem=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=physical alias_up=checkUpTime MinWarn=1d MinWarn=1h alias_file_age=checkFile2 filter=out "file=$ARG1$" filter-written=>1d MaxWarn=1 MaxCrit=1 "syntax=%filename% %write%" alias_file_size=checkFile2 filter=out "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" alias_file_size_in_dir=checkFile2 filter=out pattern=*.txt "file=$ARG1$" filter-size=>$ARG2$ MaxWarn=1 MaxCrit=1 "syntax=%filename% %size%" alias_event_log=CheckEventLog file=application file=system filter=new filter=out MaxWarn=1 MaxCrit=1 filter-generated=>2d filter-severity==success filter-severity==informational truncate=1023 unique descriptions "syntax=%severity%: %source%: %message% (%count%)" alias_event_log2=CheckEventLog file=application file=system filter=new filter=in MaxWarn=1 MaxCrit=1 filter+generated=<2d "filter+eventSource==Service Control Manager" filter+severity==error truncate=1023 unique descriptions "syntax=%severity%: %source%: %message% (%count%)" check_ok=CheckOK Everything is fine! command[check_cpu]=checkCPU warn=80 crit=90 5 10 15 command[check_cdrive]=CheckDriveSize MinWarn=10% MinCrit=5% CheckAll FilterType=FIXED command[check_services]=checkServiceState CheckAll command[check_procs]=checkProcState $ARG1$=started command[check_mem]=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=physical command[check_uptime]=checkUpTime MinWarn=1d MinWarn=1h command[check_ok]=CheckOK Everything is fine!

Restarted the service, but I still get the same error:

/usr/local/nagios/libexec/check_nrpe -n -H 10.0.0.14 -c check_cpu UNKNOWN: No handler for that command


#11

because thats not the syntax. check in the top of the templete


#12

I have tried that too:

./check_nrpe -n -H 10.0.0.14 -c alias_cpu UNKNOWN: No handler for that command


#13

/usr/local/nagios/libexec/check_nrpe -H 99.99.99.99 -c alias_cpu OK CPU Load ok.|'5m'=21%;80;90; '1m'=24%;80;90; '30s'=22%;80;90;


#14

I can see yours works but mine doesn’t and I don’t know why, i have tried it on two different windows servers, so it must be something in my config can you see any obvious mistakes?


#15

perhaps CheckExternalScripts.dll has to be enabled to run alias, dont know. I normllay run scripts but not alias.


#16

that was my problem thanks all is working now!