Linuxfabrik / monitoring-plugins

200+ check plugins for Icinga and other Nagios-compatible monitoring applications. Each plugin is a standalone command line tool (written in Python) that provides a specific type of check.
https://linuxfabrik.ch
The Unlicense
207 stars 48 forks source link

procs or cpu-usage: Check for cpu usage of specific processes #753

Open asltbbg opened 3 months ago

asltbbg commented 3 months ago

Describe the solution you'd like

It would be nice if the proc check would have the feature to check for problems with the cpu usage and throws warnings like the memory usage.

Maybe 2 switces:

--warning-cpu-percent --critical-cpu-percent

Additional context

No response

markuslf commented 3 months ago

What about https://github.com/Linuxfabrik/monitoring-plugins/tree/main/check-plugins/cpu-usage and its output like this?


2.7% - user: 1.4%, system: 0.6%, irq: 0.4%, guest: 0.3%, iowait: 0.2%, softirq: 0.1%
guest_nice: 0.0%, nice: 0.0%, steal: 0.0%
ctx_switches: 601.1M, interrupts: 428.6M, soft_interrupts: 184.1M

Top 5 processes using the most cpu time:
1. WebExtensions: 2h 44m
2. morgen: 2h 28m
3. firefox: 2h 10m
4. qemu-system-x86_64: 1h 46m
5. gnome-shell: 1h 42m
asltbbg commented 3 months ago

yes we are using this currently as a workarround.

with the proc check you are able to monitor one specific process. its mostly one known process which is anoing.

the cpu_usage monitors all processes and you have to pic the troublemaker in the list by locking manualy.

markuslf commented 3 months ago

And how should a switch like --warning-cpu in procs behave if you monitor more than one or all procs?

asltbbg commented 3 months ago

i think for this case the cpu_usage check is good enough maybe it is also a good idee to include this feature for monitoring a choosen process by name in the cpu_usage check instead in the proc check?

markuslf commented 3 months ago

I get the point, we'll think about it. Thank you for your input. :+1: