mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 16:08:55 +02:00
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:
@@ -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");
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user