Page 1 of 2

The culprit of high CPU & Memory usage on Windows & Linux

Posted: Fri Feb 17, 2012 1:03 am
by Satyam
Hi,

I remember some time ago, the windows and linux admins of my company came to me and ask "Can you please tell me that which process/service is using such a high cpu or memory". This is the case because every time they have to close a lot of warning and critical tickets related to high CPU & Memory usage(which usually keep fluctuating) for their servers (Since our Nagios is integrated with a ticketing tool), so the thing is that they can see that CPU and Memory usage has went high at this time and crossed the warning & critical threshold in nagios and performance grapher, but they wanted and raised a question to me why can't your nagios tell that which process or service caused this. So they can take the necessary action and close the ticket with appropriate justification. Being an innocent nagios admin, i replied let me think a way around it, if it can be done and so i landed here for the ideas which can solve the thurst. Thanks...


Manish Kumar,
Open Source Tools Team, IMS, Mahindra Satyam
Bangalore, India

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Sun Feb 19, 2012 7:18 pm
by jsmurphy
About all I can suggest is check out nagios exchange http://exchange.nagios.org/ for some plugins that allow you to track specific process usage... I have no idea if they exist I've never really looked.

It could also be that your timing thresholds are currently a little too susceptible to false positives, ensure that CPU usage is high for an extended period of time before notifying... that way the issue should still be on-going by the time they get the notification and when they log on to the server they will be able to see who the offender is via task manager/top.

Edit: I also just had the idea that you could probably write your own script and use the process perfmon counter, alternatively a custom script and WMI might also be worth investigating..

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Fri Oct 19, 2012 3:40 pm
by Satyam
Hi,

Finally we have developed on our own solution (not from scratch... ) for this problem and its up at the Nagios exchange too. Feel free to use it and evaluate it. Please post for any bugs.

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

http://exchange.nagios.org/directory/Ad ... ls/details

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Sun Oct 21, 2012 2:30 pm
by GaWd
Looks like your windows agent link is broken. I'd be very interested in it if you re-post it.

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Sun Oct 21, 2012 5:22 pm
by jsmurphy
Great work! this will probably help a lot of people when you get that windows link fixed up :)

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Mon Oct 22, 2012 12:10 am
by Satyam
Hi,

Anyone there from Nagios Exchange, how can i get that link fixed up ??

http://exchange.nagios.org/directory/Ad ... ls/details

I tired to edit and post it couple of times but with no success, I am not able to see any delete project button on exchange, so that i can try to delete it and upload it again.

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Mon Oct 22, 2012 5:05 pm
by jsmurphy
I'll see if I can find some one who can help out :)

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Tue Oct 23, 2012 7:31 am
by mguthrie
Updated the title. Exchange sometimes doesn't properly encode meta characters when it builds the URL. Here's the new link.
http://exchange.nagios.org/directory/Ad ... ls/details

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Tue Oct 23, 2012 8:11 am
by Satyam
Thanks mguthrie !! Now it's working fine.

Re: The culprit of high CPU & Memory usage on Windows & Linu

Posted: Mon Nov 19, 2012 5:26 am
by prandal
Nice enhancement.

It would be great if you could feed your changes upstream to nsclient.org so they can become part of the standard NSClient++