Changed id field in devices table to device_id (!!!1!!1!!eleven!1)

git-svn-id: http://www.observium.org/svn/observer/trunk@69 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2007-04-08 14:34:19 +00:00
parent ff04606a2f
commit e52334f578
20 changed files with 151 additions and 367 deletions
+1 -3
View File
@@ -7,7 +7,7 @@ include("includes/functions.php");
$interface_query = mysql_query("SELECT * FROM `interfaces`");
while ($interface = mysql_fetch_array($interface_query)) {
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE id = '" . $interface['device_id'] . "'"));
$device = mysql_fetch_array(mysql_query("SELECT * FROM `devices` WHERE device_id = '" . $interface['device_id'] . "'"));
if($device['status'] == '1') {
$snmp_cmd = "snmpget -O qv -" . $device['snmpver'] . " -c " . $device['community'] . " " . $device['hostname'] . " ifName." . $interface['ifIndex'];
@@ -15,8 +15,6 @@ while ($interface = mysql_fetch_array($interface_query)) {
$snmp_cmd .= "ifAlias." . $interface['ifIndex'] . " ifSpeed." . $interface['ifIndex'] . " 1.3.6.1.2.1.10.7.2.1." . $interface['ifIndex'];
$snmp_cmd .= " ifType." . $interface['ifIndex'] . " ifMtu." . $interface['ifIndex'] . " ifPhysAddress." . $interface['ifIndex'];
echo($snmp_cmd);
$snmp_output = trim(`$snmp_cmd`);
$snmp_output = str_replace("No Such Object available on this agent at this OID", "", $snmp_output);
$snmp_output = str_replace("No Such Instance currently exists at this OID", "", $snmp_output);