billing bugfix :)

git-svn-id: http://www.observium.org/svn/observer/trunk@1228 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2010-06-21 04:28:37 +00:00
parent 019e3c347a
commit 4fc6629f00
2 changed files with 8 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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");