Page 1 of 1
Monitor process CPU and Memory utilization
Posted: Mon Jun 26, 2017 2:43 pm
by jkinning
I have a process that according to the application vendor support is using too much memory > 2GB. I am running the NSClient++ and cannot for the life of me figure out how on Windows I can monitor this process and be alerted when this process goes about my threshold. In this case I would want notified if this process consumed more than 1.5GB of RAM and consumed more than 55% of CPU. If I look at the Task Manager I can see the Processes and CPU|Memory|Disk|Network etc just not sure how I can get Nagios to read these and monitor processes CPU and Memory utilization. The performance graphs that Nagios would track would be awesome as well for reporting to prove that this is or is not the root cause of our issues.
Re: Monitor process CPU and Memory utilization
Posted: Mon Jun 26, 2017 3:43 pm
by dwhitfield
I think I'm missing something. The Windows wizard does both Memory and CPU. What have you tried, and what isn't working?
Also, if you want to run more advanced checks from NSClient, I think
https://assets.nagios.com/downloads/nag ... ios-XI.pdf will be useful.
Re: Monitor process CPU and Memory utilization
Posted: Mon Jun 26, 2017 4:16 pm
by SteveBeauchemin
You may want to use this as an example. I grabs a process by name. Use the Task Manager - Processes column - Image Name.
Code: Select all
./check_nrpe -H [a MS host] -c Check_Process -a process=conhost.exe "detail-syntax=%(exe) ws:%(working_set), handles: %(handles), user time:%(user)s" "top-syntax=%(status): %(problem_list)" "warn=working_set gt 3m" "crit=working_set gt 4m"
Gives me this response
Code: Select all
WARNING: conhost.exe ws:3252224, handles: 32, user time:0s, conhost.exe ws:3289088, handles: 35, user time:0s, conhost.exe ws:3735552, handles: 31, user time:0s, conhost.exe ws:3674112, handles: 29, user time:0s|'conhost.exe ws_size'=3.10156MB;3;4 'conhost.exe ws_size'=3.13671MB;3;4 'conhost.exe ws_size'=2.98046MB;3;4 'conhost.exe ws_size'=3.5625MB;3;4 'conhost.exe ws_size'=3.5039MB;3;4
I have the Service defined like this
Code: Select all
Command view:
$USER1$/check_nrpe -2 -t 60:3 -H $HOSTADDRESS$ -c $ARG1$ $ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$
Code: Select all
$ARG1$ = Check_Process
$ARG2$ = -a process=[your process]
$ARG3$ = "detail-syntax=%(exe) ws:%(working_set), handles: %(handles), user time:%(user)s"
$ARG4$ = "top-syntax=%(status): %(problem_list)"
$ARG5$ = "warn=working_set gt 3m"
$ARG6$ = "crit=working_set gt 4m"
The NSClient++ version used is
Code: Select all
./check_nrpe -H [MS Host]
I (0.5.0.62 2016-09-14) seem to be doing fine...
I cannot get it to work on chrome.exe. So I need to learn more.
I hope this helps.
Steve B
Re: Monitor process CPU and Memory utilization
Posted: Mon Jun 26, 2017 4:21 pm
by dwhitfield
@jkinning, for clarity, Steve's suggestion requires NRPE to be a part of your NSClient, using something like
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
Thanks Steve!
Re: Monitor process CPU and Memory utilization
Posted: Tue Jun 27, 2017 6:52 am
by jkinning
Excellent! This is exactly what I was looking for. I have tested this out and it is working like a charm.
Thanks again and you can close this thread.
Re: Monitor process CPU and Memory utilization
Posted: Tue Jun 27, 2017 9:09 am
by tmcdonald
I'll be closing this thread now, but feel free to open another if you need anything in the future!