Server Management - Systems Insight Manager
1820069 Members
2406 Online
109608 Solutions
New Discussion юеВ

Custome Email Subject for events

 
Jim Holland
New Member

Custome Email Subject for events

I am attempting to create a standard Subject line for event notification emails to be distributed via another application to a set schedule of different individuals based on the day of the week. Essentially I need the subject to stay consistent regardless of what server is reporting the error, seeing as the server name is included in the content of the message body. I cannot find a way to do this, any ideas would be most helpful.

Sincerley,
Jim
5 REPLIES 5
Scott Shaffer
Esteemed Contributor

Re: Custome Email Subject for events

You can configure a portion of the subject line to be the same (just set it during the Automatic Event Handling task creation) but part of it will always be the title of the event that triggered the email.

If this doesn't work for you, you could process the email entirely yourself using a custom command (application launch renamed) that runs your own script to create an email containing exactlye what you want. Refer to the help on Custom Commands to see how to do this.
Dude, we've been totally misled by our album covers!
Rob Buxton
Honored Contributor

Re: Custome Email Subject for events

You could do it using the Custom Command option and using something like perl to format the message.

IM passes a number of variables to any script it calls. You can then format this and do what you want.
I use blat as my SMTP Mailer.

Something like:
#Perl Script

use Env;
open MAILTMP, '>mailfile.tmp';
print MAILTMP "$NOTICEPLAINTEXT";
close MAILTMP;

system 'blat mailfile.tmp - to "phredd@mycompany.co.nz" -subject "Server Outage Detected "';

unlink 'mailfile.tmp';

exit;

Jim Holland
New Member

Re: Custome Email Subject for events

I attempted the custom command; I actually generated a custom exe from Winbatch to distribute an email via internal services of winbatch and SMTP on M.S. W2K3.
Example.
NAME = Environment("%DEVICENAME%")
DATE = Timedate( )

text = "A CRITICAL EVENT OCCURED FOR SERVER %NAME% ON %DATE%, PLEASE INVESTIGATE AS SOON AS POSSIBLE"

AddExtender("WWPST34I.DLL")
host="EXCHSERVER.domain.com"
fromaddr="fromaddress@domain.com"
userid=""
password=""
port=""
tolist="distribution@domain.com"
cclist=""
bcclist=""
subject="CRITICAL EVENT NOTIFICATION FROM HPSIM"
msg="%text%"
attachments=""
flags="1"
kInit(host,fromaddr,userid,password,port)
kDest(tolist,cclist,bcclist)
kSendText(subject,msg,attachments,flags)
EXIT

The problem that arises from this configuration is that it seems I need to install OPENSSH on all servers in the environment to make it run correctly, I was assuming it should run the exe locally versus remotely via openssh. I receive a MX_DTF error whenever I have tested it... I will try your example, and let you know how it goes. Thanks for the responses everyone. :)
Colin Weaver
Frequent Advisor

Re: Custome Email Subject for events

Is there any way of adding a similar (but shorter) set piece of text to all pager messages?
Rob Buxton
Honored Contributor

Re: Custome Email Subject for events

By default the Custom Command will run on the CMS Server.
Not sure why you're getting the error.
I had all kinds of problems with OpenSSH. My workaround is to change the Run As on the Event Notification that calls the Command to use the account IM was installed in.

But I don't understand why you're getting the error you are.

I can generate an e-mail using the Custom Command from a Notification task. It calls perl directly and runs the script. But it does log into itself with OpenSSH to run the Command.