fixes. enable whitelisting for bgp alerts (temporary fix)

git-svn-id: http://www.observium.org/svn/observer/trunk@2553 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-09-23 10:33:58 +00:00
parent 20930e7702
commit 5b526e1f84
5 changed files with 7 additions and 12 deletions

View File

@@ -1,11 +1,6 @@
<?php
# $debug = TRUE;
# ini_set('display_errors', 1);
# ini_set('display_startup_errors', 0);
# ini_set('log_errors', 0);
# ini_set('error_reporting', E_ALL);
## FIXME - fewer includes!
include_once("../includes/defaults.inc.php");
include_once("../config.php");

View File

@@ -50,7 +50,6 @@ $colours_out = 'blues';
$nototal = 1;
$ds_in = "INOCTETS";
$ds_out = "OUTOCTETS";

View File

@@ -12,15 +12,14 @@ if($width > "500")
}
$unit_text = "Bits/sec";
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)."'";
if($width > "500")
{
$rrd_options .= " COMMENT:' Current Average Maximum '";
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." Current Average Maximum '";
if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; }
$rrd_options .= " COMMENT:'\l'";
} else {
$rrd_options .= " COMMENT:' Now Ave Max\l'";
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)." Now Ave Max\l'";
}

View File

@@ -82,7 +82,9 @@ $config['discover_services'] = false; ## Autodiscover services via
$config['alerts']['email']['default'] = NULL; ## Default alert recipient
$config['alerts']['email']['default_only'] = FALSE; ## Only use default recipient
$config['alerts']['email']['enable'] = TRUE; ## Enable email alerts
$config['alerts']['email']['enable'] = TRUE; ## Enable email alerts
$config['alerts']['bgp']['whitelist'] = NULL; ## Populate as an array() with ASNs to alert on.
$config['uptime_warning'] = "84600"; ## Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings.
### Cosmetics

View File

@@ -83,7 +83,7 @@ else
if ($bgpPeerFsmEstablishedTime)
{
if ($bgpPeerFsmEstablishedTime < $peer['bgpPeerFsmEstablishedTime'] || $bgpPeerState != $peer['bgpPeerState'])
if (!(is_array($config['alerts']['bgp']['whitelist']) && in_array($bgppeerremoteas, $config['alerts']['peer_whitelist'])) && ($bgpPeerFsmEstablishedTime < $peer['bgpPeerFsmEstablishedTime'] || $bgpPeerState != $peer['bgpPeerState']))
{
if ($peer['bgpPeerState'] == $bgpPeerState)
{