mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
billing bugfix :)
git-svn-id: http://www.observium.org/svn/observer/trunk@1228 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -66,10 +66,14 @@ function getDates($dayofmonth) {
|
||||
}
|
||||
|
||||
|
||||
function getValue($host, $community, $port, $id, $inout) {
|
||||
function getValue($host, $community, $snmpver, $port, $id, $inout) {
|
||||
global $config;
|
||||
$oid = "IF-MIB::ifHC" . $inout . "Octets." . $id;
|
||||
$value = shell_exec($config['snmpget'] ." -m IF-MIB -c $community -v2c -O qv $host:$port $oid");
|
||||
$value = shell_exec($config['snmpget'] ." -m IF-MIB -c $community -$snmpver -O qv $host:$port $oid");
|
||||
if(!is_numeric($value)) {
|
||||
$oid = "IF-MIB::if" . $inout . "Octets." . $id;
|
||||
$value = shell_exec($config['snmpget'] ." -m IF-MIB -c $community -$snmpver -O qv $host:$port $oid");
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
|
||||
|
@@ -40,8 +40,8 @@ function CollectData($bill_id) {
|
||||
|
||||
echo("\nPolling ".$port_data['ifDescr']." on ".$port_data['hostname']."\n");
|
||||
|
||||
$port_in_measurement = trim(getValue($host, $port_data['community'], $port, $port_data['ifIndex'], "In"));
|
||||
$port_out_measurement = trim(getValue($host, $port_data['community'], $port, $port_data['ifIndex'], "Out"));
|
||||
$port_in_measurement = trim(getValue($host, $port_data['community'], $port_data['snmpver'], $port, $port_data['ifIndex'], "In"));
|
||||
$port_out_measurement = trim(getValue($host, $port_data['community'], $port_data['snmpver'], $port, $port_data['ifIndex'], "Out"));
|
||||
|
||||
echo("$port_in_measurement and $port_out_measurement \n");
|
||||
|
||||
|
Reference in New Issue
Block a user