Check CPU Usage - Plugins?

Hello everybody,

I’m searching for some recommendations for the best check plugins to check the cpu usage on linux and on windows systems. Can someone recommend some?

The management of our company would like to know the cpu usage in percent, not the cpu load…

Thanks for any suggestion!

Alicia

For Linux Probably this is a good place to start:

https://exchange.nagios.org/directory/Plugins/Operating-Systems/Linux/Linux-CPU-Check-with-Top-5-Processes/details

For Windows :-1: may be @cstein can suggest

2 Likes

Maybe these checks help on Linux, especially the cpu-usage check:

4 Likes

For windows there is a check available as well. You have to use the powershell-framework:

Invoke-IcingaCheckCPU

3 Likes

The plugins have been moved to GitHub. Have a look at GitHub - Linuxfabrik/monitoring-plugins: More than 160 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.

I’m trying to use this check on Linux hosts, but a bit confused on what prereqs there are, it seems to rely on psutil, correct? Does that mean that I also need to install python on the hosts which I want to monitor ? (I use the Icinga agent because we need the hosts to push to Icinga due to network isolation)

I use it with success

The Python version requires psutil but there’s a compiled (with nuitka) version that should be self contained.

1 Like

So this one first, then the cpu-check should be OK?

Nuitka Downloads — Nuitka the Python Compiler

The Linuxfabrik provides precompiled packages.

Oh… missed that. Thanks!

Got it going, created the service template/command in Director and tried it on a host that has the plugins… Got this :frowning:
Wondering which DB it tries to write to, and if I need to set some permission on any local DB file on the host maybe?

Query failed: INSERT INTO "perfdata" (cpu_usage,​guest,​guest_nice,​iowait,​irq,​nice,​softirq,​steal,​system,​user) VALUES (:cpu_usage,​:guest,​:guest_nice,​:iowait,​:irq,​:nice,​:softirq,​:steal,​:system,​:user);, Error: attempt to write a readonly database, Data: {'cpu_usage': 5.6, 'guest': 0.0, 'guest_nice': 0.0, 'iowait': 1.6, 'irq': 0.0, 'nice': 0.0, 'softirq': 0.0, 'steal': 0.0, 'system': 1.6, 'user': 2.4}

I guess it tries to write into a local sqlite file.

Probably yes, just need to find out where it is :slight_smile:

Edit: Found it… It’s under /tmp. Just had the wrong owner.