diff options
author | Britney Fransen <brfransen@gmail.com> | 2013-12-26 20:13:40 (GMT) |
---|---|---|
committer | Britney Fransen <brfransen@gmail.com> | 2013-12-26 20:13:40 (GMT) |
commit | af515b99f692bcf1f0af57aabe8f7c1a950b32c5 (patch) | |
tree | d2cbd0bd7a159adac8ebc749e6c76d005ad4a42e /abs/core/xymon/hobbit_notify.sh | |
parent | 45f667c9512475b4cb5c5290557dea854d056634 (diff) | |
parent | 816f6f419c662354f4224f8d82387fc27693b0fb (diff) | |
download | linhes_pkgbuild-af515b99f692bcf1f0af57aabe8f7c1a950b32c5.zip linhes_pkgbuild-af515b99f692bcf1f0af57aabe8f7c1a950b32c5.tar.gz linhes_pkgbuild-af515b99f692bcf1f0af57aabe8f7c1a950b32c5.tar.bz2 |
Merge branch 'testing'
Diffstat (limited to 'abs/core/xymon/hobbit_notify.sh')
-rw-r--r-- | abs/core/xymon/hobbit_notify.sh | 67 |
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..26b789f 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 $BBSVCNAME on $BBHOSTNAME\nSee the system health webpage.|alert" + ;; +esac |