cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
780
Views
0
Helpful
1
Replies

LMS 4 customize alert messages

wilson_1234_2
Level 3
Level 3

I see that some customization is possible on some alert messages subject lines but can these things be done?

The message is sort of hard to read with all the lines running into each other.

Also, I would like to see the device and the device and the status first and then the date.

Make this

Subject: 000073I ; 1.2.3.4 ; Wed 02-Feb-2011 08:56:27 EST ; Critical ; Unresponsive ; Active ;

EVENT ID = 000073I

TIME = Wed 02-Feb-2011 08:56:27 EST

STATUS = Active

SEVERITY = Critical

MANAGED OBJECT = 1.2.3.4

MANAGED OBJECT TYPE = Routers

EVENT DESCRIPTION       = Unresponsive::Component=1.2.3.4;ComponentClass=IP;ComponentEventCode=1098;InterfaceType=SOFTWARELOOPBACK;InterfaceMode=NORMAL;InterfaceAdminStatus=UNKNOWN;Address=1.2.3.4;IPStatus=TIMEDOUT;InterfaceOperStatus=UNKNOWN;NetworkNumber=172.1
CUSTOMER IDENTIFICATION = Routers
NOTIFICATION ORIGINATOR = Fault Management Module

Look like this:

Subject: 1.2.3.4; Critical ; Unresponsive ; Active ; Wed 02-Feb-2011 08:56:27 EST

EVENT ID = 000073I

TIME = Wed 02-Feb-2011 08:56:27 EST

STATUS = Active

SEVERITY = Critical

MANAGED OBJECT = 1.2.3.4

MANAGED OBJECT TYPE = Routers

EVENT DESCRIPTION       =

Unresponsive::Component=1.2.3.4
ComponentClass=IP;ComponentEventCode=1098
InterfaceType=SOFTWARELOOPBACK
InterfaceMode=NORMAL
InterfaceAdminStatus=UNKNOWN
Address=1.2.3.4
IPStatus=TIMEDOUT
InterfaceOperStatus=UNKNOWN;NetworkNumber=1.2
CUSTOMER IDENTIFICATION = Routers
NOTIFICATION ORIGINATOR = Fault Management Module

Also make this:

CiscoWorks HUM: Critical: Device Availability Threshold Violation: Availability (My Router)

Look like this

HUM: Critical: (My Router) Device Availability Threshold Violation: Availability

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

No, this type of customization is not possible within LMS.  I know it's not ideal, but what about sending these notifications to a script mailbox first that parses them and converts them to your desired format.  Then that script can bounce the messages to your human mailboxes.  The messages would be easy to parse using Perl.  For the Faul notifications, you can tokenize on '=' then ';'.  For example:

my @msg = ;

my %vars;

my $subject;

my @order = ();

foreach my $line (@msg) {

    chomp $line;

    if ($line =~ /^Subject: (.*)/) {

        $subject = $1;

        next;

    }

    ($name, $value) = split(/\s+=\s+/, $line);

    $vars{$name} = $value;

    push @order, $name;

}

my ($eid, $ip, $date, $severity, $name, $status) = split(/\s*;\s*/, $subject);

my $new_msg = "From: addr@company.com\n";

$new_msg .= "To: addr@company.com\n";

$new_msg .= "Subject: $ip ; $severity ; $name ; $status ; $date\n\n";

my @eparts = split(/\s*;\s*/, $vars{'EVENT DESCRIPTION'});

$vars{'EVENT DESCRIPTION'} = "\n" . join("\n", @eparts);

foreach my $key (@order) {

    $new_msg .= "$key = $vars{$key}\n";

}

sendMail($new_msg);