Anybody good with NSClient and check_nrpe?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Anybody good with NSClient and check_nrpe?

Post by FTL »

Hi,

Im struggling with the CheckTaskSched module of NSClient.

I want my Nagios box to be able to monitor 8 diffenet individual Scheduled Tasks on a Windows 2008 server.

I use NSClient already successfully for monitoring disk space, cpu usage etc on various servers but cant get Sched Tasks working.

Im running 0.39

Im using this command from a Nagios terminal for testing:

check_nrpe -H 1.2.3.4 -p 5666 -c CheckTaskSched -a "filter=title ='Test' status='disabled'" "syntax=%title% %status%"

And its response is:

OK: All Scheduled Tasks are good.

But i have my Test job disabled!!

Where am i going wrong please?

Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Anybody good with NSClient and check_nrpe?

Post by slansing »

Try searching for 'enabled' instead of 'disabled' it may be matching that sytax and thinking that you want it to be disabled, so it's really giving you a false negative.
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Anybody good with NSClient and check_nrpe?

Post by FTL »

slansing wrote:Try searching for 'enabled' instead of 'disabled' it may be matching that sytax and thinking that you want it to be disabled, so it's really giving you a false negative.
Nope still says the same with 'enabled'

At a loss :-/
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Anybody good with NSClient and check_nrpe?

Post by lmiltchev »

I may be wrong, but the following command:

Code: Select all

check_nrpe -H 1.2.3.4 -p 5666 -c CheckTaskSched -a "filter=title ='Test' status='disabled'" "syntax=%title% %status%"
seems correct... Just out of curiosity, what happens, if you use 'running' instead of 'disabled'?

Code: Select all

check_nrpe -H 1.2.3.4 -p 5666 -c CheckTaskSched -a "filter=title ='Test' status='running'" "syntax=%title% %status%"
I would recommend reviewing the examples here:
http://nsclient.org/nscp/wiki/CheckTask ... ed/samples
I wouldn't hurt to also post your question on the NSClient++ support forum.
Be sure to check out our Knowledgebase for helpful articles and solutions!
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Anybody good with NSClient and check_nrpe?

Post by FTL »

Hi lmiltchev

Substituting disabled for running makes no difference - still tells me everything is ok.

Tried reversing the filter and checking for 'Ready' just incase it was filtering out 'Disbaled' but that too says everything is ok.

Output of schedtasks clearly shows Test is disabled:

Code: Select all

"TaskName","Next Run Time","Status"
"\Friday SQL Back Files Copy","07/03/2014 06:30:00","Ready"
"\Monday SQL Bak Files Copy","03/03/2014 06:30:00","Ready"
"\Saturday SQL Bak Files Copy","01/03/2014 06:30:00","Ready"
"\Sunday SQL Bak Files Copy","02/03/2014 06:30:00","Ready"
"\Test","Disabled",""
"\Thursday SQL Bak Files Copy","06/03/2014 06:30:00","Ready"
"\Tuesday SQL Bak Files Copy","04/03/2014 06:30:00","Ready"
"\Wednesday SQL Bak Files Copy","05/03/2014 06:30:00","Ready"
So its not me losing the plot - which i normally put the blame on to :)

I have asked twice on the NSClient forums (post #1398 and #1399) but my posts never seem to appear on there.

Ive tried putting in AND arguments aswell so it specifically matches title AND status but still nothing:

Code: Select all

check_nrpe -H 1.2.3.4 -p 5666 -c CheckTaskSched -a "filter=title = 'Test' AND status = 'Disabled'" "syntax=%title% AND %status%"
again just returns: OK. All scheduled tasks are good.

:(
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Anybody good with NSClient and check_nrpe?

Post by sreinhardt »

Could you provide a copy of the command definition and script(?) on your nsclient side?
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Anybody good with NSClient and check_nrpe?

Post by FTL »

There isnt one Spencer.

The CheckTaskSched command is a built in module within NSClient and runs out of a dll file. It doesnt use any external scripts or anything.

And i have no Nagios configuration yet as im just testing from the comman line as no point writing the configs when it doesnt work properly.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Anybody good with NSClient and check_nrpe?

Post by lmiltchev »

And i have no Nagios configuration yet as I'm just testing from the command line as no point writing the configs when it doesnt work properly.
It makes perfect sense. :)

I am not sure if this is going to help, but I found a powershell script on the Nagios Exchange for monitoring sheduled tasks in Windows 2008+, that you can probably use with NSClient++ and check_nrpe.

http://exchange.nagios.org/directory/Pl ... ks/details

There may be more "custom" scripts that can get the job done. In NSClient++ you can use powershell, vbs scripts, etc. Let me know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Anybody good with NSClient and check_nrpe?

Post by FTL »

Yes i have been playing with that script and other various powershell scripts i have found but they all need tweaking to do what i want so im going to have to learn how to write in powershell i think!!
FTL
Posts: 72
Joined: Fri Oct 21, 2011 7:23 am

Re: Anybody good with NSClient and check_nrpe?

Post by FTL »

Just for info too:

Testing against various different boxes with this command:

Code: Select all

check_nrpe -H 1.2.3.4 -p 5666 -c CheckTaskSched -a "filter=status eq 'disabled'" "syntax=The Scheduled Task %title% is %status%"
Gives the following results:

Server 2008 - OK. All Scheduled Tasks are good. (using NSC++ v0.39)

Server 2008 - OK. All Scheduled Tasks are good. (using NSC++ v0.41 upgraded from v0.39)

Server 2008 - The Scheduled Task Test is Disabled (using clean install v0.41)

Win 8.1 - The Scheduled Task Test is Disabled (using clean install v0.41)


So looks like as 0.39 was a beta version of CheckTaskSched it obviously didn't work properly - and doing an in place upgrade to the latest most stable version kept in whatever was broken through the upgrade process.

Clean installs of latest version appears to actually produce a valid answer to the arguments provided.

Finally making hay...... :)
Locked