Email Notifications Marked as High Importance

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Email Notifications Marked as High Importance

Post by jkinning »

When I receive email notifications from Nagios for Warnings and Critical Host/Services the email message is marked as High Importance. Is there a way to change that so only Critical events are marked that way? I have a rule setup for Nagios messages to get dropped to a Nagios folder within Outlook and it would be nice to just look at the High Importance red ! ones first but the way it is now they all are marked that way.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Email Notifications Marked as High Importance

Post by lmiltchev »

You will be able to enable/disable the "high priority" emails in the next release of XI. For the time being, you could try modifying the "/usr/local/nagiosxi/html/includes/utils-email.inc.php" file (after line 90).
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Email Notifications Marked as High Importance

Post by jkinning »

I am not sure what I would add or modify within that code. :( Is there a guesstimate on the next release date?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Email Notifications Marked as High Importance

Post by tmcdonald »

I don't have an exact date, but looking at our usual release cycle and taking into consideration some testing tasks we have gotten recently, it can't be too far off. A few months, it's going to be a fairly major release.
Former Nagios employee
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Email Notifications Marked as High Importance

Post by jkinning »

OK. WIll this be the one that has Active Directory integration for users? :D The one where no local accounts will be necessary?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Email Notifications Marked as High Importance

Post by lmiltchev »

Local users are necessary, but will be able to be automatically imported and synced with AD.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Email Notifications Marked as High Importance

Post by jkinning »

lmiltchev wrote:You will be able to enable/disable the "high priority" emails in the next release of XI. For the time being, you could try modifying the "/usr/local/nagiosxi/html/includes/utils-email.inc.php" file (after line 90).
I don't want to foobar our system so what would I need to modify within that PHP file?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Email Notifications Marked as High Importance

Post by lmiltchev »

You can try commenting out the whole section (dont' delete anything), so it is going to look like this:

// if (isset($opts["type"]) && $opts["type"] == "PROBLEM") {
// 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");
// }

Let me know if this helped.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Email Notifications Marked as High Importance

Post by jkinning »

This removed the ! Important identifier for all the email messages. I was looking to have the ! Important for just Critical messages and not the Warnings.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Email Notifications Marked as High Importance

Post by ssax »

You could try changing it to:

Code: Select all

    if (strpos($mail->Subject, 'CRITICAL')) {
        // 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");
    }
Locked