Hi,
I was wondering if there is anyway to change the default email alert contents to include the DESCR tag information for a host (without creating a custom alert script)? We have many support people who don't know what all of the hosts are for or if it goes down, what that means and I want to make it easier for them to know what is affected.
Thanks.
On Wed, Jan 24, 2007 at 08:58:02AM -0500, Geoff Hallford wrote:
I was wondering if there is anyway to change the default email alert contents to include the DESCR tag information for a host (without creating a custom alert script)? We have many support people who don't know what all of the hosts are for or if it goes down, what that means and I want to make it easier for them to know what is affected.
You'll either have to create a custom alert script, or tweak the hobbitd/do_alert.c C code. If you choose the latter, then the message_subject() and message_text() routines are the ones you're after; you can get the DESCR tag with code like this:
namelist_t *hinfo;
char *descr;
hinfo = hostinfo(alert->hostname);
descr = bbh_item(hinfo, BBH_DESCRIPTION);
Note that this will return a NULL pointer if there is no DESCR tag for this host.
Regards, Henrik
Thank you. Will do.
On 1/24/07, Henrik Stoerner <henrik at hswn.dk> wrote:
On Wed, Jan 24, 2007 at 08:58:02AM -0500, Geoff Hallford wrote:
I was wondering if there is anyway to change the default email alert contents to include the DESCR tag information for a host (without creating a custom alert script)? We have many support people who don't know what all of the hosts are for or if it goes down, what that means and I want to make it easier for them to know what is affected.
You'll either have to create a custom alert script, or tweak the hobbitd/do_alert.c C code. If you choose the latter, then the message_subject() and message_text() routines are the ones you're after; you can get the DESCR tag with code like this:
namelist_t *hinfo; char *descr; hinfo = hostinfo(alert->hostname); descr = bbh_item(hinfo, BBH_DESCRIPTION);Note that this will return a NULL pointer if there is no DESCR tag for this host.
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- 'If my answers frighten you then you should cease asking scary questions.' --Sam Jackson
Hi Henrik,
Since the DESCR tab doesn't get sent automatically (that I know of) to a custom alert script, what is the easiest way to accomplish obtaining it. The script is written in Bourne Shell (standard /bin/sh). This is what my current script looks like (very simple for now):
#!/bin/sh
Start Section for Time Formatting
#----------------------------------------------------- mkstring () { TIME_VALUE=$1 UNIT=$2 if [ $TIME_VALUE -eq 0 ]; then OUT="" elif [ $TIME_VALUE -eq 1 ]; then OUT="1 $UNIT, " else OUT="$TIME_VALUE ${UNIT}S, " fi echo "$OUT" }
seconds2text () {
Convert seconds to week/day/hour/minute
TEMP0=expr $1 / 60
SECOND=expr $1 - $TEMP0 \* 60
TEMP1=expr $TEMP0 / 60
MINUTE=expr $TEMP0 - $TEMP1 \* 60
TEMP2=expr $TEMP1 / 24
HOUR=expr $TEMP1 - $TEMP2 \* 24
TEMP3=expr $TEMP2 / 7
DAY=expr $TEMP2 - $TEMP3 \* 7
WEEK=$TEMP3
Build the output string
STRING="mkstring $WEEK WEEK"
STRING="$STRINGmkstring $DAY DAY"
STRING="$STRINGmkstring $HOUR HOUR"
STRING="$STRINGmkstring $MINUTE MIN"
STRING="$STRINGmkstring $SECOND SEC"
Remove the trailing comma
DOWNSECS=echo $STRING | sed 's/,$//'
}
If the seconds don't equal zero (ie event just started) then format the
duration if [ $DOWNSECS -ne 0 ]; then
seconds2text $DOWNSECS
else
DOWNSECS="0 SECONDS"
fi
Check if the status is recovered
if [ $RECOVERED -eq 1 ]; then
echo -e "STATUS: RECOVERED\nDATE: `date`\nSYSTEM TYPE:
PRODUCTION\nSYSTEM NAME: $BBHOSTNAME\nDURATION: $DOWNSECS\n\n--\n\n$BBALPHAMSG\n\n" | /usr/bin/mail -s "PROD RECOVERED: $BBHOSTSVC" $RCPT
Check if the status is still down
else
echo -e "STATUS: DOWN\nDATE: date\nSYSTEM TYPE: PRODUCTION\nSYSTEM
NAME: $BBHOSTNAME\nALERT COLOR: $BBCOLORLEVEL\nDURATION:
$DOWNSECS\n\n--\n\n$BBALPHAMSG\n\n" | /usr/bin/mail -s "PROD DOWN:
$BBHOSTSVC"
$RCPT
fi
On 1/24/07, Geoff Hallford <geoff.hallford at gmail.com> wrote:
Thank you. Will do.
On 1/24/07, Henrik Stoerner <henrik at hswn.dk> wrote:
On Wed, Jan 24, 2007 at 08:58:02AM -0500, Geoff Hallford wrote:
I was wondering if there is anyway to change the default email alert contents to include the DESCR tag information for a host (without creating a custom alert script)? We have many support people who don't know what all of the hosts are for or if it goes down, what that means and I want to make it easier for them to know what is affected.
You'll either have to create a custom alert script, or tweak the hobbitd/do_alert.c C code. If you choose the latter, then the message_subject() and message_text() routines are the ones you're after;
you can get the DESCR tag with code like this:
namelist_t *hinfo; char *descr; hinfo = hostinfo(alert->hostname); descr = bbh_item(hinfo, BBH_DESCRIPTION);Note that this will return a NULL pointer if there is no DESCR tag for this host.
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- 'If my answers frighten you then you should cease asking scary questions.' --Sam Jackson
-- 'If my answers frighten you then you should cease asking scary questions.' --Sam Jackson
On Thu, Mar 01, 2007 at 08:51:35AM -0500, Geoff Hallford wrote:
Since the DESCR tab doesn't get sent automatically (that I know of) to a custom alert script, what is the easiest way to accomplish obtaining it.
It does, it's in the "$BBH_DESCRIPTION" environment variable.
Regards, Henrik
Thank you very much. Maybe this should be added to the hobbit-alerts.cfgexplanation for pre-defined environement variables.
On 3/1/07, Henrik Stoerner <henrik at hswn.dk> wrote:
On Thu, Mar 01, 2007 at 08:51:35AM -0500, Geoff Hallford wrote:
Since the DESCR tab doesn't get sent automatically (that I know of) to a custom alert script, what is the easiest way to accomplish obtaining it.
It does, it's in the "$BBH_DESCRIPTION" environment variable.
Regards, Henrik
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
-- 'If my answers frighten you then you should cease asking scary questions.' --Sam Jackson
Hello,
I have found this post on trying to get BB-SAR and LARRD working with Hobbit. http://www.hswn.dk/hobbiton/2005/11/msg00345.html
I have not had much luck and I was wondering if anyone else has been able to get it to work. I am keen on getting SAR reports to be gathered and graphs generated using RRD. Any and all suggestions would be greatly appreciated. I currently have the bb-sar gather sar data, but no RRDs or graphs are to be had. Thanks again!
--neil
I managed to get it working, but it took a fair bit of hacking. I'll take a look at what I did and post it (IIRC, the original script couldn't have worked as coded).
Tom Kauffman NIBCO, Inc
-----Original Message----- From: Camp, Neil D. (ManTech) CTR [mailto:neil.camp.ctr at deca.mil] Sent: Thursday, March 01, 2007 1:53 PM To: hobbit at hswn.dk Subject: [hobbit] BB-SAR LARRD
Hello,
I have found this post on trying to get BB-SAR and LARRD working with Hobbit. http://www.hswn.dk/hobbiton/2005/11/msg00345.html
I have not had much luck and I was wondering if anyone else has been able to get it to work. I am keen on getting SAR reports to be gathered and graphs generated using RRD. Any and all suggestions would be greatly appreciated. I currently have the bb-sar gather sar data, but no RRDs or graphs are to be had. Thanks again!
--neil
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
CONFIDENTIALITY NOTICE: This email and any attachments are for the
exclusive and confidential use of the intended recipient. If you are not
the intended recipient, please do not read, distribute or take action in
reliance upon this message. If you have received this in error, please
notify us immediately by return email and promptly delete this message
and its attachments from your computer system. We do not waive
attorney-client or work product privilege by the transmission of this
message.
Any and all help would be greatly appreciated. I have started to gather the SARs, but I am still struggling with getting into RRD as well as have them show up in graphs. I wish I was a better coder, but alas, I just hack at it.
-----Original Message----- From: Kauffman, Tom [mailto:KauffmanT at nibco.com] Sent: Thursday, March 01, 2007 4:30 PM To: hobbit at hswn.dk Subject: RE: [hobbit] BB-SAR LARRD
I managed to get it working, but it took a fair bit of hacking. I'll take a look at what I did and post it (IIRC, the original script couldn't have worked as coded).
Tom Kauffman NIBCO, Inc
-----Original Message----- From: Camp, Neil D. (ManTech) CTR [mailto:neil.camp.ctr at deca.mil] Sent: Thursday, March 01, 2007 1:53 PM To: hobbit at hswn.dk Subject: [hobbit] BB-SAR LARRD
Hello,
I have found this post on trying to get BB-SAR and LARRD working with Hobbit. http://www.hswn.dk/hobbiton/2005/11/msg00345.html
I have not had much luck and I was wondering if anyone else has been able to get it to work. I am keen on getting SAR reports to be gathered and graphs generated using RRD. Any and all suggestions would be greatly appreciated. I currently have the bb-sar gather sar data, but no RRDs or graphs are to be had. Thanks again!
--neil
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
CONFIDENTIALITY NOTICE: This email and any attachments are for the exclusive and confidential use of the intended recipient. If you are not the intended recipient, please do not read, distribute or take action in
reliance upon this message. If you have received this in error, please
notify us immediately by return email and promptly delete this message
and its attachments from your computer system. We do not waive
attorney-client or work product privilege by the transmission of this
message.
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
Were you able to find the changes that you made?
-----Original Message----- From: Kauffman, Tom [mailto:KauffmanT at nibco.com] Sent: Thursday, March 01, 2007 4:30 PM To: hobbit at hswn.dk Subject: RE: [hobbit] BB-SAR LARRD
I managed to get it working, but it took a fair bit of hacking. I'll take a look at what I did and post it (IIRC, the original script couldn't have worked as coded).
Tom Kauffman NIBCO, Inc
-----Original Message----- From: Camp, Neil D. (ManTech) CTR [mailto:neil.camp.ctr at deca.mil] Sent: Thursday, March 01, 2007 1:53 PM To: hobbit at hswn.dk Subject: [hobbit] BB-SAR LARRD
Hello,
I have found this post on trying to get BB-SAR and LARRD working with Hobbit. http://www.hswn.dk/hobbiton/2005/11/msg00345.html
I have not had much luck and I was wondering if anyone else has been able to get it to work. I am keen on getting SAR reports to be gathered and graphs generated using RRD. Any and all suggestions would be greatly appreciated. I currently have the bb-sar gather sar data, but no RRDs or graphs are to be had. Thanks again!
--neil
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
CONFIDENTIALITY NOTICE: This email and any attachments are for the exclusive and confidential use of the intended recipient. If you are not the intended recipient, please do not read, distribute or take action in
reliance upon this message. If you have received this in error, please
notify us immediately by return email and promptly delete this message
and its attachments from your computer system. We do not waive
attorney-client or work product privilege by the transmission of this
message.
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
participants (4)
-
geoff.hallford@gmail.com
-
henrik@hswn.dk
-
KauffmanT@nibco.com
-
neil.camp.ctr@deca.mil