02-02-2011 06:21 AM
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
02-12-2011 05:43 PM
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);
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide