Page 1 of 3
NRPE CheckTaskSched No Handler Error
Posted: Mon Oct 28, 2013 9:01 am
by Theb2b
Attempting to have nagios mointor Windows 2008 R2 task to insure the task runs successfully but I'm getting the following error;
Running NSClient version 0.3.9
No handler for command 'CheckTaskSched'.
Putting NSClient++ in test mode I get;
NSClient++.cpp(1144) Injecting: CheckTaskSched: filter=exit_code ne 0, syntax=%test.job%: %0%, warn=
CheckTaskSched.cpp(171) Unknown exception in: wrapHandlerCommand(...)
NSClient++.cpp(1195) No handler for command: 'CheckTaskSched'
NSCHelper.cpp(238) No handler for command 'CheckTaskSched'
The test command I am sending from Nagios is as follows;
./check_nrpe -H srvxatest -p 5666 -c CheckTaskSched -a "filter=exit_code ne 0" "syntax=%test.job%: %0%" warn=>0
And from my test servers NSC config file under [External Alias] I have;
alias_sched_all=CheckTaskSched "filter=exit_code ne 0" "syntax=%title%: %exit_code%" warn=>0
;alias_sched_long=CheckTaskSched "filter=status = 'running' AND most_recent_run_time < -$ARG1$" "syntax=%title% (%most_recent_run_time%)" warn=>0
;alias_sched_task=CheckTaskSched "filter=title eq '$ARG1$' AND exit_code ne 0" "syntax=%title% (%most_recent_run_time%)" warn=>0
I have tried various combonations of uncommiting and commiting out lines above with the same results, any thoughts or suggestion?
Re: NRPE CheckTaskSched No Handler Error
Posted: Mon Oct 28, 2013 9:12 am
by slansing
And from my test servers NSC config file under [External Alias] I have;
You need to put this under External scripts, Also, since you hard coded ""filter=exit_code ne 0" "syntax=%title%: %exit_code%" warn=>0" you don't need to pass it as arguments from nagios. Just call CheckTaskSched when you have placed it in external scripts and restarted NSclient++.
Re: NRPE CheckTaskSched No Handler Error
Posted: Mon Oct 28, 2013 10:08 am
by mickem
Sounds like your missing the modules under the [modules] section.
Code: Select all
[modules]
; ...
CheckTaskSched
;...
(or some such)
FYI: NSClient++ 0.3.9 is pretty old and an upgrade might be in order.
In the up-coming 0.4.2 version the task scheduler checks is greatly enhanced.
// Michael Medin
Re: NRPE CheckTaskSched No Handler Error
Posted: Mon Oct 28, 2013 11:11 am
by Theb2b
Tried both suggestions, still not working. The test commands I am running are straight from the "book" modified to fit my network, IE IP address changed. If I remove the "warn=>0" from the end of the command I get back OK: All scheduled tasks are good" despite the fact the task I'm attempting to mointor is setup to fail, run a nonexsitent batch file.
As an example the following command is supposed to return list of all running tasks
./check_nrpe -H srvxatest -c CheckTaskSched -a "filter=status ne 'disabled'" "syntax='%title%'"
It returns "OK: All scheduled tasks are good" results.
Slansing I tried your suggestion, no effect.
Below is my [modules] section;
[modules]
NRPEListener.dll
NSClientListener.dll
NSCAAgent.dll
CheckWMI.dll
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
CheckEventLog.dll
CheckHelpers.dll
;# NSCLIENT++ MODULES
;# A list with DLLs to load at startup.
; You will need to enable some of these for NSClient++ to work.
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
; * *
; * N O T I C E ! ! ! - Y O U H A V E T O E D I T T H I S *
; * *
; ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
FileLogger.dll
CheckSystem.dll
CheckDisk.dll
NSClientListener.dll
NRPEListener.dll
SysTray.dll
CheckEventLog.dll
CheckHelpers.dll
CheckWMI.dll
CheckNSCP.dll
CheckTaskSched.dll
Slansing you make an interesting comment, I was attempting to use .0.4.1 but run into problems trying to get checkMEM working, suggested change back to .0.3.9 and it fixed my problem. I'll switch this server back and see if I have any better luck with CheckTaskSched.
Re: NRPE CheckTaskSched No Handler Error
Posted: Mon Oct 28, 2013 12:58 pm
by mickem
Not sure if this is relevant but figured I'd mention it.
The old version of CHeckTaskSched (in 0.3.9) only monitors "old tasks" (using the "old") API.
In essence with Windows 2003 (?) Microsoft introduced a new API (which for instance supports folders and such) this is not handled by version 0.3.9.
It is handled in 0.4.0 and on wards in the form of "CheckTaskSched2" and in 0.4.2 it is merged back into CheckTaskSched (ie. both APIs are contained in the same module). But 0.4.2 is only out in beta (RC expected this week).
// Michael Medin
Re: NRPE CheckTaskSched No Handler Error
Posted: Mon Oct 28, 2013 3:54 pm
by slansing
Theb2b,
Sounds good, it would also be helpful to enable logging on that installation so a bit more detail can be seen after you try to check against the windows box.
Under the [Log] section of nsc/nsclient.ini make sure these are uncommented:
"Make sure to save the file, and restart the nsclient service."
This should allow a nsclient.log file to be created in the installation directory, once you make a check against the server, pop this log open and you can observe when the connection came in and what happened.
Re: NRPE CheckTaskSched No Handler Error
Posted: Tue Oct 29, 2013 9:32 am
by Theb2b
Bit of success, I have gotten past the No handler for command 'CheckTaskSched' error. It would appear that using the syntax as shown in the example is a bit dated, necessary to drop warn=> to MaxWarn=. I have gotten 0.4.1.102 installed and I can send test commands to the server and get back responses to both checkMEM and CheckTaskSched.
I have run into another problem, checkMEM to nagios reports "No output returned from the plugin" but when I submit test command from the nagios server from the shell I get back results. With CheckTaskSched test commands all return the same result, see below
Without MaxWarn=
OK: All scheduled tasks are good
If I include MaxWarn=0
eventlog: 0 > warning | 'eventlog'=0;0;0
My test command shown below
./check_nrpe -H srvxatest -c CheckTaskSched -p 5666 -a "filter=title='test.job' AND exit_code ne 1" "syntax=%title%: Last result=%exit_code% at %most_recent_run_time%" MaxWarn=0
If I change the MaxWarn to MaxWarn=1 output is;
OK: All Scheduled tasks are good, | 'eventlog'=0;1;0
Shouldn’t the output include the job name?
Last question, thinking I should close this post as my original problem has been resolved?
Re: NRPE CheckTaskSched No Handler Error
Posted: Tue Oct 29, 2013 1:53 pm
by lmiltchev
Shouldn’t the output include the job name?
What happens if you have a different than an "OK" state ("Warning" or "Critical")? Do you see the job name then?
Re: NRPE CheckTaskSched No Handler Error
Posted: Thu Oct 31, 2013 8:33 am
by Theb2b
Following are the results of using differnet MaxWarn levels
MaxWarn=0
eventlog: 0 > warning|'eventlog'=0;0;0
MaxWarn=1
OK: All scheduled tasks are good.|'eventlog'=0;1;0
MaxWarn=2
OK: All scheduled tasks are good.|'eventlog'=0;2;0
Please recall the task is setup to fail.
Any suggestions on why the following test command is working from the shell but Nagios reports "No output returned from the plugin"?
check_nrpe -H srvxatest -p 5666 -c checkMEM -a MaxWarn=80% MaxCrit=90% ShowAll type=physical
OK: physical memory: 1.56G|'physical memory %'=12%;80;90 'physical memory'=1.55699G;9.59999;10.8;0;12
Re: NRPE CheckTaskSched No Handler Error
Posted: Thu Oct 31, 2013 4:45 pm
by lmiltchev
Any suggestions on why the following test command is working from the shell but Nagios reports "No output returned from the plugin"?
Can you show us the service config (CCM->Services-><your service>->View Text Config)?