Hi guys.
Do you think it could be possible to monitor Windows process with nagios in scenario where you wish to get an alarm when process.exe consumes 50% of CPU more then 10 seconds.
Or when process consumes 3GB of memory more then n-seconds?
Any ideas how to achieve that?
with best regards
Check CPU usage in seconds
Re: Check CPU usage in seconds
While it's possible, I wouldn't recommend it. Based on what you mention here, you'll be checking the Windows machine every few seconds, which I'd advise against for many reasons.
You could create a plugin, that runs a check for you over the CLI, and then stores that information. Now, have it wait x seconds, and execute the same check again. Have your plugin compare the results, and output them to Nagios. You would most likely need to write this yourself, or see if you can find something that works for you on our exchange @ https://exchange.nagios.org.
You could create a plugin, that runs a check for you over the CLI, and then stores that information. Now, have it wait x seconds, and execute the same check again. Have your plugin compare the results, and output them to Nagios. You would most likely need to write this yourself, or see if you can find something that works for you on our exchange @ https://exchange.nagios.org.
Former Nagios Employee
Re: Check CPU usage in seconds
I agree with rkennedy - I would not encourage any check to occur every few seconds or so, either. In fact, one minute is the smallest check frequency Nagios is capable of conducting.
The Nagios XI Windows server wizard enables you to set thresholds for memory, CPU, etc but does not allow for what you're talking about - if process abc.exe is using 50% CPU for a sustained 10 seconds.
I did a quick check at our exchange site for a plugin containing this functionality and did not find anything. You can have a look to see if I missed something, but I suspect you'd have to write this yourself, as rkennedy mentioned.
https://exchange.nagios.org/index.php?o ... 0processes
The Nagios XI Windows server wizard enables you to set thresholds for memory, CPU, etc but does not allow for what you're talking about - if process abc.exe is using 50% CPU for a sustained 10 seconds.
I did a quick check at our exchange site for a plugin containing this functionality and did not find anything. You can have a look to see if I missed something, but I suspect you'd have to write this yourself, as rkennedy mentioned.
https://exchange.nagios.org/index.php?o ... 0processes
Be sure to check out the Knowledgebase for helpful articles and solutions!
Re: Check CPU usage in seconds
as an alternative you could just trigger if CPU exceeded threshold then return the process list with the memory and cpu time in the list
if you look at the nsclient documentation and do a little massaging you should be able to get it to work
for the memory threshold you certainly can trigger if the process has exceeded the memory limit also included in the previous link
if you look at the nsclient documentation and do a little massaging you should be able to get it to work
Code: Select all
https://docs.nsclient.org/reference/windows/CheckSystem.html#check-process
Looking forward to seeing you all at #NagiosCon2019?
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
-Dedicated Lover of Nconf,PNP4Nagios and Nagvis
Re: Check CPU usage in seconds
To add to what @nozlaf mentioned, could always log the top mem / cpu processes locally as well. I wrote a few scripts you could use to do so here -
https://support.nagios.com/forum/viewto ... 39#p167539
https://support.nagios.com/forum/viewto ... 39#p167539
Former Nagios Employee