[hobbit] qpage
Andy France
Andy at zespri.com
Tue Jun 14 10:11:39 CEST 2005
Hi Al,
"Jeffcoat, Al" wrote on 14/06/2005 14:22:44:
> Can someone tell me the format of adding qpage messages into the
> hobbit-alerts.cfg please? I have qpage working, and sending pages
> from CLI, but the following line in hobbit-alerts.cfg is not working for
me:
>
> SCRIPT /usr/local/bin/qpage userid FORMAT=TEXT
>
> TIA
>
> Al Jeffcoat
I also use qpage, but have a wrapper script like this:
#!/opt/csw/bin/bash
#
# Script: /home/hobbit/bin/qpage.sh
#
# Script get the following environment variables pre-defined so
# that they can send a meaningful alert:
#
# 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
# N is the DOWNSECS value.
#
# Minumum hobbit-alerts.cfg entry -
# SCRIPT /home/hobbit/bin/qpage.sh support-pg FORMAT=SMS
#
if [ ${RECOVERED} = 1 ]
then
STATUS="OK"
else
COLOR=`echo ${BBALPHAMSG} | /usr/bin/awk ' { print $2 } '`
STATUS="${COLOR} ${ACKCODE}"
fi
/usr/local/bin/qpage ${RCPT} ${BBHOSTSVC} ${STATUS}
Note that I have massaged the status code - it seems some of our on-call
folk don't like "-1" as an indicator that things have recovered. It
doesn't register quickly enough with the brain in the wee small hours of
the morning ;-)
The corresponding line in hobbit-alert.cfg then becomes:
SCRIPT /home/hobbit/bin/qpage.sh support-pg REPEAT=60m RECOVERED
FORMAT=SMS COLOR=red
"support-pg" is configured as a "pager" in the qpage.cf file.
HTH,
Andy.
#####################################################################################
This email is intended for the person to whom it is addressed
only. If you are not the intended recipient, do not read, copy
or use the contents in any way. The opinions expressed may not
necessarily reflect those of ZESPRI Group of Companies ('ZESPRI').
While every effort has been made to verify the information
contained herein, ZESPRI does not make any representations
as to the accuracy of the information or to the performance
of any data, information or the products mentioned herein.
ZESPRI will not accept liability for any losses, damage or
consequence, however, resulting directly or indirectly from
the use of this e-mail/attachments.
#####################################################################################
More information about the Xymon
mailing list