Page 1 of 1

monitor Windows Process handles via nagios

Posted: Wed Oct 23, 2013 11:37 am
by paul559
Hello all,

I am very new to nagios.

I have a custom service on Windows 2008 servers that i would like to monitor the handles with nagios. Sometimes the handle grows so much that we end up restarting the service (developers are working for a fix).

Is there a way?

see attachment for exactly what i am talking about.


Thank you,
Paul Walia

Re: monitor Windows Process handles via nagios

Posted: Wed Oct 23, 2013 11:55 am
by slansing
Do you mean you want to monitor the process that is spawned when opening a command prompt? Other than that I do not see a example of your custom service.

Re: monitor Windows Process handles via nagios

Posted: Wed Oct 23, 2013 12:02 pm
by paul559
slansing wrote:Do you mean you want to monitor the process that is spawned when opening a command prompt? Other than that I do not see a example of your custom service.

Thank you for your quick reply. Let me give you exact example in the attachment.

If you see there are multiple instances of this qp_rept_scheduler.exe process. Right now Handles look normal but 2 days ago one of the service handles were up to 12 million and it died on us. I want to monitor these handles for this services.

Re: monitor Windows Process handles via nagios

Posted: Wed Oct 23, 2013 4:05 pm
by sreinhardt
Do you have a specific way you would like to monitor this, wmi, snmp, or agents? I would be quite surprised if there was a current way with snmp, but wmi would likely have this information available without an agent, and via ncpa or another agent this is absolutely possible, as you could use a scripted solution to inform you.

Re: monitor Windows Process handles via nagios

Posted: Fri Oct 25, 2013 10:33 am
by mickem
This is supported in NSClient++ 0.4.2

// Michael Medin

Re: monitor Windows Process handles via nagios

Posted: Fri Oct 25, 2013 1:42 pm
by sreinhardt
Cool, nice to know! Thanks Michael!

Re: monitor Windows Process handles via nagios

Posted: Fri Oct 25, 2013 1:43 pm
by abrist
mickem wrote:This is supported in NSClient++ 0.4.2
What would be the syntax for such a check?

Re: monitor Windows Process handles via nagios

Posted: Sat Oct 26, 2013 3:29 am
by mickem
First off 0.4.2 is currently out as beta.
A RC will be out in the coming weeks and a release a bit after that once people have reported back all bugs.

The documentation for 0.4.2. can be found here: http://docs.nsclient.org
But some better docs (usage oriented) can be found on the blog: http://www.nsclient.org/nscp/blog (these will be merged with docs eventually).

A relevant (sort of) example from the blog post is:

Code: Select all

check_process process=explorer.exe "warn=working_set > 70m" "detail-syntax=${exe} ws:${working_set}, handles: ${handles}, user time:${user}s"
explorer.exe ws:77271040, handles: 800, user time:107s
Performance data: 'explorer.exe ws_size'=73M;70;0
Where we actually check memory but show handles.
What you want is to replace the check to also check handles like so (I also added in a critical threshold for fun):

Code: Select all

check_process process=explorer.exe "warn=handles > 70" "crit=handles > 700" "detail-syntax=${exe} handles: ${handles}"
L     client CRITICAL: explorer.exe handles: 1256
L     client  Performance data: 'explorer.exe handle count'=1256;70;700
// Michael Medin

Re: monitor Windows Process handles via nagios

Posted: Mon Oct 28, 2013 11:33 am
by abrist
OP: Lets us know how the check configuration treats you.

Re: monitor Windows Process handles via nagios

Posted: Wed Jul 23, 2014 3:05 pm
by guigigena
I had the same issue, i found a simple way to do this.. With the agent NSCP++ and the module CheckCounter...

CheckCounter "Counter:Handle=\\Process(Explorer)\\Handle Count" ShowAll MaxWarn=2000 MaxCrit=10000

Any conter of the perfmon can be added to the checkCounter, to know the name of the counter open the permon, add your counter, then select the same and go to properties to see the path.

Ex: \Processor(_Total)\%Idle Time

With CheckCounter add a \ more and the warn and Critical values

CheckCounter "Counter:Handle=\\Processor(_Total)\\%Idle Time" ShowAll MaxWarn=2000 MaxCrit=10000

I Hope this help someone...