Server Management - Systems Insight Manager
1834048 Members
2118 Online
110063 Solutions
New Discussion

Re: send more verbose email alerts

 
SOLVED
Go to solution
Rick Garland
Honored Contributor

send more verbose email alerts

Hi all:

Got HPSIM 4.2 update 1 installed and running on a CMS of HPUX 11.11 .

I am able to setup and integrate pages from the SIM to our paging software. However, I cannot get the messages to state the issue as to why the alert.

Example, on an HP 9000 system I have an EMS alert for disk space setup. Send a SNMP trap to the CMS as a critical.
In SIM I have created a custom command that specifies the executable to run, the parameters to pass, and in the executable I specify the %1 and %2. Automatic Event Handling is configured also.

My message is "a critical event on %1 with severity of %2..."

The %1 and %2 are %DEVICENAME% and %NOTICESEVERITYSTR% respectively. But the emails and pages are not passing these variables through.

Any idea why?



When the critical condition is met
4 REPLIES 4
Rob Buxton
Honored Contributor

Re: send more verbose email alerts

I've not tried it that way.
I tend to use perl and just run a perl script.

With the "use env;" line I can then read all of the variables that HPSIM will send through by default. The two you mention would be included.

Rick Garland
Honored Contributor

Re: send more verbose email alerts

Rob:

Got a sample I can look at?

Thanks
Rob Buxton
Honored Contributor
Solution

Re: send more verbose email alerts

The following is a tad simplistic but would get you started.
Opens a file, writes the contents of the $Noticeplaintext variable to a file. Then uses the SMTP Utility blat to send it.
I've hacked a bit of stuff out so it might not work as is.

use Env;

open MAILDIST, '<>
open MAILTMP, '>mailmajor.tmp';
print MAILTMP "$NOTICEPLAINTEXT";
close MAILTMP;

$MailUser='joe.bloggs@myco.com';

system "blat mailmajor.tmp -to \"$MailUser\" -subject \"Major Event Detected \" \n";

unlink 'mailmajor.tmp';
close MAILDIST;

exit;
Rick Garland
Honored Contributor

Re: send more verbose email alerts

Thanks Rob