Xymon Mailing List Archive search

Custom paging script

9 messages in this thread

list Josh Krause · Thu, 3 Jan 2008 07:31:08 -0500 ·
Has anyone come up with a custom paging script that will only page out
certain information? 

 
This E-mail and any of its attachments may contain Time Warner
Cable proprietary information, which is privileged, confidential,
or subject to copyright belonging to Time Warner Cable. This E-mail
is intended solely for the use of the individual or entity to which
it is addressed. If you are not the intended recipient of this
E-mail, you are hereby notified that any dissemination,
distribution, copying, or action taken in relation to the contents
of and attachments to this E-mail is strictly prohibited and may be
unlawful. If you have received this E-mail in error, please notify
the sender immediately and permanently delete the original and any
copy of this E-mail and any printout.
list Joshua Krause · Thu, 3 Jan 2008 07:31:38 -0500 ·
Has anyone come up with a custom paging script that will only page out
certain information?
list Bruce White · Thu, 3 Jan 2008 09:53:43 -0600 ·
I have a custom script, but it send out information based on the global
variables available at script runtime.   Check the help documents and see
what is available in the global variables.  

 
   .....Bruce
quoted from Joshua Krause

 
From: Joshua Krause [mailto:user-41d3365fe380@xymon.invalid] 
Sent: Thursday, January 03, 2008 6:32 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] custom paging script

 
Has anyone come up with a custom paging script that will only page out
certain information? 

 

Note: The information contained in this message may be privileged and
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and deleting it from
your computer. Thank you. Fellowes, Inc.
list Gary Baluha · Thu, 3 Jan 2008 11:29:19 -0500 ·
Sounds like you're asking for smsplus:
http://www.trantor.org/theshire/doku.php/alerts
quoted from Joshua Krause

On Jan 3, 2008 7:31 AM, Joshua Krause <user-41d3365fe380@xymon.invalid> wrote:
 Has anyone come up with a custom paging script that will only page out
certain information?

list Dave Haertig · Thu, 3 Jan 2008 11:15:38 -0700 ·
Here's what I use for short, concise alerts:
 
#!/bin/perl
# RCS $Id: brief_alert,v 1.2 2007/06/09 18:09:39 hobbit Exp $
use strict;
my $Subject = "Hobbit Alert! \u$ENV{BBCOLORLEVEL} light :
$ENV{BBSVCNAME} : $ENV{BBHOSTNAME}";
my $Body = "Hobbit Monitoring Alert!\n\nA \u$ENV{BBCOLORLEVEL} light
condition has been detected for SERVICE=$ENV{BBSVCNAME} on
HOST=$ENV{BBHOSTNAME}";
SendMail($Subject, $Body);
sub SendMail {
        my($Subject, $Body) = @_;
        open( MAIL, '| /usr/lib/sendmail -F "Hobbit" -t');
        print MAIL  "To: $ENV{RCPT}\n";
        print MAIL  "Subject: $Subject\n\n" if defined $Subject;
        print MAIL  "$Body\n" if defined $Body;
        close(MAIL);
}

Called like this (example) from hobbit-alerts.cfg:
 
$BRIEF_ALERT=/development/hobbit/server/ext/brief_alert
HOST=servername SERVICE=http COLOR=red
        SCRIPT $BRIEF_ALERT user-5e6ae95f74f9@xymon.invalid DURATION>10m
REPEAT=1d
quoted from Joshua Krause


From: Joshua Krause [mailto:user-41d3365fe380@xymon.invalid] 
Sent: Thursday, January 03, 2008 5:32 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: [hobbit] custom paging script


Has anyone come up with a custom paging script that will only page out
certain information?
list Gräub Roland · Fri, 4 Jan 2008 14:28:45 +0100 ·
Hello
 
In the file hobbitclient-sunos.sh the FSTYPES entry can lost filesystems with long mountpoints.
 
Happen here with vxfs filesystem;
 
$/bin/df -n -l
/                  : ufs
/devices           : devfs
/system/contract   : ctfs
/proc              : proc
/dev/vx/rdmp       : tmpfs
/unshared/AA04/oracle: vxfs
/unshared/AA04/oracle/data1: vxfs
/unshared/AA04/oracle/data2: vxfs
/unshared/AA04/oracle/data3: vxfs

with the awk '{print $3}' command in FSTYPES the vxfs ist missed because there is no space.
 
Solution for us; adding seperator to awk -F":" '{print $2}'
 
Regards
Roland
list Joshua Krause · Thu, 10 Jan 2008 15:31:11 -0500 ·
I noticed your script sends out a page with a yellow and red response.  But
how would you go about tweaking it to be able to send the recovery message
also.

 
Thanks,

 
Josh
quoted from Gary Baluha

 
From: Gary Baluha [mailto:user-ae3e15c22de1@xymon.invalid] 
Sent: Thursday, January 03, 2008 11:29 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] custom paging script

 
Sounds like you're asking for smsplus:
http://www.trantor.org/theshire/doku.php/alerts

On Jan 3, 2008 7:31 AM, Joshua Krause < user-41d3365fe380@xymon.invalid> wrote:

