$entry) { $printer_supply = dbFetchRow("SELECT * FROM `printersupplies` WHERE `device_id` = ? AND `supply_mib` = ? AND `supply_index` = ?", array($device['device_id'], 'jetdirect', $index)); $marker_descr = "Printed ".nicecase($entry['prtMarkerCounterUnit']); list($hrDeviceIndex, $prtMarkerIndex) = explode('.', $index); $options = array('measured_class' => 'printersupply', 'measured_entity' => $printer_supply['supply_id'], 'counter_unit' => $entry['prtMarkerCounterUnit']); // Lifetime counter (should be always single) $descr = "Total $marker_descr"; $oid_name = 'prtMarkerLifeCount'; $oid = '.1.3.6.1.2.1.43.10.2.1.4.' . $index; $value = $entry[$oid_name]; if (isset($entry[$oid_name]) && $total_printed_allow) { discover_counter($device, 'printersupply', $mib, $oid_name, $oid, $index, $descr, 1, $value, $options); $total_printed_allow = FALSE; // Discover only first "Total Printed", all other always same } // PowerOn counter $descr = "PowerOn $marker_descr"; if ($prt_supplies[$index]['prtMarkerSuppliesDescription']) { $descr .= ' - ' . rewrite_entity_name(snmp_hexstring($prt_supplies[$index]['prtMarkerSuppliesDescription'])); } $oid_name = 'prtMarkerPowerOnCount'; $oid = '.1.3.6.1.2.1.43.10.2.1.5.' . $index; $value = $entry[$oid_name]; discover_counter($device, 'printersupply', $mib, $oid_name, $oid, $index, rewrite_entity_name($descr), 1, $value, $options); // prtMarkerStatus // FIXME, binary statuses currently unsupported } // EOF