Skip to main content

Nagios / Icinga monitoring plugin to check systemd for failed units.

Project description

pypi.org Build Status

check_systemd

check_systemd is a Nagios / Icinga monitoring plugin to check systemd for failed units.

This Python script will report a degraded system to your monitoring solution. It requires only the nagiosplugin library.

You can also test a single service with the -u, --unit parameter.

Released under GNU GPLv2 License.

Installation

pip3 install check_systemd

Command line interface

usage: check_systemd [-h] [-c SECONDS] [-e UNIT | -u UNIT] [-v] [-V] [-w SECONDS]

Copyright (c) 2014-18 Andrea Briganti a.k.a 'Kbyte' <kbytesys@gmail.com>
Copyright (c) 2019-20 Josef Friedrich <josef@friedrich.rocks>

Nagios / Icinga monitoring plugin to check systemd for failed units.

optional arguments:
  -h, --help            show this help message and exit
  -c SECONDS, --critical SECONDS
                        Startup time in seconds to result in critical status.
  -e UNIT, --exclude UNIT
                        Exclude a systemd unit from the checks. This option can be applied multiple times, for example: -e mnt-data.mount -e
                        task.service. Regular expressions can be used to exclude multiple units at once, for example: -e 'user@\d+\.service'. For
                        more informations see the Python documentation about regular expressions (https://docs.python.org/3/library/re.html).
  -u UNIT, --unit UNIT  Name of the systemd unit that is being tested.
  -v, --verbose         Increase output verbosity (use up to 3 times).
  -V, --version         show program's version number and exit
  -w SECONDS, --warning SECONDS
                        Startup time in seconds to result in warning status.

Performance data:
  - count_units
  - startup_time
  - units_activating
  - units_active
  - units_failed
  - units_inactive

Project pages

Testing

pyenv install 3.7.6
pyenv install 3.8.1
pyenv local 3.7.6 3.8.1
pip3 install tox
tox

Deploying

Edit version number in check_systemd.py (without v)

git tag v2.0.11
git push --tags

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

check_systemd-2.1.0.tar.gz (12.9 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page