nagios-plugins icon indicating copy to clipboard operation
nagios-plugins copied to clipboard

add -f parameter to check "failed" status

Open kjetilho opened this issue 3 years ago • 0 comments

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.)

kjetilho avatar Nov 29 '22 15:11 kjetilho