summaryrefslogtreecommitdiffstats
path: root/abs/core/xymon/hobbit_notify.sh
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-11-26 02:58:51 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-11-26 02:58:51 (GMT)
commitc686ac72e3f81c94dcbc1c1996b83fe33161b7a4 (patch)
treed870bd63048277320fe958af625feadda8c3e4a7 /abs/core/xymon/hobbit_notify.sh
parentb076f534f15ffbbbdeaa9f6b7d32fe96fc6a5bb6 (diff)
downloadlinhes_pkgbuild-c686ac72e3f81c94dcbc1c1996b83fe33161b7a4.zip
linhes_pkgbuild-c686ac72e3f81c94dcbc1c1996b83fe33161b7a4.tar.gz
linhes_pkgbuild-c686ac72e3f81c94dcbc1c1996b83fe33161b7a4.tar.bz2
xymon-server: hook up xymon alerts to the osd.
System will push out alerts via func to all hosts for any red conditions excluding the ping test. Test must be red for 4hours with repeat notifications every 12 hours refs #943
Diffstat (limited to 'abs/core/xymon/hobbit_notify.sh')
-rw-r--r--abs/core/xymon/hobbit_notify.sh67
1 files changed, 49 insertions, 18 deletions
diff --git a/abs/core/xymon/hobbit_notify.sh b/abs/core/xymon/hobbit_notify.sh
index 7569e2a..742b3db 100644
--- a/abs/core/xymon/hobbit_notify.sh
+++ b/abs/core/xymon/hobbit_notify.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+. /etc/systemconfig
#
# BBCOLORLEVEL - The color of the alert: "red", "yellow" or "purple"
# BBALPHAMSG - The full text of the status log triggering the alert
@@ -14,35 +15,65 @@
# 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
+
+
+# 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"
+#BBHOSTNAME="testcraa"
#BBSVCNAME="disk"
+#BBSVCNAME="func"
#BBHOSTSVC="vmtest.disk"
-if [ x$BBSVCNAME = xdisk ]
-then
- case $BBCOLORLEVEL in
- red )
- /usr/bin/notify.py ALT "$BBHOSTNAME disk is full"
- ;;
- yellow )
+#/usr/LH/bin/msg_client.py --msg "$BBCOLORLEVEL\n$BBHOSTSVC"
+#/usr/bin/func "*" call msg display
+
+function msg_func_out() {
+ /usr/bin/func "*" call msg display "${1}"
+}
+
+function msg_local_out() {
+
+ /usr/LH/bin/msg_client.py --msg "${1}"
+
+ }
+
- /usr/bin/notify.py PHN "$BBHOSTNAME disk almost full "
- ;;
- esac
-fi
+case x$BBSVCNAME in
+ xdisk)
+ case $BBCOLORLEVEL in
+ red )
+ msg_func_out "$BBHOSTNAME disk is at 95% full or greater|alert"
+ ;;
+ yellow )
+ msg_func_out "$BBHOSTNAME disk is almost full"
+ ;;
+ esac
+ ;;
+
+ xfunc)
+ if [ "x$hostname" = "x$BBHOSTNAME" ]
+ then
+ msg_local_out "System can not communicate with itself (func) |alert"
+ else
+ msg_func_out "$hostname can not communicate with $BBHOSTNAME (func)|alert"
+ fi
+ ;;
+ *)
+ #catch all for everything else
+ msg_func_out "Condition $BBCOLORLEVEL\n$BBHOSTNAME $BBSVCNAME\n Please check the system health webpage|alert"
+ ;;
+esac