nagios audible alert

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

nagios audible alert

Post by benhank »

i want to configure xi 2012 1.6 to not only pop up an alert on the ops screen but to make some sort of sound too.

This will allow an operator to hear the alert even if their attention is somewhere else (coughzzzzzcough) . I got the idea from watching the mntos video.
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios audible alert

Post by slansing »

This has been integrated with Nagios Core but not XI. You may be able to out of the box, or with a little bit of modification, this is the one that I had set up a few months ago:

http://code.google.com/p/nagioschecker/
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nagios audible alert

Post by benhank »

thanks man! i will let you know how it went. how does core do it?
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios audible alert

Post by slansing »

It reads the status.cgi as linked through your Nagios system's web address and alerts you based on changes within the cgi, I am going to try to configure it today as well.
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nagios audible alert

Post by benhank »

I have no clue how to make this happen bro, you can close the thread unless you want me to test what you come up with .
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: nagios audible alert

Post by slansing »

I was able to configure it by following along in it's GUI.

Click Add new.. then create a name for the server, Click on Nagios Web Interface tab, add the address as they have an example of below, enter username and password to the XI server "I used the nagiosadmin account."

Click the status script URL and point to the status.cgi page as is shown as an example on the page. Then save that and set up filtering, display, behavior, sounds, and advanced settings tabs. Once complete enable the saved server from the Nagios Checker main page list.
cellact
Posts: 69
Joined: Mon May 14, 2012 7:00 am

Re: nagios audible alert

Post by cellact »

I achieved this with XI by editing the merlin.php file that is used by opscreen.php (/usr/local/nagiosxi/html/includes/components/opscreen)
I added a new query to count services in warning/critical state, then set a cookie with that count and check it against the last ran query count.
The page auto refreshes every 10 seconds so that's when you'll get an alert.
I only managed to get it work with Firefox (and iceweasel on a RaspberryPi) and with ogg audio files.

Code: Select all

			$query="SELECT count(*) as total from nagios_servicestatus WHERE current_state!=0 and current_state!=3 and last_hard_state!=0";
            $result = mysql_query($query);
            $row = mysql_fetch_array($result);
            $services_down_notify = $row[0];
			
			$nowServicesDown = $services_down_notify;
			if (isset($_COOKIE['rowsservices'])) {
				$prevServicesDown = $_COOKIE['rowsservices'];
				if ($prevServicesDown < $nowServicesDown) {
					echo '<object data="notification.ogg" autostart="true" hidden="true" loop="false">';
				}
				else {echo '';}
			}
			setcookie('rowsservices', $nowServicesDown, time()+1800);
User avatar
benhank
Posts: 1264
Joined: Tue Apr 12, 2011 12:29 pm

Re: nagios audible alert

Post by benhank »

stupid explorer... this would be an awesome feature for a future release. stupid explorer...
Proudly running:
NagiosXI 5.4.12 2 node Prod Env 2500 hosts, 13,000 services
Nagiosxi 5.5.7(test env) 2500 hosts, 13,000 services
Nagios Logserver 2 node Prod Env 500 objects sending
Nagios Network Analyser
Nagios Fusion
Locked