Send CRITICAL emails marked High Importance

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Send CRITICAL emails marked High Importance

Post 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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Send CRITICAL emails marked High Importance

Post by abrist »

Possibly. I presume you are sending mail with the XI notification handlers and not the core contact notify handlers?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Send CRITICAL emails marked High Importance

Post by questrad »

Yes, I use XI notification handler.
/usr/local/nagiosxi/scripts/handle_nagioscore_notification.php
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Send CRITICAL emails marked High Importance

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Send CRITICAL emails marked High Importance

Post 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 :)
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Send CRITICAL emails marked High Importance

Post 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.
Former Nagios employee
questrad
Posts: 160
Joined: Wed Mar 21, 2012 3:08 pm
Location: Toronto
Contact:

Re: Send CRITICAL emails marked High Importance

Post by questrad »

Thanks
Locked