Has anyone come up with a custom paging script that will only page out certain information?
Sounds like you're asking for smsplus: http://www.trantor.org/theshire/doku.php/alerts
On Jan 3, 2008 7:31 AM, Joshua Krause <forums at triadbiz.rr.com> wrote:
Has anyone come up with a custom paging script that will only page out certain information?
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:gumby3203 at gmail.com] Sent: Thursday, January 03, 2008 11:29 AM To: hobbit at hswn.dk 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 < forums at triadbiz.rr.com> wrote:
Has anyone come up with a custom paging script that will only page out certain information?
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 <forums at triadbiz.rr.com> 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:gumby3203 at gmail.com] *Sent:* Thursday, January 03, 2008 11:29 AM *To:* hobbit at hswn.dk *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 < forums at triadbiz.rr.com> wrote:
Has anyone come up with a custom paging script that will only page out certain information?
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.
Thanks
Josh
From: Gary Baluha [mailto:gumby3203 at gmail.com] Sent: Thursday, January 10, 2008 3:51 PM To: hobbit at hswn.dk 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 <forums at triadbiz.rr.com> 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:gumby3203 at gmail.com] Sent: Thursday, January 03, 2008 11:29 AM To: hobbit at hswn.dk 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 < forums at triadbiz.rr.com> wrote:
Has anyone come up with a custom paging script that will only page out certain information?
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 recipient at mycompany.com DURATION>10m REPEAT=1d
From: Joshua Krause [mailto:forums at triadbiz.rr.com] Sent: Thursday, January 03, 2008 5:32 AM To: hobbit at hswn.dk Subject: [hobbit] custom paging script
Has anyone come up with a custom paging script that will only page out certain information?
participants (3)
-
forums@triadbiz.rr.com
-
gumby3203@gmail.com
-
haertig@avaya.com