don't try to add bogus addresses then remove them again + small fixes and REMOVE DEBUG PRINT_R

git-svn-id: http://www.observium.org/svn/observer/trunk@3007 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-04-09 14:23:16 +00:00
parent 79f90c05f3
commit 9cea534c1b
3 changed files with 3 additions and 6 deletions

View File

@@ -3,7 +3,7 @@
echo("IPv4 Addresses : "); echo("IPv4 Addresses : ");
$oids = trim(snmp_walk($device,"ipAdEntIfIndex","-Osq","IP-MIB")); $oids = trim(snmp_walk($device,"ipAdEntIfIndex","-Osq","IP-MIB"));
$oids = str_replace("ipAdEntIfIndex.", "", $oids); $oids = trim(str_replace("ipAdEntIfIndex", "", $oids),'.');
foreach (explode("\n", $oids) as $data) foreach (explode("\n", $oids) as $data)
{ {
$data = trim($data); $data = trim($data);

View File

@@ -38,9 +38,6 @@ if ($device['os'] != "Snom")
$rrdupdate .= ":$value"; $rrdupdate .= ":$value";
} }
print_r($data);
if (isset($data[0]['ipOutRequests']) && isset($data[0]['ipInReceives'])) if (isset($data[0]['ipOutRequests']) && isset($data[0]['ipInReceives']))
{ {
if (!file_exists($rrd_file)) { rrdtool_create($rrd_file, $rrd_create); } if (!file_exists($rrd_file)) { rrdtool_create($rrd_file, $rrd_create); }
@@ -48,7 +45,6 @@ if ($device['os'] != "Snom")
$graphs['netstat_ip'] = TRUE; $graphs['netstat_ip'] = TRUE;
$graphs['netstat_ip_frag'] = TRUE; $graphs['netstat_ip_frag'] = TRUE;
} }
} }
unset($oids, $data, $data_array, $oid); unset($oids, $data, $data_array, $oid);

View File

@@ -143,7 +143,8 @@ foreach ($port_stats as $ifIndex => $port)
$ports[$ifIndex]['deleted'] = "0"; $ports[$ifIndex]['deleted'] = "0";
} }
} else { } else {
if($ports[$port['ifIndex']]['deleted'] != "1") { if ($ports[$port['ifIndex']]['deleted'] != "1")
{
dbUpdate(array('deleted' => '1'), 'ports', '`interface_id` = ?', array($ports[$ifIndex]['interface_id'])); dbUpdate(array('deleted' => '1'), 'ports', '`interface_id` = ?', array($ports[$ifIndex]['interface_id']));
$ports[$ifIndex]['deleted'] = "1"; $ports[$ifIndex]['deleted'] = "1";
} }