only repoll capacity when oid is in database

git-svn-id: http://www.observium.org/svn/observer/trunk@3139 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2012-05-06 19:57:28 +00:00
parent 8df5bb8f8b
commit e33c1f0de1

View File

@ -8,7 +8,10 @@ if ($config['enable_printers'])
{
echo("Checking toner " . $toner['toner_descr'] . "... ");
$toner['toner_capacity'] = snmp_get($device, $toner['toner_capacity_oid'], "-OUqnv");
if ($toner['toner_capacity_oid']) # FIXME this if can go on 1-Sep-2012
{
$toner['toner_capacity'] = snmp_get($device, $toner['toner_capacity_oid'], "-OUqnv");
}
$tonerperc = round(snmp_get($device, $toner['toner_oid'], "-OUqnv") / $toner['toner_capacity'] * 100);
$old_tonerrrd = $config['rrd_dir'] . "/" . $device['hostname'] . "/" . safename("toner-" . $toner['toner_descr'] . ".rrd");