Page 1 of 1
Send CRITICAL emails marked High Importance
Posted: Tue Jan 20, 2015 9:37 pm
by questrad
Hello All,
I have just simple question - it is way to send CRITICAL emails in Nagios XI using nagiosxi email notification with "High Importance" tag?
Something like this:
Code: Select all
<?php
$headers = "MIME-Version: 1.0\n" ;
$headers .= "Content-Type: text/html; charset=\"iso-8859-1\"\n";
$headers .= "X-Priority: 1 (Highest)\n";
$headers .= "X-MSMail-Priority: High\n";
$headers .= "Importance: High\n";
$status = mail($to, $subject, $message,$headers);
?>
Thanks
Re: Send CRITICAL emails marked High Importance
Posted: Wed Jan 21, 2015 3:03 pm
by abrist
Possibly. I presume you are sending mail with the XI notification handlers and not the core contact notify handlers?
Re: Send CRITICAL emails marked High Importance
Posted: Wed Jan 21, 2015 4:38 pm
by questrad
Yes, I use XI notification handler.
/usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
Re: Send CRITICAL emails marked High Importance
Posted: Wed Jan 21, 2015 5:40 pm
by abrist
Well, XI uses phpmailer, not the standard php mail. This is a decent feature request, but here is the hack:
Edit:
/usr/local/nagiosxi/html/includes/utils-email.inc.php
Add the following code on line 90 right after
$mail->IsHTML(true); :
Code: Select all
// For most clients expecting the Priority header:
// 1 = High, 2 = Medium, 3 = Low
$mail->Priority = 1;
// MS Outlook custom header
// May set to "Urgent" or "Highest" rather than "High"
$mail->AddCustomHeader("X-MSMail-Priority: High");
// Not sure if Priority will also set the Importance header:
$mail->AddCustomHeader("Importance: High");
EDIT: Crap, This does not check for critical.
Re: Send CRITICAL emails marked High Importance
Posted: Wed Jan 21, 2015 6:36 pm
by questrad
Yes, and I think there must be some additional parameters which will tell to /usr/local/nagiosxi/scripts/handle_nagioscore_notification.php to send CRITICAL as High Priority or no, and based on that the script should handle it

Re: Send CRITICAL emails marked High Importance
Posted: Thu Jan 22, 2015 10:55 am
by tmcdonald
I will put in a feature request for this since it's going to take more than a few forum posts to hammer out.
If it is something you need done by a certain date, you can request custom development by speaking to our Sales department at
[email protected].
Edit: Feature request 4953 entered internally.
Re: Send CRITICAL emails marked High Importance
Posted: Thu Jan 22, 2015 12:04 pm
by questrad
Thanks