summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon/hobbit_notify.sh
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2011-12-07 19:45:02 (GMT)
committerJames Meyer <james.meyer@operamail.com>2011-12-07 19:45:02 (GMT)
commit582455878ef98dfadc0618309686c85b135f7a23 (patch)
treea87b677b96c168524576cf32870487758d0b43ba /abs/core/xymon/hobbit_notify.sh
parent65b2738ba8a6b80a17c5a2953a29be935b15d18c (diff)
downloadlinhes_pkgbuild-582455878ef98dfadc0618309686c85b135f7a23.zip
linhes_pkgbuild-582455878ef98dfadc0618309686c85b135f7a23.tar.gz
linhes_pkgbuild-582455878ef98dfadc0618309686c85b135f7a23.tar.bz2
xymon: first build, includes both server and client builds.
xymon is a system used to monitor various things about each host. Possible to replace rrdtool and monitorx
Diffstat (limited to 'abs/core/xymon/hobbit_notify.sh')
-rw-r--r--abs/core/xymon/hobbit_notify.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/abs/core/xymon/hobbit_notify.sh b/abs/core/xymon/hobbit_notify.sh
new file mode 100644
index 0000000..7569e2a
--- /dev/null
+++ b/abs/core/xymon/hobbit_notify.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+#
+# BBCOLORLEVEL - The color of the alert: "red", "yellow" or "purple"
+# BBALPHAMSG - The full text of the status log triggering the alert
+# ACKCODE - The "cookie" that can be used to acknowledge the alert
+# RCPT - The recipient, from the SCRIPT entry
+# BBHOSTNAME - The name of the host that the alert is about
+# MACHIP - The IP-address of the host that has a problem
+# BBSVCNAME - The name of the service that the alert is about
+# BBSVCNUM - The numeric code for the service. From SVCCODES definition.
+# BBHOSTSVC - HOSTNAME.SERVICE that the alert is about.
+# BBHOSTSVCCOMMAS - As BBHOSTSVC, but dots in the hostname replaced with commas
+# BBNUMERIC - A 22-digit number made by BBSVCNUM, MACHIP and ACKCODE.
+# RECOVERED - Is "1" if the service has recovered.
+# DOWNSECS - Number of seconds the service has been down.
+# DOWNSECSMSG - When recovered, holds the text "Event duration : N" where
+echo $BBCOLORLEVEL > /tmp/hobbitout
+echo $BBALPHAMSG >>/tmp/hobbitout
+echo $RCPT >>/tmp/hobbitout
+echo $BBHOSTNAME >>/tmp/hobbitout
+echo $BBSVCNAME >>/tmp/hobbitout
+echo $BBHOSTSVC >>/tmp/hobbitout
+
+#BBCOLORLEVEL=red
+#BBCOLORLEVEL=yellow
+#BBALPHAMSG="vmtest:disk red [751147]"
+#BBHOSTNAME="vmtest"
+#BBSVCNAME="disk"
+#BBHOSTSVC="vmtest.disk"
+
+if [ x$BBSVCNAME = xdisk ]
+then
+ case $BBCOLORLEVEL in
+ red )
+ /usr/bin/notify.py ALT "$BBHOSTNAME disk is full"
+ ;;
+ yellow )
+
+ /usr/bin/notify.py PHN "$BBHOSTNAME disk almost full "
+ ;;
+ esac
+fi
+
+
+
+
+
+