Alerts with x-priority
Daniel Rich
drich at employees.org
Fri Jul 11 22:58:18 CEST 2003
Dick Moore wrote:
> Hi
>
> I want to modify the host-notify-by-email command such that it gives the email a high priority using the x-priority (yep I know its not rfc complient but my boss really wants it)
>
> I have been fumbling around trying to do this without sucess and wandered if anyone out there had done this.
>
> The idea is that we only forward high priority alerts to blackberry wireless pagers via exchange (wash my mouth out with soap and water)
>
> Any help greatfully accepted
I just tried this on my machine, so you should be able to do it by calling
sendmail directly instead of using /bin/mail. That will allow you to set the
headers.
For example:
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "To: $CONTACTEMAIL$\nSubject: **
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
**\nX-Priority: 1 (Highest)\n\n***** Nagios 1.0 *****\n\nNotification Type:
$NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$
($HOSTNAME$)\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time:
$DATETIME$\n\nAdditional Info:\n\n$OUTPUT$\n\nSee http://netmon.pdi.com/nagios/
for more information." | /usr/lib/sendmail -t
}
BTW, all headers starting with X- are RFC compliant, they just aren't "official".
--
Dan Rich <drich at employees.org> | http://www.employees.org/~drich/
| "Step up to red alert!" "Are you sure, sir?
| It means changing the bulb in the sign..."
| - Red Dwarf (BBC)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/users/attachments/20030711/c89e0700/attachment.sig>
More information about the Users
mailing list