This is a script that will check the systemd(1) status by parsing the output of systemctl(1). It will signal warning (1) and/or critical (2) conditions via the exit code when the system - as perceived by systemd - it not (yet) in optimal (i.e. running) state.
This can, for instance, be used as a simple Nagios / Icinga check in order to monitor the overall system status.
This script can be invoked without any additional arguments. It will, in return
invoke systemctl
and parse its output. The --systemctl-path
argument can
be used to specify a location to the systemctl
binary explicitly, in case
it is not within $PATH
.
This plugin will exit with codes that are compliant with the typical Nagios /
Icinga (2) convention. More specifically it will indicate
a warning
state when there are queued jobs and a critical
state when there
are failed units. In case of failure (i.e. systemctl
not being available), it
will indicate an unknown
situation. Otherwise ok
is being returned.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.