warning fixes + bug fix resulting from these stricter checks in juniper v6 discovery

git-svn-id: http://www.observium.org/svn/observer/trunk@704 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2010-01-16 23:37:26 +00:00
parent 363c85c5f4
commit 23b528b295
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -42,7 +42,7 @@
list($peer_ip_snmp, $peer_as) = split(" ", $peer);
# Magic! Basically, takes SNMP form and finds peer IPs from the walk OIDs.
$peer_ip = Net_IPv6::compress(snmp2ipv6(implode('.',array_slice(explode('.',$peer_ip_snmp),count($ipv6)-16))));
$peer_ip = Net_IPv6::compress(snmp2ipv6(implode('.',array_slice(explode('.',$peer_ip_snmp),count(explode('.',$peer_ip_snmp))-16))));
if($peer)
{
@@ -118,12 +118,12 @@ $query = mysql_query($sql);
while ($entry = mysql_fetch_array($query)) {
unset($exists);
$i = 0;
while ($i < count($peerlist) && !$exists)
while ($i < count($peerlist) && !isset($exists))
{
if ($peerlist[$i]['ip'] == $entry['bgpPeerIdentifier']) { $exists = 1; }
$i++;
}
if(!$exists) {
if(!isset($exists)) {
mysql_query("DELETE FROM bgpPeers WHERE bgpPeer_id = '" . $entry['bgpPeer_id'] . "'");
mysql_query("DELETE FROM bgpPeers_cbgp WHERE bgpPeer_id = '" . $entry['bgpPeer_id'] . "'");
echo("-");
+1 -1
View File
@@ -30,7 +30,7 @@ echo("\nLLDP-MIB: ");
unset($lldp_array);
$lldp_array = snmpwalk_cache_threepart_oid("lldpRemoteSystemsData", $device, $lldp_array, "LLDP-MIB");
$lldp_array = $lldp_array[$device[device_id]];
$lldp_array = $lldp_array[$device['device_id']];
if($lldp_array) {
unset($lldp_links);
foreach( array_keys($lldp_array) as $key) {
+1 -1
View File
@@ -6,7 +6,7 @@ $hrDevice_oids = array('hrDeviceIndex','hrDeviceType','hrDeviceDescr','hrDeviceS
foreach ($hrDevice_oids as $oid) { $hrDevice_array = snmp_cache_oid($oid, $device, $hrDevice_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(mysql_result(mysql_query("SELECT COUNT(*) FROM `hrDevice` WHERE device_id = '".$device['device_id']."' AND hrDeviceIndex = '".$hrDevice['hrDeviceIndex']."'"),0)) {
$update_query = "UPDATE `hrDevice` SET";