aboutsummaryrefslogtreecommitdiffstats
path: root/main/nagios-plugins/check_openrc
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2017-09-26 21:19:26 +0200
committerJakub Jirutka <jakub@jirutka.cz>2017-09-26 21:20:11 +0200
commit111e1703a0b8deff86d928b7d87972fdbc6200cb (patch)
treee5ba691a28e83563c4745835b9e756af7e4c398a /main/nagios-plugins/check_openrc
parentb9587abdcaf5412957f83c2583a4e56b09ba1936 (diff)
downloadaports-111e1703a0b8deff86d928b7d87972fdbc6200cb.tar.gz
aports-111e1703a0b8deff86d928b7d87972fdbc6200cb.tar.bz2
aports-111e1703a0b8deff86d928b7d87972fdbc6200cb.tar.xz
main/nagios-plugins: add plugin check_openrc
Diffstat (limited to 'main/nagios-plugins/check_openrc')
-rw-r--r--main/nagios-plugins/check_openrc11
1 files changed, 11 insertions, 0 deletions
diff --git a/main/nagios-plugins/check_openrc b/main/nagios-plugins/check_openrc
new file mode 100644
index 0000000000..b21d6baebf
--- /dev/null
+++ b/main/nagios-plugins/check_openrc
@@ -0,0 +1,11 @@
+#!/bin/sh
+# vim: set ts=4:
+
+crashed=$(sudo rc-status --crashed)
+
+if [ -n "$crashed" ]; then
+ echo "CRITICAL - crashed services: ${crashed//$'\n'/, }"
+ exit 2
+else
+ echo 'OK'
+fi