Has anyone come up with a custom paging script that will only page out
certain information?
list Gary Baluha · Thu, 10 Jan 2008 15:51:18 -0500 ·
Actually, it will send out pages for that as well, since the actual paging
is still controlled by hobbit-alerts.cfg.  The part where it is grep'ing for
red and yellow is just to get the particular item in a non-green state.  For
instance, if you are monitoring 10 processes on a machine, instead of
showing ALL processes, including the green ones, only the ones in a
non-green state will show up with this script.  It's actually looking for
"&yellow" or "&red".

The error message will look like:
Subject = !HB [12345]
Body = machine.procs red
&red someproc (found 0, req. 1 or more)

And the recovery messages will look something like this:
Subject = !HB [-1]
Body = machine.procs red

If you wanted to use something else instead of "-1" to indicate recovery,
you could add something like the following in place of the msg=<blah> lines:
if [ ${ACKCODE} -eq "-1" ] then; msg="Recovered";
else msg=` <blah>`; msg="\n${msg}";
done
quoted from Joshua Krause


On Jan 10, 2008 3:31 PM, Joshua Krause <user-41d3365fe380@xymon.invalid> wrote:
 I noticed your script sends out a page with a yellow and red response.
But how would you go about tweaking it to be able to send the recovery
message also.


Thanks,


Josh


*From:* Gary Baluha [mailto:user-ae3e15c22de1@xymon.invalid]
*Sent:* Thursday, January 03, 2008 11:29 AM
*To:* user-ae9b8668bcde@xymon.invalid
*Subject:* Re: [hobbit] custom paging script


Sounds like you're asking for smsplus:
http://www.trantor.org/theshire/doku.php/alerts

On Jan 3, 2008 7:31 AM, Joshua Krause < user-41d3365fe380@xymon.invalid> wrote:

Has anyone come up with a custom paging script that will only page out
certain information?

list Joshua Krause · Thu, 10 Jan 2008 16:18:23 -0500 ·
This is what my hobbit-alerts.cfg looks like.

 
#HOST=%gsonc-.*-mod-* SERVICE=conn,file COLOR=yellow,red

#       MAIL $ENGPAGE REPEAT=60 RECOVERED

 
#HOST=gsonc-spg-dncs SERVICE=conn,files COLOR=yellow,red

#       MAIL $ENGPAGE REPEAT=60 RECOVERED

 
#HOST=%gsonc-.*-4948-* SERVICE=conn,trap COLOR=yellow,red

#       MAIL $ENGPAGE REPEAT=60 RECOVERED

 
#HOST=%gsonc-.*-2950-* SERVICE=conn,trap COLOR=yellow,red

#       MAIL $ENGPAGE FORMAT=SMS REPEAT=60 RECOVERED

 
HOST=* SERVICE=* EXSERVICE=msgs COLOR=yellow,red

        MAIL $ENGMAIL REPEAT=1d RECOVERED

        SCRIPT /opt/hobbit/server/ext/smsplus.sh $ENGPAGE RECOVERED

#       MAIL $ENGPAGE FORMAT=SMS REPEAT=1d RECOVERED

 
And I am not getting anything when a recovery happens, at least on my
if_stat column.  That is the only thing that is going up and down at the
moment.
quoted from Gary Baluha

 
Thanks

Josh

 
From: Gary Baluha [mailto:user-ae3e15c22de1@xymon.invalid] 
Sent: Thursday, January 10, 2008 3:51 PM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] custom paging script

 
Actually, it will send out pages for that as well, since the actual paging
is still controlled by hobbit-alerts.cfg.  The part where it is grep'ing for
red and yellow is just to get the particular item in a non-green state.  For
instance, if you are monitoring 10 processes on a machine, instead of
showing ALL processes, including the green ones, only the ones in a
non-green state will show up with this script.  It's actually looking for
"&yellow" or "&red". 

The error message will look like:
Subject = !HB [12345]
Body = machine.procs red
&red someproc (found 0, req. 1 or more)

And the recovery messages will look something like this:
Subject = !HB [-1] 
Body = machine.procs red

If you wanted to use something else instead of "-1" to indicate recovery,
you could add something like the following in place of the msg=<blah> lines:
if [ ${ACKCODE} -eq "-1" ] then; msg="Recovered"; 
else msg=` <blah>`; msg="\n${msg}";
done


On Jan 10, 2008 3:31 PM, Joshua Krause <user-41d3365fe380@xymon.invalid> wrote:

I noticed your script sends out a page with a yellow and red response.  But
how would you go about tweaking it to be able to send the recovery message
also.

 
Thanks,

 
Josh

 
From: Gary Baluha [mailto:user-ae3e15c22de1@xymon.invalid] 
Sent: Thursday, January 03, 2008 11:29 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] custom paging script

 
Sounds like you're asking for smsplus:
http://www.trantor.org/theshire/doku.php/alerts

On Jan 3, 2008 7:31 AM, Joshua Krause < user-41d3365fe380@xymon.invalid> wrote:

Has anyone come up with a custom paging script that will only page out
certain information?