Is there any way to monitor the CPU usage of a process with a given name? Either in % or seconds? I'm just wondering if I missed something in the docs or a way to do it other than a script.
Ad Widget
Collapse
CPU Usage Of A Process
Collapse
X
-
Comment
-
Actually, I was asked to do the same thing just yesterday, and came across an ancient post from 2005.
UserParameter=httpd[cpu],ps auxw|grep httpd|grep -v grep| awk '{s+=$3} END {print s}'
Seems to work ok. Gives the same values that you will see in 'top'.
MrKenDisclaimer: All of the above is pure speculation.Comment
-
Addendum:
You may see values like 'httpd - 240%', and of course that cannot be correct. To correct this you need to divide by the number of cpu's. For example if the server has 4 cpu's, you will end up with a value of 60%, which is most probably closer to the real value.
This can be done in the item configuration, Use Multiplier. For 4 cpu's you multiply by 0.25
MrKenDisclaimer: All of the above is pure speculation.Comment
-
If you have a constructive remark why not filling it into the Request Tracker?
Comment
Comment