1751854 Members
5296 Online
108782 Solutions
New Discussion юеВ

EMS on HP-UX 11

 
SOLVED
Go to solution
thewho?
Frequent Advisor

EMS on HP-UX 11

Hello everybody,
Is there any way to 'customize' the mails send by EMS?
I configure EMS to send an e-mail to my pager when the severity >= MAJOR WARNING, but my pager only accepts very short messages (250bytes) and I can't see what was the severity. Of course, I have a full copy of the message on my regular e-mail account, but I'd like to be able to tell how critical the message is without having to login.
TIA,
Luis
We'll get through this together.
5 REPLIES 5
Steven Sim Kok Leong
Honored Contributor

Re: EMS on HP-UX 11

Hi,

One way would be go get EMS send the emails to a specific local account. In your local mailbox, use mail filtering mechanisms (such as elm filters or simply the .forward file) to pipe your any new EMS mails to a script which trims the new mail and pipe it to your paging software.

Another way is to make use of /var/adm/syslog/syslog.log. Use a script to check for new EMS entries, grep for errors and pipe it to your paging software.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
thewho?
Frequent Advisor

Re: EMS on HP-UX 11

Thanks for the reply Steven,
I suspected those were my choices, but I didn't know if setting 'rules' on my unix mailbox was possible. I'll read the elm man pages to see if they show me how to run a script when a message arrives.
Thanks.
We'll get through this together.
Steven Sim Kok Leong
Honored Contributor
Solution

Re: EMS on HP-UX 11

Hi,

Using ~/.forward, a user can put a file with the name .forward in his home directory. If this file exists, sendmail redirects mail for that user to the list of recipients in the .forward file. Programs and files are valid recipients eg. in your ~/.forward

abc@company.com
/var/tmp/mail.log
|/usr/local/bin/pagescript

You can pipe your mails to the pagescript for processing and subsequently alerting via paging. man sendmail for further details.

As for elm, you need to use ~/.elm/filter-rules eg.

if (to = BUGTRAQ@NETSPACE.ORG) then save ~/mail/bugtraq
if (from = "root") then execute /home/tracker/pagescript

If you have installed elm from the source tarball, for further information, you can look at /usr/local/doc/elm/Filter.guide (ascii version) or /usr/local/doc/elm/Filter.ps (postscript version).

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
thewho?
Frequent Advisor

Re: EMS on HP-UX 11

Steven,
This works great! Thanks for your advise. One more question, I'm defining the ~root/.forward as:

|/u1/scripts/rules.sh
root

IOW, I want to keep the root's mail unaffected by this new procedure, according to the documentation (man 5 aliases): "this will not cause loops, since no message will be sent to any person more than once" and it seems to be true, can you confirm this?
Thanks,
Luis
We'll get through this together.
Steven Sim Kok Leong
Honored Contributor

Re: EMS on HP-UX 11

Hi,

Unless you are using both NIS and local aliases, you should not be facing any alias looping issues.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com