alvarow
Contributor
Contributor

customize alert email

Hello,

in order to get SMS working, I need to send the email with only the phone number on the subject. Another constraint, is the char limit (140) of the email body.

Any ideas of how to get that working?

example:

Subject: 555133262005

Oracle database is down.
0 Kudos
4 Replies
john_hyperic
Hot Shot
Hot Shot

There is no way currently to edit the alert notification subject the way you want. The subject is "[HQ] !!! - ResourceName AlertName". The number of "!" is determined by the alert severity. You can edit the resource name and the alert name which will have some impact on the subject line, but you would not be able to make it be just a phone number.

There is a bug logged for this issue here:

http://jira.hyperic.com/browse/HHQ-183

Please add comments about SMS formatting that would make the alert notifications better.
0 Kudos
admin
Immortal
Immortal

If you would like to take the plunge and modify the code yourself,
it's really quite simple. The email is generated in
org.hyperic.hq.bizapp.server.action.email.EmailAction. You just have
to modify createSubject() and createText() methods to get the email
alert to be formatted the way you want.

We do plan on enhancing the alerting for SMS and for customization in
the future. However, at the present time, we do not have a release
date for that.

Charles

alvarow
Contributor
Contributor

oh no, this is a show stopper for me.

I will investigate if it is easier to modify the email code or get nagios running.

Thanks!
0 Kudos
john_hyperic
Hot Shot
Hot Shot

If this is a big problem, you could achieve the functionality you need by using tools outside HQ. For instance, a small perl script could easily parse and reformat an alert email then send the modified alert notification to the SMS address. All that would be required is a little knowledge about perl and maybe procmail (assuming you are on Linux, of course).