mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
more fixes
git-svn-id: http://www.observium.org/svn/observer/trunk@707 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -41,7 +41,7 @@ if (preg_match("/^[a-z]*$/", $_GET['format']))
|
|||||||
$dst_if = $link['dst_if'];
|
$dst_if = $link['dst_if'];
|
||||||
|
|
||||||
$i = 0; $done = 0;
|
$i = 0; $done = 0;
|
||||||
while ($i < count($linkdone))
|
while (isset($linkdone) && $i < count($linkdone))
|
||||||
{
|
{
|
||||||
$thislink = "$dst_if $src_if";
|
$thislink = "$dst_if $src_if";
|
||||||
if ($linkdone[$i] == $thislink) { $done = 1; }
|
if ($linkdone[$i] == $thislink) { $done = 1; }
|
||||||
|
@@ -32,7 +32,7 @@ unset($lldp_array);
|
|||||||
$lldp_array = snmpwalk_cache_threepart_oid("lldpRemoteSystemsData", $device, array(), "LLDP-MIB");
|
$lldp_array = snmpwalk_cache_threepart_oid("lldpRemoteSystemsData", $device, array(), "LLDP-MIB");
|
||||||
$lldp_array = $lldp_array[$device['device_id']];
|
$lldp_array = $lldp_array[$device['device_id']];
|
||||||
if($lldp_array) {
|
if($lldp_array) {
|
||||||
unset($lldp_links);
|
$lldp_links = "";
|
||||||
foreach( array_keys($lldp_array) as $key) {
|
foreach( array_keys($lldp_array) as $key) {
|
||||||
$lldp_if_array = $lldp_array[$key];
|
$lldp_if_array = $lldp_array[$key];
|
||||||
foreach( array_keys($lldp_if_array) as $entry_key) {
|
foreach( array_keys($lldp_if_array) as $entry_key) {
|
||||||
@@ -109,12 +109,12 @@ $query = mysql_query($sql);
|
|||||||
while ($test_link = mysql_fetch_array($query)) {
|
while ($test_link = mysql_fetch_array($query)) {
|
||||||
unset($exists);
|
unset($exists);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
while ($i < count($link_exists) && !$exists) {
|
while ($i < count($link_exists) && !isset($exists)) {
|
||||||
$this_link = $test_link['src_if'] . ",". $test_link['dst_if'];
|
$this_link = $test_link['src_if'] . ",". $test_link['dst_if'];
|
||||||
if ($link_exists[$i] == $this_link) { $exists = 1; }
|
if ($link_exists[$i] == $this_link) { $exists = 1; }
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if(!$exists) {
|
if(!isset($exists)) {
|
||||||
echo("-");
|
echo("-");
|
||||||
mysql_query("DELETE FROM `links` WHERE `src_if` = '".$test_link['src_if']."' AND `dst_if` = '".$test_link['dst_if']."'");
|
mysql_query("DELETE FROM `links` WHERE `src_if` = '".$test_link['src_if']."' AND `dst_if` = '".$test_link['dst_if']."'");
|
||||||
if($debug) { echo($link_exists[$i] . " REMOVED \n"); }
|
if($debug) { echo($link_exists[$i] . " REMOVED \n"); }
|
||||||
|
@@ -4,7 +4,7 @@ echo("hrDevice : ");
|
|||||||
|
|
||||||
$hrDevice_oids = array('hrDeviceIndex','hrDeviceType','hrDeviceDescr','hrDeviceStatus','hrDeviceErrors','hrProcessorLoad');
|
$hrDevice_oids = array('hrDeviceIndex','hrDeviceType','hrDeviceDescr','hrDeviceStatus','hrDeviceErrors','hrProcessorLoad');
|
||||||
|
|
||||||
foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmp_cache_oid($oid, $device, $hrDevice_array, "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); }
|
foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmp_cache_oid($oid, $device, array(), "HOST-RESOURCES-MIB:HOST-RESOURCES-TYPES"); }
|
||||||
|
|
||||||
foreach($hrDevice_array[$device['device_id']] as $hrDevice) {
|
foreach($hrDevice_array[$device['device_id']] as $hrDevice) {
|
||||||
if(is_array($hrDevice)) {
|
if(is_array($hrDevice)) {
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$device_vlans = mysql_query("SELECT * FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "' AND `vlan_domain` = '" . $vtp_domain . "'");
|
$device_vlans = mysql_query("SELECT * FROM `vlans` WHERE `device_id` = '" . $device['device_id'] . "'");
|
||||||
while($dev_vlan = mysql_fetch_array($device_vlans)) {
|
while($dev_vlan = mysql_fetch_array($device_vlans)) {
|
||||||
unset($vlan_exists);
|
unset($vlan_exists);
|
||||||
foreach($this_vlans as $test_vlan) {
|
foreach($this_vlans as $test_vlan) {
|
||||||
|
Reference in New Issue
Block a user