Page 1 of 1

Operations Screen process only critical alerts

Posted: Fri Dec 15, 2017 1:40 pm
by rjmon
I created a user for command center, not an admin. THen i created a service template and added the command center user to it. Sending this alerts to Operations screen for the command center folks to monitor. I am trying to send only critical not warnings. Is it possible to send only critical not other alerts to the operations screen.

Re: Operations Screen process only critical alerts

Posted: Fri Dec 15, 2017 1:57 pm
by dwhitfield
You can't do that on the Operations Screen. Have you tried the Operations Center?

Re: Operations Screen process only critical alerts

Posted: Fri Dec 15, 2017 2:09 pm
by npolovenko
@rjmon, You could tweak the source code. Disclaimer: You'd be doing this at your own risk as this hasn't really been tested, obviously.

Open this file:

Code: Select all

nano /usr/local/nagiosxi/html/includes/components/opscreen/merlin.php
And change this:

Code: Select all

<?php
        $save = "";
        while ($row = mysql_fetch_array($result)) {
            $class = "";
            if ($row['current_state'] == 2) {
                $class = "critical";
            } elseif ($row['current_state'] == 1) {
                $class = "warning";
            } else {
                $class = "unknown";
            }
            ?>
To this:

Code: Select all

<?php
        $save = "";
        while ($row = mysql_fetch_array($result)) {
            $class = "";
            if ($row['current_state'] == 2) {
                $class = "critical";
            } elseif ($row['current_state'] == 1) {
                $class = "unknown";
            } else {
                $class = "unknown";
            }
            ?>
Save and exit. Next, open:

Code: Select all

nano /usr/local/nagiosxi/html/includes/components/opscreen/opscreen.php
Find this:

Code: Select all

 .unknown {
        background: -moz-linear-gradient(top center, #FFC45F 50%, #FFC45F 50%);
    }
And replace it with:

Code: Select all

 .unknown {
        background: -moz-linear-gradient(top center, #FFC45F 50%, #FFC45F 50%);
        display: none !important;
    }

Re: Operations Screen process only critical alerts

Posted: Fri Dec 15, 2017 2:43 pm
by rjmon
@npolovenko Thanks. It works but it applies to every role.. Admin cannot see warning alerts. I will use this method for now.

Re: Operations Screen process only critical alerts

Posted: Fri Dec 15, 2017 2:46 pm
by rjmon
dwhitfield wrote:You can't do that on the Operations Screen. Have you tried the Operations Center?
Thanks. I have`nt tried to filter in operations center yet. I will try it and let you know.

Re: Operations Screen process only critical alerts

Posted: Fri Dec 15, 2017 3:14 pm
by dwhitfield
One thing to note about the changes @npolovenko suggested: these will be overwritten on upgrade, so make sure you have a backup and add restoring to the changes to your upgrade process.