[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [hobbit] FW: Hobbit [85409] itlab02.metsi.com:svcs CRITICAL (RED)
- To: <hobbit (at) hswn.dk>
- Subject: RE: [hobbit] FW: Hobbit [85409] itlab02.metsi.com:svcs CRITICAL (RED)
- From: "Haertig, David F (Dave)" <haertig (at) avaya.com>
- Date: Mon, 10 Sep 2007 11:16:15 -0600
- References: <29D40A034DC4994BA998814958B6E3BC498C62 (at) emailsvr01.metsi.com> <46E558F7.60602 (at) yahoo.fr>
- Thread-index: AcfzueXj+imsPEc1R/eksodjpWqJzAAEndDw
- Thread-topic: [hobbit] FW: Hobbit [85409] itlab02.metsi.com:svcs CRITICAL (RED)
You can write your own custom script and call it via SCRIPT instead of MAIL in the hobbit-alerts.cfg file. Or use my script cut/pasted below. I have lots of custom Hobbit tests that produce quite verbose webpages, but I don't want all that verbosity in the email alerts. The email recipients know to go to the website to view the details if needed.
/hobbit/server/ext/brief_alert script below. You can just change the $Subject and $Body variables to say what you'd like (or even delete $Body totally).
--- cut here ---
#!/bin/perl
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);
}
--- cut here ---
And here's how I invoke it in the alerts file (/hobbit/server/etc/hobbit-alerts.cfg):
--- cut here ---
$BRIEF_ALERT=/hobbit/server/ext/brief_alert
$TERMINAL_SERVERS_US=(ts1|ts2|ts3)
$IT_TEAM=person1 (at) mydomain.com,person2 (at) mydomain.com
HOST=%$TERMINAL_SERVERS_US SERVICE=conn COLOR=red DURATION>10m
SCRIPT $BRIEF_ALERT $IT_TEAM REPEAT=2h
--- cut here ---
-----Original Message-----
From: pkc_mls [mailto:pkc_mls (at) yahoo.fr]
Sent: Monday, September 10, 2007 8:47 AM
To: hobbit (at) hswn.dk
Subject: Re: [hobbit] FW: Hobbit [85409] itlab02.metsi.com:svcs CRITICAL (RED)
Nikesh Maharaj a écrit :
> HI,
>
> My alerts send me the following. Is there any way I can change this
> just to send me the "service" that is not ok?
>
>
hello,
this is the standard format.
the code is available, so you can have hobbit send you exactly the message you wish.
sure for the first time you think you have too much informations in this mail, but in the future perhaps you'll be happy all those infos are in the mail.
if you simply need to know which service is not ok, just browse to the hobbit "non green view" in your browser.
> -----Original Message-----
> From: hobbit (at) fedora.metsi.com [mailto:hobbit (at) fedora.metsi.com]
> Sent: 10 September 2007 04:16 PM
> To: IT Support
> Subject: Hobbit [85409] itlab02.metsi.com:svcs CRITICAL (RED)
>
> red Mon Sep 10 16:15:54 SAST 2007 Services Not OK
>
> &red Print Spooler - Stopped
> &green Big Brother SNM Client 1.08d - Running
>
>
> To unsubscribe from the hobbit list, send an e-mail to
> hobbit-unsubscribe (at) hswn.dk
>
>
>
>
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe (at) hswn.dk