mirror of
https://github.com/stylersnico/librenms.git
synced 2026-08-01 00:24:21 +02:00
small fixes. hrDevice collection fixed.
git-svn-id: http://www.observium.org/svn/observer/trunk@777 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -124,7 +124,7 @@ if ($device['os'] == "junos")
|
||||
|
||||
$afi = $peer_afi['afi'];
|
||||
$safi = $peer_afi['safi'];
|
||||
#echo($config['afi'][$afi][$safi]. " ");
|
||||
if($debug) { echo("$afi $safi". $config['afi'][$afi][$safi]. "\n"); }
|
||||
|
||||
$cbgp_cmd = $config['snmpget'] . " -m CISCO-BGP4-MIB -Ovq -" . $device['snmpver'] . " -c" . $device['community'] . " " . $device['hostname'].":".$device['port'];
|
||||
$cbgp_cmd .= " cbgpPeerAcceptedPrefixes." . $peer['bgpPeerIdentifier'] . ".$afi.$safi";
|
||||
@@ -135,9 +135,9 @@ if ($device['os'] == "junos")
|
||||
$cbgp_cmd .= " cbgpPeerAdvertisedPrefixes." . $peer['bgpPeerIdentifier'] . ".$afi.$safi";
|
||||
$cbgp_cmd .= " cbgpPeerSuppressedPrefixes." . $peer['bgpPeerIdentifier'] . ".$afi.$safi";
|
||||
$cbgp_cmd .= " cbgpPeerWithdrawnPrefixes." . $peer['bgpPeerIdentifier'] . ".$afi.$safi";
|
||||
#echo("\n$cbgp_cmd\n");
|
||||
if($debug) { echo("$cbgp_cmd\n"); }
|
||||
$cbgp_data = preg_replace("/^OID.*$/", "", trim(`$cbgp_cmd`));
|
||||
|
||||
if($debug) { echo("$cbgp_data\n"); }
|
||||
list($cbgpPeerAcceptedPrefixes,$cbgpPeerDeniedPrefixes,$cbgpPeerPrefixAdminLimit,$cbgpPeerPrefixThreshold,$cbgpPeerPrefixClearThreshold,$cbgpPeerAdvertisedPrefixes,$cbgpPeerSuppressedPrefixes,$cbgpPeerWithdrawnPrefixes) = explode("\n", $cbgp_data);
|
||||
|
||||
$update = "UPDATE bgpPeers_cbgp SET";
|
||||
@@ -150,7 +150,7 @@ if ($device['os'] == "junos")
|
||||
$update .= ", `cbgpPeerSuppressedPrefixes` = '$cbgpPeerSuppressedPrefixes'";
|
||||
$update .= ", `cbgpPeerWithdrawnPrefixes` = '$cbgpPeerWithdrawnPrefixes'";
|
||||
$update .= " WHERE `device_id` = '".$device['device_id']."' AND bgpPeerIdentifier = '" . $peer['bgpPeerIdentifier'] . "' AND afi = '$afi' AND safi = '$safi'";
|
||||
|
||||
if($debug) { echo("MYSQL: $update\n"); }
|
||||
mysql_query($update);
|
||||
|
||||
$cbgp_rrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("cbgp-" . $peer['bgpPeerIdentifier'] . ".$afi.$safi.rrd");
|
||||
|
||||
Reference in New Issue
Block a user