a million fixes. half way to 0.6.0! :D

git-svn-id: http://www.observium.org/svn/observer/trunk@407 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2009-04-23 21:13:56 +00:00
parent 35bc68a0d9
commit bc6ad69724
26 changed files with 616 additions and 406 deletions
+7 -2
View File
@@ -7,9 +7,9 @@
$mac_accounting_query = mysql_query("SELECT * FROM `mac_accounting` as A, `interfaces` AS I, `devices` AS D where A.interface_id = I.interface_id AND I.device_id = D.device_id AND D.status = '1'");
while ($acc = mysql_fetch_array($mac_accounting_query)) {
echo("Polling :" . $acc['peer_ip']. " " . $acc['ifDescr']. " " . $acc['hostname'] . "\n");
echo("Polling :" . $acc['peer_ip']. " " . $acc['ifDescr']. " " . $acc['hostname'] . " ");
$snmp_cmd = $config['snmpget'] . " -O Uqnv -" . $acc['snmpver'] . " -c " . $acc['community'] . " " . $acc['hostname'];
$snmp_cmd = $config['snmpget'] . " -m CISCO-IP-STAT-MIB -O Uqnv -" . $acc['snmpver'] . " -c " . $acc['community'] . " " . $acc['hostname'];
$snmp_cmd .= " " . $acc['in_oid'] . " " . $acc['out_oid'];
$snmp_output = trim(`$snmp_cmd`);
@@ -37,5 +37,10 @@
$woo = "N:$in:$out";
$ret = rrdtool_update("$rrdfile", $woo);
$rates = interface_rates ($rrdfile);
mysql_query("UPDATE `mac_accounting` SET bps_in = '" . $rates['in'] . "', bps_out = '" . $rates['out'] . "' WHERE ma_id= '" . $acc['ma_id'] . "'");
echo(formatRates($rates['in']) . " in " . formatRates($rates['out']) . " out \n");
}
?>