Operations Screen process only critical alerts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rjmon
Posts: 106
Joined: Wed Dec 06, 2017 11:39 am

Operations Screen process only critical alerts

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Operations Screen process only critical alerts

Post by dwhitfield »

You can't do that on the Operations Screen. Have you tried the Operations Center?
npolovenko
Support Tech
Posts: 3457
Joined: Mon May 15, 2017 5:00 pm

Re: Operations Screen process only critical alerts

Post 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;
    }
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rjmon
Posts: 106
Joined: Wed Dec 06, 2017 11:39 am

Re: Operations Screen process only critical alerts

Post by rjmon »

@npolovenko Thanks. It works but it applies to every role.. Admin cannot see warning alerts. I will use this method for now.
rjmon
Posts: 106
Joined: Wed Dec 06, 2017 11:39 am

Re: Operations Screen process only critical alerts

Post 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.
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Operations Screen process only critical alerts

Post 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.
Locked