monitor Windows Process handles via nagios

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.
Locked
paul559
Posts: 2
Joined: Wed Oct 23, 2013 11:28 am

monitor Windows Process handles via nagios

Post 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
Attachments
windows handles.docx
(19.7 KiB) Downloaded 335 times
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: monitor Windows Process handles via nagios

Post 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.
paul559
Posts: 2
Joined: Wed Oct 23, 2013 11:28 am

Re: monitor Windows Process handles via nagios

Post 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.
Attachments
qp service.docx
(27.49 KiB) Downloaded 311 times
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: monitor Windows Process handles via nagios

Post 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.
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.
User avatar
mickem
Posts: 16
Joined: Tue Oct 08, 2013 2:17 am
Location: Stockholm, SWEDEN
Contact:

Re: monitor Windows Process handles via nagios

Post by mickem »

This is supported in NSClient++ 0.4.2

// Michael Medin
// Michael Medin @mickem, blog.medin.name

Author of NSClient++ - http://nsclient.org
NSClient++ 0.4.2 Documentation: http://docs.nsclient.org
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: monitor Windows Process handles via nagios

Post by sreinhardt »

Cool, nice to know! Thanks Michael!
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.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: monitor Windows Process handles via nagios

Post by abrist »

mickem wrote:This is supported in NSClient++ 0.4.2
What would be the syntax for such a check?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
mickem
Posts: 16
Joined: Tue Oct 08, 2013 2:17 am
Location: Stockholm, SWEDEN
Contact:

Re: monitor Windows Process handles via nagios

Post 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
// Michael Medin @mickem, blog.medin.name

Author of NSClient++ - http://nsclient.org
NSClient++ 0.4.2 Documentation: http://docs.nsclient.org
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: monitor Windows Process handles via nagios

Post by abrist »

OP: Lets us know how the check configuration treats you.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
guigigena
Posts: 1
Joined: Mon Jul 07, 2014 9:05 am

Re: monitor Windows Process handles via nagios

Post 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...
Locked