nagios-plugins
nagios-plugins copied to clipboard
add -f parameter to check "failed" status
In systemd, a service can be successful, even though it is not currently running. E.g., if it is triggered by a timer or socket activation.
This patch adds a new switch -f which uses systemctl is-failed instead of the status verb. It will return OK if it is not failed, regardless of other status (waiting, running). I don't think other supervisors have this concept, so I did not bother to try to make it more general in this version.
(Some whitespace fixes snuck in as well. Let me know if you want them separately and I'll redo the patch.)