mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-12 08:02:23 +02:00
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:
+1
-6
@@ -1,11 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
# $debug = TRUE;
|
## FIXME - fewer includes!
|
||||||
# ini_set('display_errors', 1);
|
|
||||||
# ini_set('display_startup_errors', 0);
|
|
||||||
# ini_set('log_errors', 0);
|
|
||||||
# ini_set('error_reporting', E_ALL);
|
|
||||||
|
|
||||||
|
|
||||||
include_once("../includes/defaults.inc.php");
|
include_once("../includes/defaults.inc.php");
|
||||||
include_once("../config.php");
|
include_once("../config.php");
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ $colours_out = 'blues';
|
|||||||
|
|
||||||
$nototal = 1;
|
$nototal = 1;
|
||||||
|
|
||||||
|
|
||||||
$ds_in = "INOCTETS";
|
$ds_in = "INOCTETS";
|
||||||
$ds_out = "OUTOCTETS";
|
$ds_out = "OUTOCTETS";
|
||||||
|
|
||||||
|
|||||||
@@ -12,15 +12,14 @@ if($width > "500")
|
|||||||
}
|
}
|
||||||
|
|
||||||
$unit_text = "Bits/sec";
|
$unit_text = "Bits/sec";
|
||||||
$rrd_options .= " COMMENT:'".substr(str_pad($unit_text, $descr_len+5),0,$descr_len+5)."'";
|
|
||||||
|
|
||||||
if($width > "500")
|
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 '"; }
|
if (!$nototal) { $rrd_options .= " COMMENT:'Total '"; }
|
||||||
$rrd_options .= " COMMENT:'\l'";
|
$rrd_options .= " COMMENT:'\l'";
|
||||||
} else {
|
} 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'";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ $config['discover_services'] = false; ## Autodiscover services via
|
|||||||
|
|
||||||
$config['alerts']['email']['default'] = NULL; ## Default alert recipient
|
$config['alerts']['email']['default'] = NULL; ## Default alert recipient
|
||||||
$config['alerts']['email']['default_only'] = FALSE; ## Only use default 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.
|
$config['uptime_warning'] = "84600"; ## Time in seconds to display a "Device Rebooted" Alert. 0 to disable warnings.
|
||||||
|
|
||||||
### Cosmetics
|
### Cosmetics
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ else
|
|||||||
|
|
||||||
if ($bgpPeerFsmEstablishedTime)
|
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)
|
if ($peer['bgpPeerState'] == $bgpPeerState)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user