Xymon Mailing List Archive search

DESCR Info in Alerts

10 messages in this thread

list Geoff Hallford · Wed, 24 Jan 2007 08:58:02 -0500 ·
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.
list Henrik Størner · Wed, 24 Jan 2007 23:09:57 +0100 ·
quoted from Geoff Hallford
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
list Geoff Hallford · Wed, 24 Jan 2007 21:04:05 -0500 ·
Thank you. Will do.
quoted from Henrik Størner

On 1/24/07, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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

-- 

'If my answers frighten you then you should cease asking scary questions.'
--Sam Jackson
list Geoff Hallford · Thu, 1 Mar 2007 08:51:35 -0500 ·
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="$STRING`mkstring $DAY DAY`"
  STRING="$STRING`mkstring $HOUR HOUR`"
  STRING="$STRING`mkstring $MINUTE MIN`"
  STRING="$STRING`mkstring $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
quoted from Geoff Hallford


On 1/24/07, Geoff Hallford <user-dc9e7f30b1e2@xymon.invalid> wrote:
Thank you. Will do.

On 1/24/07, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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

--
'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
list Henrik Størner · Thu, 1 Mar 2007 15:35:50 +0100 ·
quoted from Geoff Hallford
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
list Geoff Hallford · Thu, 1 Mar 2007 11:58:20 -0500 ·
Thank you very much. Maybe this should be added to the
hobbit-alerts.cfgexplanation for pre-defined environement variables.
quoted from Henrik Størner


On 3/1/07, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> 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

-- 
'If my answers frighten you then you should cease asking scary questions.'
--Sam Jackson
list Neil D. ManTech Ctr Camp · Thu, 1 Mar 2007 13:53:13 -0500 ·
 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
list Tom Kauffman · Thu, 1 Mar 2007 16:30:09 -0500 ·
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
quoted from Neil D. ManTech Ctr Camp

-----Original Message-----
From: Camp, Neil D. (ManTech) CTR [mailto:user-3fcfcd65045e@xymon.invalid] Sent: Thursday, March 01, 2007 1:53 PM
To: user-ae9b8668bcde@xymon.invalid
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


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.
list Neil D. ManTech Ctr Camp · Fri, 2 Mar 2007 08:46:15 -0500 ·
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. 
quoted from Tom Kauffman

-----Original Message-----
From: Kauffman, Tom [mailto:user-3feba9e60a8b@xymon.invalid] 
Sent: Thursday, March 01, 2007 4:30 PM
To: user-ae9b8668bcde@xymon.invalid
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:user-3fcfcd65045e@xymon.invalid] 
Sent: Thursday, March 01, 2007 1:53 PM
To: user-ae9b8668bcde@xymon.invalid
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


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.
list Neil D. ManTech Ctr Camp · Tue, 6 Mar 2007 06:58:54 -0500 ·
Were you able to find the changes that you made? 
quoted from Neil D. ManTech Ctr Camp
-----Original Message-----
From: Kauffman, Tom [mailto:user-3feba9e60a8b@xymon.invalid] Sent: Thursday, March 01, 2007 4:30 PM
To: user-ae9b8668bcde@xymon.invalid
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:user-3fcfcd65045e@xymon.invalid] Sent: Thursday, March 01, 2007 1:53 PM
To: user-ae9b8668bcde@xymon.invalid
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


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.