Skip to content

This systemd check for nagios compatible monitoring systems will report a degraded systemd to your monitoring solution. It can also be used to monitor individual systemd services and timers units.

License

Notifications You must be signed in to change notification settings

Josef-Friedrich/check_systemd

 
 

Repository files navigation

This package on the Python Package Index Tests Documentation Status

check_systemd

check_systemd is a Nagios / Icinga monitoring plugin to check systemd. This Python script will report a degraded system to your monitoring solution. It can also be used to monitor individual systemd services (with the -u, --unit parameter) and timers units (with the -t, --dead-timers parameter). The only dependency the plugin needs is the Python library nagiosplugin.

Installation

pip install check_systemd

Packages

check_systemd on repology.org.

  • archlinux (package, source code): yaourt -S check_systemd
  • Ubuntu (package, source code): apt install monitoring-plugins-systemd
  • Debian (package, source code): apt install monitoring-plugins-systemd
  • NixOS (package, source code): nix-env -iA nixos.check_systemd
  • Fedora (package, source code): dnf install nagios-plugins-systemd
  • OracleLinux9 / RHEL9 (package, source code, binary): This package includes one single binary compiled with the Python compiler Nuitka, including all dependencies. The package is built via GitLab CI as a nightly release and is considered experimental. curl -L -o check_systemd-1.0-1.x86_64.rpm "https://gitlab.com/msfgitlab/check_systemd_build_rpm/-/jobs/artifacts/main/raw/output/check_systemd-1.0-1.x86_64.rpm?job=release_rpm" && sudo dnf install -y ./check_systemd-1.0-1.x86_64.rpm

Command line interface

Traceback (most recent call last):
  File "/usr/lib/nagios/plugins/check_systemd", line 61, in <module>
    import nagiosplugin
ModuleNotFoundError: No module named 'nagiosplugin'

Project pages

Behind the scenes

dbus

Command line interface (cli) parsing:

To detect failed units this monitoring script runs:

systemctl list-units --all

To get the startup time it executes:

systemd-analyze

To find dead timers this plugin launches:

systemctl list-timers --all

To learn how systemd produces the text output on the command line, it is worthwhile to take a look at systemd’s source code. Files relevant for text output are: basic/time-util.c, analyze/analyze.c.

Deploying

Edit the version number in check_systemd.py (without v). Use the -s option to sign the tag (required for the Debian package).

git tag -s v2.0.11
git push --tags

About

This systemd check for nagios compatible monitoring systems will report a degraded systemd to your monitoring solution. It can also be used to monitor individual systemd services and timers units.

Topics

Resources

License

Stars

Watchers

Forks

Languages

  • Python 98.8%
  • Just 1.2%