diff --git a/LibreNMS/Config.php b/LibreNMS/Config.php index 6a7e633ebe..acf62316e1 100644 --- a/LibreNMS/Config.php +++ b/LibreNMS/Config.php @@ -432,6 +432,8 @@ class Config self::deprecatedVariable('rrdgraph_real_95th', 'rrdgraph_real_percentile'); self::deprecatedVariable('fping_options.millisec', 'fping_options.interval'); self::deprecatedVariable('discovery_modules.cisco-vrf', 'discovery_modules.vrf'); + self::deprecatedVariable('discovery_modules.toner', 'discovery_modules.printer-supplies'); + self::deprecatedVariable('poller_modules.toner', 'poller_modules.printer-supplies'); self::deprecatedVariable('oxidized.group', 'oxidized.maps.group'); $persist = Eloquent::isConnected(); diff --git a/LibreNMS/Modules/PrinterSupplies.php b/LibreNMS/Modules/PrinterSupplies.php new file mode 100644 index 0000000000..ed6ddfaccd --- /dev/null +++ b/LibreNMS/Modules/PrinterSupplies.php @@ -0,0 +1,282 @@ +. + * + * @link https://www.librenms.org + */ + +namespace LibreNMS\Modules; + +use App\Models\PrinterSupply; +use App\Observers\ModuleModelObserver; +use Illuminate\Support\Collection; +use Illuminate\Support\Str; +use LibreNMS\DB\SyncsModels; +use LibreNMS\Interfaces\Module; +use LibreNMS\OS; +use LibreNMS\RRD\RrdDefinition; +use Log; + +class PrinterSupplies implements Module +{ + use SyncsModels; + + /** + * Discover this module. Heavier processes can be run here + * Run infrequently (default 4 times a day) + * + * @param OS $os + */ + public function discover(OS $os) + { + $device = $os->getDeviceArray(); + + $data = collect() + ->concat($this->discoveryLevels($device)) + ->concat($this->discoveryPapers($device)); + + ModuleModelObserver::observe(PrinterSupply::class); + $this->syncModels($os->getDevice(), 'printerSupplies', $data); + } + + /** + * Poll data for this module and update the DB / RRD. + * Try to keep this efficient and only run if discovery has indicated there is a reason to run. + * Run frequently (default every 5 minutes) + * + * @param OS $os + */ + public function poll(OS $os) + { + $device = $os->getDeviceArray(); + $toner_data = $os->getDevice()->printerSupplies; + + $toner_snmp = snmp_get_multi_oid($device, $toner_data->pluck('supply_oid')->toArray()); + + foreach ($toner_data as $toner) { + echo 'Checking toner ' . $toner['supply_descr'] . '... '; + + $raw_toner = $toner_snmp[$toner['supply_oid']]; + $tonerperc = self::getTonerLevel($device, $raw_toner, $toner['supply_capacity']); + echo $tonerperc . " %\n"; + + $tags = [ + 'rrd_def' => RrdDefinition::make()->addDataset('toner', 'GAUGE', 0, 20000), + 'rrd_name' => ['toner', $toner['supply_index']], + 'rrd_oldname' => ['toner', $toner['supply_descr']], + 'index' => $toner['supply_index'], + ]; + data_update($device, 'toner', $tags, $tonerperc); + + // Log empty supplies (but only once) + if ($tonerperc == 0 && $toner['supply_current'] > 0) { + Log::event('Toner ' . $toner['supply_descr'] . ' is empty', $device, 'toner', 5, $toner['supply_id']); + } + + // Log toner swap + if ($tonerperc > $toner['supply_current']) { + Log::event('Toner ' . $toner['supply_descr'] . ' was replaced (new level: ' . $tonerperc . '%)', $device, 'toner', 3, $toner['supply_id']); + } + + $toner->supply_current = $tonerperc; + $toner->supply_capacity = $toner['supply_capacity']; + $toner->save(); + } + } + + /** + * Remove all DB data for this module. + * This will be run when the module is disabled. + * + * @param OS $os + */ + public function cleanup(OS $os) + { + $os->getDevice()->printerSupplies()->delete(); + } + + private function discoveryLevels($device): Collection + { + $levels = collect(); + + $oids = snmpwalk_cache_oid($device, 'prtMarkerSuppliesLevel', [], 'Printer-MIB'); + if (! empty($oids)) { + $oids = snmpwalk_cache_oid($device, 'prtMarkerSuppliesType', $oids, 'Printer-MIB'); + $oids = snmpwalk_cache_oid($device, 'prtMarkerSuppliesMaxCapacity', $oids, 'Printer-MIB'); + $oids = snmpwalk_cache_oid($device, 'prtMarkerSuppliesDescription', $oids, 'Printer-MIB', null, '-OQUsa'); + } + + foreach ($oids as $index => $data) { + $last_index = substr($index, strrpos($index, '.') + 1); + + $descr = $data['prtMarkerSuppliesDescription']; + $raw_capacity = $data['prtMarkerSuppliesMaxCapacity']; + $raw_toner = $data['prtMarkerSuppliesLevel']; + $supply_oid = ".1.3.6.1.2.1.43.11.1.1.9.$index"; + $capacity_oid = ".1.3.6.1.2.1.43.11.1.1.8.$index"; + + // work around weird HP bug where descriptions are on two lines and the second line is hex + if (Str::contains($descr, "\n")) { + $new_descr = ''; + foreach (explode("\n", $descr) as $line) { + if (preg_match('/^([A-F\d]{2} )*[A-F\d]{1,2} ?$/', $line)) { + $line = snmp_hexstring($line); + } + $new_descr .= $line; + } + $descr = trim($new_descr); + } + + // Ricoh - TONERCurLevel + if (empty($raw_toner)) { + $supply_oid = ".1.3.6.1.4.1.367.3.2.1.2.24.1.1.5.$last_index"; + $raw_toner = snmp_get($device, $supply_oid, '-Oqv'); + } + + // Ricoh - TONERNameLocal + if (empty($descr)) { + $descr_oid = ".1.3.6.1.4.1.367.3.2.1.2.24.1.1.3.$last_index"; + $descr = snmp_get($device, $descr_oid, '-Oqva'); + } + + // trim part & serial number from devices that include it + if (Str::contains($descr, ', PN')) { + $descr = explode(', PN', $descr)[0]; + } + + $capacity = self::getTonerCapacity($raw_capacity); + $current = self::getTonerLevel($device, $raw_toner, $capacity); + + if (is_numeric($current)) { + $levels->push(new PrinterSupply([ + 'device_id' => $device['device_id'], + 'supply_oid' => $supply_oid, + 'supply_capacity_oid' => $capacity_oid, + 'supply_index' => $last_index, + 'supply_type' => $data['prtMarkerSuppliesType'] ?: 'markerSupply', + 'supply_descr' => $descr, + 'supply_capacity' => $capacity, + 'supply_current' => $current, + ])); + } + } + + return $levels; + } + + private function discoveryPapers($device): Collection + { + echo 'Tray Paper Level: '; + $papers = collect(); + + $tray_oids = snmpwalk_cache_oid($device, 'prtInputName', [], 'Printer-MIB'); + if (! empty($tray_oids)) { + $tray_oids = snmpwalk_cache_oid($device, 'prtInputCurrentLevel', $tray_oids, 'Printer-MIB'); + $tray_oids = snmpwalk_cache_oid($device, 'prtInputMaxCapacity', $tray_oids, 'Printer-MIB'); + } + + foreach ($tray_oids as $index => $data) { + $last_index = substr($index, strrpos($index, '.') + 1); + + $capacity = $data['prtInputMaxCapacity']; + $current = $data['prtInputCurrentLevel']; + + if (! is_numeric($current) || $current == -2) { + // capacity unsupported + d_echo('Input Capacity unsupported', 'X'); + continue; + } elseif ($current == -3) { + // at least one piece of paper in tray + $current = 50; + } else { + $current = $current / $capacity * 100; + } + + $papers->push(new PrinterSupply([ + 'device_id' => $device['device_id'], + 'supply_oid' => ".1.3.6.1.2.1.43.8.2.1.10.$index", + 'supply_capacity_oid' => ".1.3.6.1.2.1.43.8.2.1.9.$index", + 'supply_index' => $last_index, + 'supply_type' => 'input', + 'supply_descr' => $data['prtInputName'], + 'supply_capacity' => $capacity, + 'supply_current' => $current, + ])); + } + + return $papers; + } + + /** + * @param array $device + * @param int|string $raw_value The value returned from snmp + * @param int $capacity the normalized capacity + * @return int the toner level as a percentage + */ + private static function getTonerLevel($device, $raw_value, $capacity) + { + // -3 means some toner is left + if ($raw_value == '-3') { + return 50; + } + + // -2 means unknown + if ($raw_value == '-2') { + return false; + } + + // -1 mean no restrictions + if ($raw_value == '-1') { + return 0; // FIXME: is 0 what we should return? + } + + // Non-standard snmp values + if ($device['os'] == 'ricoh' || $device['os'] == 'nrg' || $device['os'] == 'lanier') { + if ($raw_value == '-100') { + return 0; + } + } elseif ($device['os'] == 'brother') { + if (! Str::contains($device['hardware'], 'MFC-L8850')) { + switch ($raw_value) { + case '0': + return 100; + case '1': + return 5; + case '2': + return 0; + case '3': + return 1; + } + } + } + + return round($raw_value / $capacity * 100); + } + + /** + * @param int $raw_capacity The value return from snmp + * @return int normalized capacity value + */ + private static function getTonerCapacity($raw_capacity) + { + // unknown or unrestricted capacity, assume 100 + if (empty($raw_capacity) || $raw_capacity < 0) { + return 100; + } + + return $raw_capacity; + } +} diff --git a/LibreNMS/Util/ObjectCache.php b/LibreNMS/Util/ObjectCache.php index 70042921cd..e93501d37b 100644 --- a/LibreNMS/Util/ObjectCache.php +++ b/LibreNMS/Util/ObjectCache.php @@ -32,10 +32,10 @@ use App\Models\Device; use App\Models\Mpls; use App\Models\OspfInstance; use App\Models\Port; +use App\Models\PrinterSupply; use App\Models\Pseudowire; use App\Models\Sensor; use App\Models\Service; -use App\Models\Toner; use App\Models\Vrf; use Cache; @@ -98,7 +98,7 @@ class ObjectCache ]; } - if (Toner::hasAccess(auth()->user())->exists()) { + if (PrinterSupply::hasAccess(auth()->user())->exists()) { $sensor_menu[3] = [ [ 'class' => 'toner', diff --git a/app/Http/Controllers/AboutController.php b/app/Http/Controllers/AboutController.php index bca39c561e..d86511701a 100644 --- a/app/Http/Controllers/AboutController.php +++ b/app/Http/Controllers/AboutController.php @@ -38,13 +38,13 @@ use App\Models\Ipv6Address; use App\Models\Ipv6Network; use App\Models\Mempool; use App\Models\Port; +use App\Models\PrinterSupply; use App\Models\Processor; use App\Models\Pseudowire; use App\Models\Sensor; use App\Models\Service; use App\Models\Storage; use App\Models\Syslog; -use App\Models\Toner; use App\Models\Vlan; use App\Models\Vrf; use App\Models\WirelessSensor; @@ -98,7 +98,7 @@ class AboutController extends Controller 'stat_services' => Service::count(), 'stat_storage' => Storage::count(), 'stat_syslog' => Syslog::count(), - 'stat_toner' => Toner::count(), + 'stat_toner' => PrinterSupply::count(), 'stat_vlans' => Vlan::count(), 'stat_vrf' => Vrf::count(), 'stat_wireless' => WirelessSensor::count(), diff --git a/app/Models/Device.php b/app/Models/Device.php index 44830aeb7e..231883ba1f 100644 --- a/app/Models/Device.php +++ b/app/Models/Device.php @@ -762,7 +762,7 @@ class Device extends BaseModel public function printerSupplies() { - return $this->hasMany(Toner::class, 'device_id'); + return $this->hasMany(PrinterSupply::class, 'device_id'); } public function pseudowires() diff --git a/app/Models/PrinterSupply.php b/app/Models/PrinterSupply.php new file mode 100644 index 0000000000..e1b01bbeba --- /dev/null +++ b/app/Models/PrinterSupply.php @@ -0,0 +1,25 @@ +supply_type-$this->supply_index"; + } +} diff --git a/app/Models/Toner.php b/app/Models/Toner.php deleted file mode 100644 index d33c609ffa..0000000000 --- a/app/Models/Toner.php +++ /dev/null @@ -1,10 +0,0 @@ -renameColumn('toner_id', 'supply_id'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('toner_index', 'supply_index'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('toner_type', 'supply_type'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('toner_oid', 'supply_oid'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('toner_descr', 'supply_descr'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('toner_capacity', 'supply_capacity'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('toner_current', 'supply_current'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('toner_capacity_oid', 'supply_capacity_oid'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->string('supply_descr', 255)->change(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_id', 'toner_id'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_index', 'toner_index'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_type', 'toner_type'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_oid', 'toner_oid'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_descr', 'toner_descr'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_capacity', 'toner_capacity'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_current', 'toner_current'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->renameColumn('supply_capacity_oid', 'toner_capacity_oid'); + }); + + Schema::table('printer_supplies', function (Blueprint $table) { + $table->string('toner_descr', 32)->change(); + }); + } +} diff --git a/includes/caches/toner.inc.php b/includes/caches/toner.inc.php index a66067b6f1..8c65de9ced 100644 --- a/includes/caches/toner.inc.php +++ b/includes/caches/toner.inc.php @@ -1,13 +1,13 @@ hasGlobalRead()) { - $data['count'] = ['query' => 'SELECT COUNT(`toner_id`) FROM toner']; + $data['count'] = ['query' => 'SELECT COUNT(`supply_id`) FROM printer_supplies']; } else { $device_ids = Permissions::devicesForUser()->toArray() ?: [0]; - $perms_sql = '`toner`.`device_id` IN ' . dbGenPlaceholders(count($device_ids)); + $perms_sql = '`printer_supplies`.`device_id` IN ' . dbGenPlaceholders(count($device_ids)); $data['count'] = [ - 'query' => "SELECT COUNT(`toner_id`) FROM toner WHERE $perms_sql", + 'query' => "SELECT COUNT(`supply_id`) FROM printer_supplies WHERE $perms_sql", 'params' => $device_ids, ]; } diff --git a/includes/callback.php b/includes/callback.php index abebd7c87a..2f62b3f17f 100644 --- a/includes/callback.php +++ b/includes/callback.php @@ -57,7 +57,7 @@ if ($enabled == 1) { 'sensors' => 'SELECT COUNT(*) AS `total`,`sensor_class` FROM `sensors` GROUP BY `sensor_class`', 'wireless' => 'SELECT COUNT(*) AS `total`,`sensor_class` FROM `wireless_sensors` GROUP BY `sensor_class`', 'storage' => 'SELECT COUNT(*) AS `total`,`storage_type` FROM `storage` GROUP BY `storage_type`', - 'toner' => 'SELECT COUNT(*) AS `total`,`toner_type` FROM `toner` GROUP BY `toner_type`', + 'toner' => 'SELECT COUNT(*) AS `total`,`supply_type` FROM `printer_supplies` GROUP BY `supply_type`', 'vlans' => 'SELECT COUNT(*) AS `total`,`vlan_type` FROM `vlans` GROUP BY `vlan_type`', 'vminfo' => 'SELECT COUNT(*) AS `total`,`vm_type` FROM `vminfo` GROUP BY `vm_type`', 'vmware' => 'SELECT COUNT(*) AS `total` FROM `vminfo`', diff --git a/includes/definitions/brother.yaml b/includes/definitions/brother.yaml index 92a4ee4f65..4f6f96a2d1 100644 --- a/includes/definitions/brother.yaml +++ b/includes/definitions/brother.yaml @@ -9,6 +9,6 @@ discovery: - sysDescr_regex: '/Brother NC-.*(h|w),/' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/canonprinter.yaml b/includes/definitions/canonprinter.yaml index bdb31538c4..895802b223 100644 --- a/includes/definitions/canonprinter.yaml +++ b/includes/definitions/canonprinter.yaml @@ -16,6 +16,6 @@ discovery: - .1.3.6.1.4.1.1602.4.2 - .1.3.6.1.4.1.1602.4.7 discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/dell-laser.yaml b/includes/definitions/dell-laser.yaml index 9f6a21aee0..ff67eb9cd1 100644 --- a/includes/definitions/dell-laser.yaml +++ b/includes/definitions/dell-laser.yaml @@ -17,6 +17,6 @@ discovery: - sysObjectID: .1.3.6.1.4.1.674.10898. discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/developprinter.yaml b/includes/definitions/developprinter.yaml index b2fd0ed210..c6ef0cfc50 100644 --- a/includes/definitions/developprinter.yaml +++ b/includes/definitions/developprinter.yaml @@ -10,6 +10,6 @@ discovery: sysObjectID: - .1.3.6.1.4.1.18334.1.2.1.2.1.50.2.2 discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/epson.yaml b/includes/definitions/epson.yaml index 2349a1779c..875e33e323 100644 --- a/includes/definitions/epson.yaml +++ b/includes/definitions/epson.yaml @@ -10,6 +10,6 @@ discovery: sysDescr: - 'EPSON Built-in' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/gestetner.yaml b/includes/definitions/gestetner.yaml index aaf250679e..310bb2e56c 100644 --- a/includes/definitions/gestetner.yaml +++ b/includes/definitions/gestetner.yaml @@ -10,8 +10,8 @@ discovery: sysDescr: - Gestetner Network Printer discovery_modules: - toner: true + printer-supplies: true mempools: false poller_modules: - toner: true + printer-supplies: true mempools: false diff --git a/includes/definitions/jetdirect.yaml b/includes/definitions/jetdirect.yaml index 44227b8bfc..3a09cd75a5 100644 --- a/includes/definitions/jetdirect.yaml +++ b/includes/definitions/jetdirect.yaml @@ -7,9 +7,9 @@ icon: hp over: - { graph: device_toner, text: Toner } discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true discovery: - sysDescr: diff --git a/includes/definitions/konica.yaml b/includes/definitions/konica.yaml index 4f7e224f72..ab46f9b316 100644 --- a/includes/definitions/konica.yaml +++ b/includes/definitions/konica.yaml @@ -13,6 +13,6 @@ discovery: sysObjectID: - .1.3.6.1.4.1.18334.1. discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/kyocera.yaml b/includes/definitions/kyocera.yaml index f22c685a8b..74a826fe20 100644 --- a/includes/definitions/kyocera.yaml +++ b/includes/definitions/kyocera.yaml @@ -10,6 +10,6 @@ discovery: sysDescr_regex: - '/^KYOCERA/' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/lanier.yaml b/includes/definitions/lanier.yaml index 3efa7e9c1f..160329675b 100644 --- a/includes/definitions/lanier.yaml +++ b/includes/definitions/lanier.yaml @@ -10,6 +10,6 @@ discovery: sysDescr: - LANIER discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/lexmarkprinter.yaml b/includes/definitions/lexmarkprinter.yaml index 187df9bc06..d3b84a40b1 100644 --- a/includes/definitions/lexmarkprinter.yaml +++ b/includes/definitions/lexmarkprinter.yaml @@ -10,6 +10,6 @@ discovery: sysDescr: - Lexmark discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/nrg.yaml b/includes/definitions/nrg.yaml index d2bb5fbf58..e7c99e7e21 100644 --- a/includes/definitions/nrg.yaml +++ b/includes/definitions/nrg.yaml @@ -10,6 +10,6 @@ discovery: sysDescr: - 'NRG Network Printer' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/okilan.yaml b/includes/definitions/okilan.yaml index a3c1ee9bb8..88c3e37779 100644 --- a/includes/definitions/okilan.yaml +++ b/includes/definitions/okilan.yaml @@ -10,6 +10,6 @@ discovery: sysDescr: - 'OKI OkiLAN' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/ricoh.yaml b/includes/definitions/ricoh.yaml index 9354bf3647..80e9990fa8 100644 --- a/includes/definitions/ricoh.yaml +++ b/includes/definitions/ricoh.yaml @@ -11,6 +11,6 @@ discovery: - 'RICOH Aficio' - 'RICOH Network Printer' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/samsungprinter.yaml b/includes/definitions/samsungprinter.yaml index 0ee325104f..cc00b35f48 100644 --- a/includes/definitions/samsungprinter.yaml +++ b/includes/definitions/samsungprinter.yaml @@ -11,6 +11,6 @@ discovery: - 'Samsung S' - 'Samsung ML' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/savin.yaml b/includes/definitions/savin.yaml index d903ae5572..04fbbd0d2e 100644 --- a/includes/definitions/savin.yaml +++ b/includes/definitions/savin.yaml @@ -10,6 +10,6 @@ discovery: sysDescr: - SAVIN discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/sharp.yaml b/includes/definitions/sharp.yaml index 364bf6e39d..ba76b85894 100644 --- a/includes/definitions/sharp.yaml +++ b/includes/definitions/sharp.yaml @@ -10,6 +10,6 @@ discovery: sysDescr: - 'SHARP MX-' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/toshiba-tec.yaml b/includes/definitions/toshiba-tec.yaml index 121a3990c9..5a017ce0e1 100644 --- a/includes/definitions/toshiba-tec.yaml +++ b/includes/definitions/toshiba-tec.yaml @@ -14,6 +14,6 @@ discovery: sysDescr: - 'TOSHIBA e-STUDIO' discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/definitions/waas.yaml b/includes/definitions/waas.yaml index 45271b7a5e..e865e63934 100644 --- a/includes/definitions/waas.yaml +++ b/includes/definitions/waas.yaml @@ -21,7 +21,7 @@ poller_modules: cisco-voice: false ipmi: false ospf: false - toner: false + printer-supplies: false ucd-diskio: false ucd-mib: false discovery_modules: @@ -36,7 +36,7 @@ discovery_modules: libvirt-vminfo: false ntp: false stp: false - toner: false + printer-supplies: false ucd-diskio: false vlans: false discovery: diff --git a/includes/definitions/xerox.yaml b/includes/definitions/xerox.yaml index 803e6d2f29..bf2ef1bc7a 100644 --- a/includes/definitions/xerox.yaml +++ b/includes/definitions/xerox.yaml @@ -11,6 +11,6 @@ discovery: - .1.3.6.1.4.1.253.8.62.1. - .1.3.6.1.4.1.297.1.11.93.1. discovery_modules: - toner: true + printer-supplies: true poller_modules: - toner: true + printer-supplies: true diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index aab0ae29a8..7b7010b941 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -598,29 +598,6 @@ function discover_storage(&$valid, $device, $index, $type, $mib, $descr, $size, }//end if } -function discover_toner(&$valid, $device, $oid, $index, $type, $descr, $capacity_oid = null, $capacity = null, $current = null) -{ - d_echo("Discover Toner: $oid, $index, $type, $descr, $capacity_oid, $capacity, $current\n"); - - if (dbFetchCell('SELECT COUNT(toner_id) FROM `toner` WHERE device_id = ? AND toner_type = ? AND `toner_index` = ? AND `toner_oid` =?', [$device['device_id'], $type, $index, $oid]) == '0') { - $inserted = dbInsert(['device_id' => $device['device_id'], 'toner_oid' => $oid, 'toner_capacity_oid' => $capacity_oid, 'toner_index' => $index, 'toner_type' => $type, 'toner_descr' => $descr, 'toner_capacity' => $capacity, 'toner_current' => $current], 'toner'); - echo '+'; - log_event('Toner added: type ' . $type . ' index ' . $index . ' descr ' . $descr, $device, 'toner', 3, $inserted); - } else { - $toner_entry = dbFetchRow('SELECT * FROM `toner` WHERE `device_id` = ? AND `toner_type` = ? AND `toner_index` =?', [$device['device_id'], $type, $index]); - if ($oid == $toner_entry['toner_oid'] && $descr == $toner_entry['toner_descr'] && $capacity == $toner_entry['toner_capacity'] && $capacity_oid == $toner_entry['toner_capacity_oid']) { - echo '.'; - } else { - dbUpdate(['toner_descr' => $descr, 'toner_oid' => $oid, 'toner_capacity_oid' => $capacity_oid, 'toner_capacity' => $capacity], 'toner', 'device_id=? AND toner_type=? AND `toner_index`=?', [$device['device_id'], $type, $index]); - echo 'U'; - } - } - - $valid[$type][$oid] = 1; -} - -//end discover_toner() - function discover_entity_physical(&$valid, $device, $entPhysicalIndex, $entPhysicalDescr, $entPhysicalClass, $entPhysicalName, $entPhysicalModelName, $entPhysicalSerialNum, $entPhysicalContainedIn, $entPhysicalMfgName, $entPhysicalParentRelPos, $entPhysicalVendorType, $entPhysicalHardwareRev, $entPhysicalFirmwareRev, $entPhysicalSoftwareRev, $entPhysicalIsFRU, $entPhysicalAlias, $entPhysicalAssetID, $ifIndex) { d_echo("Discover Inventory Item: $entPhysicalIndex, $entPhysicalDescr, $entPhysicalClass, $entPhysicalName, $entPhysicalModelName, $entPhysicalSerialNum, $entPhysicalContainedIn, $entPhysicalMfgName, $entPhysicalParentRelPos, $entPhysicalVendorType, $entPhysicalHardwareRev, $entPhysicalFirmwareRev, $entPhysicalSoftwareRev, $entPhysicalIsFRU, $entPhysicalAlias, $entPhysicalAssetID, $ifIndex\n"); @@ -843,20 +820,6 @@ function get_device_divisor($device, $os_version, $sensor_type, $oid) return 10; } -/** - * @param int $raw_capacity The value return from snmp - * @return int normalized capacity value - */ -function get_toner_capacity($raw_capacity) -{ - // unknown or unrestricted capacity, assume 100 - if (empty($raw_capacity) || $raw_capacity < 0) { - return 100; - } - - return $raw_capacity; -} - /** * Should we ignore this storage device based on teh description? (usually the mount path or drive) * diff --git a/includes/discovery/printer-supplies.inc.php b/includes/discovery/printer-supplies.inc.php new file mode 100644 index 0000000000..7ec04732d6 --- /dev/null +++ b/includes/discovery/printer-supplies.inc.php @@ -0,0 +1,8 @@ +discover($os); diff --git a/includes/discovery/toner.inc.php b/includes/discovery/toner.inc.php deleted file mode 100644 index 17a83bf3fe..0000000000 --- a/includes/discovery/toner.inc.php +++ /dev/null @@ -1,132 +0,0 @@ - $data) { - $last_index = substr($index, strrpos($index, '.') + 1); - - $raw_toner = $data['prtMarkerSuppliesLevel']; - $descr = $data['prtMarkerSuppliesDescription']; - - // work around weird HP bug where descriptions are on two lines and the second line is hex - if (Str::contains($descr, "\n")) { - $new_descr = ''; - foreach (explode("\n", $descr) as $line) { - if (preg_match('/^([A-F\d]{2} )*[A-F\d]{1,2} ?$/', $line)) { - $line = snmp_hexstring($line); - } - $new_descr .= $line; - } - $descr = $new_descr; - } - - $raw_capacity = $data['prtMarkerSuppliesMaxCapacity']; - $raw_toner = $data['prtMarkerSuppliesLevel']; - $toner_oid = ".1.3.6.1.2.1.43.11.1.1.9.$index"; - $capacity_oid = ".1.3.6.1.2.1.43.11.1.1.8.$index"; - - if (empty($raw_toner)) { - $toner_oid = ".1.3.6.1.4.1.367.3.2.1.2.24.1.1.5.$last_index"; - $raw_toner = snmp_get($device, $toner_oid, '-Oqv'); - } - - if (empty($raw_toner)) { - $raw_toner = snmp_get($device, $toner_oid, '-Oqv'); - } - - if (empty($descr)) { - $descr_oid = ".1.3.6.1.4.1.367.3.2.1.2.24.1.1.3.$last_index"; - $descr = snmp_get($device, $descr_oid, '-Oqva'); - } - - // trim part & serial number from devices that include it - if (Str::contains($descr, ', PN')) { - $descr = explode(', PN', $descr)[0]; - } - - $capacity = get_toner_capacity($data['prtMarkerSuppliesMaxCapacity']); - $current = get_toner_levels($device, $raw_toner, $capacity); - - if (is_numeric($current)) { - discover_toner( - $valid_toner, - $device, - $toner_oid, - $last_index, - $data['prtMarkerSuppliesType'] ?: 'markerSupply', - $descr, - $capacity_oid, - $capacity, - $current - ); - } - } - echo PHP_EOL; - - echo 'Tray Paper Level: '; - $tray_oids = snmpwalk_cache_oid($device, 'prtInputName', [], 'Printer-MIB'); - if (! empty($tray_oids)) { - $tray_oids = snmpwalk_cache_oid($device, 'prtInputCurrentLevel', $tray_oids, 'Printer-MIB'); - $tray_oids = snmpwalk_cache_oid($device, 'prtInputMaxCapacity', $tray_oids, 'Printer-MIB'); - } - - d_echo($tray_oids); - foreach ($tray_oids as $index => $data) { - $last_index = substr($index, strrpos($index, '.') + 1); - - $capacity = $data['prtInputMaxCapacity']; - $current = $data['prtInputCurrentLevel']; - if (! is_numeric($current) || $current == -2) { - // capacity unsupported - d_echo('Input Capacity unsupported', 'X'); - continue; - } elseif ($current == -3) { - // at least one piece of paper in tray - $current = 50; - } else { - $current = $current / $capacity * 100; - } - - discover_toner( - $valid_toner, - $device, - ".1.3.6.1.2.1.43.8.2.1.10.$index", - $last_index, - 'input', - $data['prtInputName'], - ".1.3.6.1.2.1.43.8.2.1.9.$index", - $capacity, - $current - ); - } -} - -// Delete removed toners -d_echo("\n Checking valid toner ... \n"); -d_echo($valid_toner); - -$toners = dbFetchRows('SELECT * FROM toner WHERE device_id = ?', [$device['device_id']]); -//d_echo($toners); -foreach ($toners as $test_toner) { - $toner_oid = $test_toner['toner_oid']; - $toner_type = $test_toner['toner_type']; - if (! $valid_toner[$toner_type][$toner_oid]) { - echo '-'; - dbDelete('toner', '`toner_id` = ?', [$test_toner['toner_id']]); - } -} - -unset($valid_toner, $line, $new_descr); -echo PHP_EOL; diff --git a/includes/functions.php b/includes/functions.php index 0c866b59a1..7360aab9fc 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1678,52 +1678,6 @@ function q_bridge_bits2indices($hex_data) return $indices; } -/** - * @param array $device - * @param int|string $raw_value The value returned from snmp - * @param int $capacity the normalized capacity - * @return int the toner level as a percentage - */ -function get_toner_levels($device, $raw_value, $capacity) -{ - // -3 means some toner is left - if ($raw_value == '-3') { - return 50; - } - - // -2 means unknown - if ($raw_value == '-2') { - return false; - } - - // -1 mean no restrictions - if ($raw_value == '-1') { - return 0; // FIXME: is 0 what we should return? - } - - // Non-standard snmp values - if ($device['os'] == 'ricoh' || $device['os'] == 'nrg' || $device['os'] == 'lanier') { - if ($raw_value == '-100') { - return 0; - } - } elseif ($device['os'] == 'brother') { - if (! Str::contains($device['hardware'], 'MFC-L8850')) { - switch ($raw_value) { - case '0': - return 100; - case '1': - return 5; - case '2': - return 0; - case '3': - return 1; - } - } - } - - return round($raw_value / $capacity * 100); -} - /** * Intialize global stat arrays */ diff --git a/includes/html/graphs/device/toner.inc.php b/includes/html/graphs/device/toner.inc.php index d55ace47a7..c105e6275a 100644 --- a/includes/html/graphs/device/toner.inc.php +++ b/includes/html/graphs/device/toner.inc.php @@ -6,8 +6,8 @@ $rrd_options .= ' -l 0 -E '; $iter = '1'; $rrd_options .= " COMMENT:'Toner level Cur Min Max\\n'"; -foreach (dbFetchRows('SELECT * FROM toner where device_id = ?', [$device['device_id']]) as $toner) { - $colour = toner2colour($toner['toner_descr'], 100 - $toner['toner_current']); +foreach (dbFetchRows('SELECT * FROM printer_supplies where device_id = ?', [$device['device_id']]) as $toner) { + $colour = toner2colour($toner['supply_descr'], 100 - $toner['supply_current']); if ($colour['left'] == null) { // FIXME generic colour function @@ -46,15 +46,15 @@ foreach (dbFetchRows('SELECT * FROM toner where device_id = ?', [$device['device $hostname = gethostbyid($toner['device_id']); - $descr = safedescr(substr(str_pad($toner['toner_descr'], 16), 0, 16)); - $rrd_filename = rrd_name($device['hostname'], ['toner', $toner['toner_index']]); - $toner_id = $toner['toner_id']; + $descr = safedescr(substr(str_pad($toner['supply_descr'], 16), 0, 16)); + $rrd_filename = rrd_name($device['hostname'], ['toner', $toner['supply_index']]); + $id = $toner['supply_id']; - $rrd_options .= " DEF:toner$toner_id=$rrd_filename:toner:AVERAGE"; - $rrd_options .= " LINE2:toner$toner_id#" . $colour['left'] . ":'" . $descr . "'"; - $rrd_options .= " GPRINT:toner$toner_id:LAST:'%5.0lf%%'"; - $rrd_options .= " GPRINT:toner$toner_id:MIN:'%5.0lf%%'"; - $rrd_options .= " GPRINT:toner$toner_id:MAX:%5.0lf%%\l"; + $rrd_options .= " DEF:toner$id=$rrd_filename:toner:AVERAGE"; + $rrd_options .= " LINE2:toner$id#" . $colour['left'] . ":'" . $descr . "'"; + $rrd_options .= " GPRINT:toner$id:LAST:'%5.0lf%%'"; + $rrd_options .= " GPRINT:toner$id:MIN:'%5.0lf%%'"; + $rrd_options .= " GPRINT:toner$id:MAX:%5.0lf%%\l"; $iter++; }//end foreach diff --git a/includes/html/graphs/toner/auth.inc.php b/includes/html/graphs/toner/auth.inc.php index 032e62ab20..ad3eb3026a 100644 --- a/includes/html/graphs/toner/auth.inc.php +++ b/includes/html/graphs/toner/auth.inc.php @@ -1,14 +1,14 @@ where('device_id', $device['device_id'])->get()->groupBy('toner_type'); +$supplies = \App\Models\PrinterSupply::query()->where('device_id', $device['device_id'])->get()->groupBy('supply_type'); foreach ($supplies as $type => $supply) { if (! empty($supply)) { @@ -13,25 +13,25 @@ foreach ($supplies as $type => $supply) {
'; foreach ($supply as $toner) { - $percent = round($toner['toner_current'], 0); + $percent = round($toner['supply_current'], 0); $total = formatStorage($toner['toner_size']); $free = formatStorage($toner['toner_free']); $used = formatStorage($toner['toner_used']); - $background = toner2colour($toner['toner_descr'], $percent); + $background = toner2colour($toner['supply_descr'], $percent); $graph_array = [ 'height' => 100, 'width' => 210, 'to' => \LibreNMS\Config::get('time.now'), - 'id' => $toner['toner_id'], + 'id' => $toner['supply_id'], 'type' => $graph_type, 'from' => \LibreNMS\Config::get('time.day'), 'legend' => 'no', @@ -42,7 +42,7 @@ foreach ($supplies as $type => $supply) { unset($link_array['height'], $link_array['width'], $link_array['legend']); $link = generate_url($link_array); - $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . ' - ' . $toner['toner_descr']); + $overlib_content = generate_overlib_content($graph_array, $device['hostname'] . ' - ' . $toner['supply_descr']); $graph_array['width'] = 80; $graph_array['height'] = 20; @@ -51,7 +51,7 @@ foreach ($supplies as $type => $supply) { $minigraph = generate_lazy_graph_tag($graph_array); echo ' - + diff --git a/includes/html/pages/health/toner.inc.php b/includes/html/pages/health/toner.inc.php index 148f8b2804..b93114eea7 100644 --- a/includes/html/pages/health/toner.inc.php +++ b/includes/html/pages/health/toner.inc.php @@ -34,11 +34,11 @@ $pagetitle[] = 'Health :: Toner'; - - + + - +
' . overlib_link($link, $toner['toner_descr'], $overlib_content) . '' . overlib_link($link, $toner['supply_descr'], $overlib_content) . ' ' . overlib_link($link, $minigraph, $overlib_content) . ' ' . overlib_link($link, print_percentage_bar(200, 20, $percent, null, 'ffffff', $background['left'], $percent . '%', 'ffffff', $background['right']), $overlib_content) . '
DeviceTonerTypeTonerType UsedUsageUsage
diff --git a/includes/html/table/toner.inc.php b/includes/html/table/toner.inc.php index e1060c1198..8b422f4249 100644 --- a/includes/html/table/toner.inc.php +++ b/includes/html/table/toner.inc.php @@ -20,15 +20,15 @@ use LibreNMS\Util\StringHelpers; $graph_type = 'toner_usage'; $param = []; -$sql = 'SELECT * FROM `toner` AS S, `devices` AS D WHERE S.device_id = D.device_id'; +$sql = 'SELECT * FROM `printer_supplies` AS S, `devices` AS D WHERE S.device_id = D.device_id'; if (! empty($searchPhrase)) { - $sql .= ' AND (`D`.`hostname` LIKE ? OR `toner_descr` LIKE ?)'; + $sql .= ' AND (`D`.`hostname` LIKE ? OR `supply_descr` LIKE ?)'; $param[] = "%$searchPhrase%"; $param[] = "%$searchPhrase%"; } -$count_sql = 'SELECT COUNT(*) FROM `toner`'; +$count_sql = 'SELECT COUNT(*) FROM `printer_supplies`'; // FIXME not restricted to device access $count = dbFetchCell($count_sql, $param); @@ -37,10 +37,10 @@ if (empty($count)) { } if (empty($sort)) { - $sort = '`D`.`hostname`, `toner_descr`'; + $sort = '`D`.`hostname`, `supply_descr`'; } else { // toner_used is an alias for toner_perc - $sort = str_replace('toner_used', 'toner_current', $sort); + $sort = str_replace('toner_used', 'supply_current', $sort); } $sql .= " ORDER BY $sort"; @@ -56,11 +56,11 @@ if ($rowCount != -1) { foreach (dbFetchRows($sql, $param) as $toner) { if (device_permitted($toner['device_id'])) { - $perc = $toner['toner_current']; - $type = $toner['toner_type']; + $perc = $toner['supply_current']; + $type = $toner['supply_type']; $graph_array['type'] = $graph_type; - $graph_array['id'] = $toner['toner_id']; + $graph_array['id'] = $toner['supply_id']; $graph_array['from'] = \LibreNMS\Config::get('time.day'); $graph_array['to'] = \LibreNMS\Config::get('time.now'); $graph_array['height'] = '20'; @@ -75,18 +75,18 @@ foreach (dbFetchRows($sql, $param) as $toner) { $response[] = [ 'hostname' => generate_device_link($toner), - 'toner_descr' => $toner['toner_descr'], + 'supply_descr' => $toner['supply_descr'], 'graph' => $mini_graph, 'toner_used' => $bar_link, - 'toner_type' => StringHelpers::camelToTitle($type == 'opc' ? 'organicPhotoConductor' : $type), - 'toner_current' => $perc . '%', + 'supply_type' => StringHelpers::camelToTitle($type == 'opc' ? 'organicPhotoConductor' : $type), + 'supply_current' => $perc . '%', ]; if ($vars['view'] == 'graphs') { $graph_array['height'] = '100'; $graph_array['width'] = '216'; $graph_array['to'] = \LibreNMS\Config::get('time.now'); - $graph_array['id'] = $toner['toner_id']; + $graph_array['id'] = $toner['supply_id']; $graph_array['type'] = $graph_type; $return_data = true; include 'includes/html/print-graphrow.inc.php'; diff --git a/includes/polling/printer-supplies.inc.php b/includes/polling/printer-supplies.inc.php new file mode 100644 index 0000000000..1f3eb4820f --- /dev/null +++ b/includes/polling/printer-supplies.inc.php @@ -0,0 +1,26 @@ +. + * + * @link https://www.librenms.org + */ + +use LibreNMS\OS; + +if (! $os instanceof OS) { + $os = OS::make($device); +} +(new \LibreNMS\Modules\PrinterSupplies())->poll($os); diff --git a/includes/polling/toner.inc.php b/includes/polling/toner.inc.php deleted file mode 100644 index 00ce372b58..0000000000 --- a/includes/polling/toner.inc.php +++ /dev/null @@ -1,33 +0,0 @@ - RrdDefinition::make()->addDataset('toner', 'GAUGE', 0, 20000), - 'rrd_name' => ['toner', $toner['toner_index']], - 'rrd_oldname' => ['toner', $toner['toner_descr']], - 'index' => $toner['toner_index'], - ]; - data_update($device, 'toner', $tags, $tonerperc); - - // Log empty supplies (but only once) - if ($tonerperc == 0 && $toner['toner_current'] > 0) { - log_event('Toner ' . $toner['toner_descr'] . ' is empty', $device, 'toner', 5, $toner['toner_id']); - } - - // Log toner swap - if ($tonerperc > $toner['toner_current']) { - log_event('Toner ' . $toner['toner_descr'] . ' was replaced (new level: ' . $tonerperc . '%)', $device, 'toner', 3, $toner['toner_id']); - } - - dbUpdate(['toner_current' => $tonerperc, 'toner_capacity' => $toner['toner_capacity']], 'toner', '`toner_id` = ?', [$toner['toner_id']]); -}//end foreach diff --git a/misc/config_definitions.json b/misc/config_definitions.json index b20d1ffcc6..64f1c0db1e 100644 --- a/misc/config_definitions.json +++ b/misc/config_definitions.json @@ -1165,7 +1165,7 @@ "default": false, "type": "boolean" }, - "discovery_modules.toner": { + "discovery_modules.printer-supplies": { "order": 320, "group": "discovery", "section": "discovery_modules", @@ -4255,7 +4255,7 @@ "default": false, "type": "boolean" }, - "poller_modules.toner": { + "poller_modules.printer-supplies": { "order": 390, "group": "poller", "section": "poller_modules", diff --git a/misc/db_schema.yaml b/misc/db_schema.yaml index 2f503ed7d8..adbf326b83 100644 --- a/misc/db_schema.yaml +++ b/misc/db_schema.yaml @@ -1916,20 +1916,6 @@ tnmsneinfo: PRIMARY: { Name: PRIMARY, Columns: [id], Unique: true, Type: BTREE } tnmsneinfo_device_id_index: { Name: tnmsneinfo_device_id_index, Columns: [device_id], Unique: false, Type: BTREE } tnmsneinfo_neid_index: { Name: tnmsneinfo_neid_index, Columns: [neID], Unique: false, Type: BTREE } -toner: - Columns: - - { Field: toner_id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } - - { Field: device_id, Type: 'int unsigned', 'Null': false, Extra: '', Default: '0' } - - { Field: toner_index, Type: int, 'Null': false, Extra: '' } - - { Field: toner_type, Type: varchar(64), 'Null': false, Extra: '' } - - { Field: toner_oid, Type: varchar(64), 'Null': false, Extra: '' } - - { Field: toner_descr, Type: varchar(32), 'Null': false, Extra: '', Default: '' } - - { Field: toner_capacity, Type: int, 'Null': false, Extra: '', Default: '0' } - - { Field: toner_current, Type: int, 'Null': false, Extra: '', Default: '0' } - - { Field: toner_capacity_oid, Type: varchar(64), 'Null': true, Extra: '' } - Indexes: - PRIMARY: { Name: PRIMARY, Columns: [toner_id], Unique: true, Type: BTREE } - toner_device_id_index: { Name: toner_device_id_index, Columns: [device_id], Unique: false, Type: BTREE } transport_group_transport: Columns: - { Field: id, Type: 'bigint unsigned', 'Null': false, Extra: auto_increment } @@ -2081,3 +2067,17 @@ wireless_sensors: wireless_sensors_sensor_type_index: { Name: wireless_sensors_sensor_type_index, Columns: [sensor_type], Unique: false, Type: BTREE } Constraints: wireless_sensors_device_id_foreign: { name: wireless_sensors_device_id_foreign, foreign_key: device_id, table: devices, key: device_id, extra: 'ON DELETE CASCADE' } +printer_supplies: + Columns: + - { Field: supply_id, Type: 'int unsigned', 'Null': false, Extra: auto_increment } + - { Field: device_id, Type: 'int unsigned', 'Null': false, Extra: '', Default: '0' } + - { Field: supply_index, Type: int, 'Null': false, Extra: '' } + - { Field: supply_type, Type: varchar(64), 'Null': false, Extra: '' } + - { Field: supply_oid, Type: varchar(64), 'Null': false, Extra: '' } + - { Field: supply_descr, Type: varchar(255), 'Null': false, Extra: '', Default: '' } + - { Field: supply_capacity, Type: int, 'Null': false, Extra: '', Default: '0' } + - { Field: supply_current, Type: int, 'Null': false, Extra: '', Default: '0' } + - { Field: supply_capacity_oid, Type: varchar(64), 'Null': true, Extra: '' } + Indexes: + PRIMARY: { Name: PRIMARY, Columns: [supply_id], Unique: true, Type: BTREE } + toner_device_id_index: { Name: toner_device_id_index, Columns: [device_id], Unique: false, Type: BTREE } diff --git a/misc/os_schema.json b/misc/os_schema.json index 8a8f47b7be..ab139c4fa6 100644 --- a/misc/os_schema.json +++ b/misc/os_schema.json @@ -168,7 +168,7 @@ "mib": { "type": "boolean" }, - "toner": { + "printer-supplies": { "type": "boolean" }, "cisco-vpdn": { @@ -288,7 +288,7 @@ "arp-table": { "type": "boolean" }, - "toner": { + "printer-supplies": { "type": "boolean" }, "ipv4-addresses": { diff --git a/tests/data/brother.json b/tests/data/brother.json index 355bdee35e..33983bbe4b 100644 --- a/tests/data/brother.json +++ b/tests/data/brother.json @@ -1082,53 +1082,53 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Toner Cartridge", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Toner Cartridge", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 2, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Drum Unit", - "toner_capacity": 12000, - "toner_current": 96, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Drum Unit", + "supply_capacity": 12000, + "supply_current": 96, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 1, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", - "toner_descr": "AUTO", - "toner_capacity": 250, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" + "supply_index": 1, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", + "supply_descr": "AUTO", + "supply_capacity": 250, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" }, { - "toner_index": 2, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", - "toner_descr": "MANUAL TRAY", - "toner_capacity": 1, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" + "supply_index": 2, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", + "supply_descr": "MANUAL TRAY", + "supply_capacity": 1, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" }, { - "toner_index": 3, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", - "toner_descr": "TRAY1", - "toner_capacity": 250, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" + "supply_index": 3, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", + "supply_descr": "TRAY1", + "supply_capacity": 250, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" } ] }, diff --git a/tests/data/canonprinter_lbp.json b/tests/data/canonprinter_lbp.json index b058aada17..07adaa1f2d 100644 --- a/tests/data/canonprinter_lbp.json +++ b/tests/data/canonprinter_lbp.json @@ -485,17 +485,17 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Canon Cartridge 719/719H", - "toner_capacity": 100, - "toner_current": 70, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Canon Cartridge 719/719H", + "supply_capacity": 100, + "supply_current": 70, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" } ] }, diff --git a/tests/data/dell-laser_s5830dn.json b/tests/data/dell-laser_s5830dn.json index 7c1d3a85ca..c43181f399 100644 --- a/tests/data/dell-laser_s5830dn.json +++ b/tests/data/dell-laser_s5830dn.json @@ -672,80 +672,80 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Toner", - "toner_capacity": 45000, - "toner_current": 49, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Toner", + "supply_capacity": 45000, + "supply_current": 49, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 2, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Imaging Unit", - "toner_capacity": 100000, - "toner_current": 72, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Imaging Unit", + "supply_capacity": 100000, + "supply_current": 72, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "other", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Maintenance Kit", - "toner_capacity": 200000, - "toner_current": 83, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "other", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Maintenance Kit", + "supply_capacity": 200000, + "supply_current": 83, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "other", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Roller Kit", - "toner_capacity": 300000, - "toner_current": 89, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "other", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Roller Kit", + "supply_capacity": 300000, + "supply_current": 89, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 1, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", - "toner_descr": "Tray 1", - "toner_capacity": 550, - "toner_current": 100, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" + "supply_index": 1, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", + "supply_descr": "Tray 1", + "supply_capacity": 550, + "supply_current": 100, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" }, { - "toner_index": 2, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", - "toner_descr": "Manual Envelope", - "toner_capacity": 1, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" + "supply_index": 2, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", + "supply_descr": "Manual Envelope", + "supply_capacity": 1, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" }, { - "toner_index": 3, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", - "toner_descr": "Manual Paper", - "toner_capacity": 1, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" + "supply_index": 3, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", + "supply_descr": "Manual Paper", + "supply_capacity": 1, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" }, { - "toner_index": 4, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.4", - "toner_descr": "MP Tray", - "toner_capacity": 100, - "toner_current": 0, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.4" + "supply_index": 4, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.4", + "supply_descr": "MP Tray", + "supply_capacity": 100, + "supply_current": 0, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.4" } ] }, diff --git a/tests/data/epson.json b/tests/data/epson.json index 2e32c6979e..aa45ebc707 100644 --- a/tests/data/epson.json +++ b/tests/data/epson.json @@ -339,44 +339,44 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "ink", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Ink Supply Unit T9441/T945", - "toner_capacity": 100, - "toner_current": 1, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "ink", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Ink Supply Unit T9441/T9451/T9461", + "supply_capacity": 100, + "supply_current": 1, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 2, - "toner_type": "ink", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Cyan Ink Supply Unit T9442/T9452", - "toner_capacity": 100, - "toner_current": 1, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "ink", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Cyan Ink Supply Unit T9442/T9452", + "supply_capacity": 100, + "supply_current": 1, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "ink", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Magenta Ink Supply Unit T9443/T9", - "toner_capacity": 100, - "toner_current": 1, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "ink", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Magenta Ink Supply Unit T9443/T9453", + "supply_capacity": 100, + "supply_current": 1, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "ink", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Yellow Ink Supply Unit T9444/T94", - "toner_capacity": 100, - "toner_current": 1, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "ink", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Yellow Ink Supply Unit T9444/T9454", + "supply_capacity": 100, + "supply_current": 1, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" } ] }, diff --git a/tests/data/jetdirect.json b/tests/data/jetdirect.json index 001d3fcdf1..7d9bb324c3 100644 --- a/tests/data/jetdirect.json +++ b/tests/data/jetdirect.json @@ -20,44 +20,44 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Cartridge HP CF410A", - "toner_capacity": 100, - "toner_current": 54, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Cartridge HP CF410A", + "supply_capacity": 100, + "supply_current": 54, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 2, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Cyan Cartridge HP CF411A", - "toner_capacity": 100, - "toner_current": 44, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Cyan Cartridge HP CF411A", + "supply_capacity": 100, + "supply_current": 44, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Magenta Cartridge HP CF413A This", - "toner_capacity": 100, - "toner_current": 76, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Magenta Cartridge HP CF413A This description is longer than 32", + "supply_capacity": 100, + "supply_current": 76, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Yellow Cartridge HP CF412A", - "toner_capacity": 100, - "toner_current": 71, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Yellow Cartridge HP CF412A", + "supply_capacity": 100, + "supply_current": 71, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" } ] }, diff --git a/tests/data/jetdirect_m252dw.json b/tests/data/jetdirect_m252dw.json index 6ef175d75d..437d268005 100644 --- a/tests/data/jetdirect_m252dw.json +++ b/tests/data/jetdirect_m252dw.json @@ -1082,53 +1082,53 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Cartridge HP CF400X", - "toner_capacity": 100, - "toner_current": 63, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Cartridge HP CF400X", + "supply_capacity": 100, + "supply_current": 63, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 2, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Cyan Cartridge HP CF401X", - "toner_capacity": 100, - "toner_current": 63, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Cyan Cartridge HP CF401X", + "supply_capacity": 100, + "supply_current": 63, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Magenta Cartridge HP CF403X", - "toner_capacity": 100, - "toner_current": 88, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Magenta Cartridge HP CF403X", + "supply_capacity": 100, + "supply_current": 88, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Yellow Cartridge HP CF402X", - "toner_capacity": 100, - "toner_current": 36, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Yellow Cartridge HP CF402X", + "supply_capacity": 100, + "supply_current": 36, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 2, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", - "toner_descr": "Tray 2", - "toner_capacity": 150, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" + "supply_index": 2, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", + "supply_descr": "Tray 2", + "supply_capacity": 150, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" } ] }, diff --git a/tests/data/jetdirect_m880.json b/tests/data/jetdirect_m880.json index aa94431983..4e1fe52ace 100644 --- a/tests/data/jetdirect_m880.json +++ b/tests/data/jetdirect_m880.json @@ -627,179 +627,179 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "tonerCartridge", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Cartridge827A HP CF300A", - "toner_capacity": 100, - "toner_current": 92, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "tonerCartridge", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Cartridge827A HP CF300A", + "supply_capacity": 100, + "supply_current": 92, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 10, - "toner_type": "fuser", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", - "toner_descr": "Fuser Kit HP 110V-C1N54A, 220V-C", - "toner_capacity": 100, - "toner_current": 84, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" + "supply_index": 10, + "supply_type": "fuser", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", + "supply_descr": "Fuser Kit HP 110V-C1N54A, 220V-C1N58A", + "supply_capacity": 100, + "supply_current": 84, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" }, { - "toner_index": 11, - "toner_type": "other", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.11", - "toner_descr": "Document FeederKit HP C1P70A", - "toner_capacity": 100, - "toner_current": 99, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.11" + "supply_index": 11, + "supply_type": "other", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.11", + "supply_descr": "Document FeederKit HP C1P70A", + "supply_capacity": 100, + "supply_current": 99, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.11" }, { - "toner_index": 12, - "toner_type": "other", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.12", - "toner_descr": "Clean Rollers HP None", - "toner_capacity": 100, - "toner_current": 97, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.12" + "supply_index": 12, + "supply_type": "other", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.12", + "supply_descr": "Clean Rollers HP None", + "supply_capacity": 100, + "supply_current": 97, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.12" }, { - "toner_index": 13, - "toner_type": "staples", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.13", - "toner_descr": "Stapler 1 HP C8091A", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.13" + "supply_index": 13, + "supply_type": "staples", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.13", + "supply_descr": "Stapler 1 HP C8091A", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.13" }, { - "toner_index": 14, - "toner_type": "staples", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.14", - "toner_descr": "Stapler 2 HP CC383A", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.14" + "supply_index": 14, + "supply_type": "staples", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.14", + "supply_descr": "Stapler 2 HP CC383A", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.14" }, { - "toner_index": 15, - "toner_type": "staples", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.15", - "toner_descr": "Stapler 3 HP CC383A", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.15" + "supply_index": 15, + "supply_type": "staples", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.15", + "supply_descr": "Stapler 3 HP CC383A", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.15" }, { - "toner_index": 2, - "toner_type": "tonerCartridge", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Cyan Cartridge 827A HP CF301A", - "toner_capacity": 100, - "toner_current": 16, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "tonerCartridge", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Cyan Cartridge 827A HP CF301A", + "supply_capacity": 100, + "supply_current": 16, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "tonerCartridge", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Magenta Cartridge 827A HP CF303A", - "toner_capacity": 100, - "toner_current": 100, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "tonerCartridge", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Magenta Cartridge 827A HP CF303A", + "supply_capacity": 100, + "supply_current": 100, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "tonerCartridge", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Yellow Cartridge 827A HP CF302A", - "toner_capacity": 100, - "toner_current": 70, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "tonerCartridge", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Yellow Cartridge 827A HP CF302A", + "supply_capacity": 100, + "supply_current": 70, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 5, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", - "toner_descr": "Black Drum 828AHP CF358A", - "toner_capacity": 100, - "toner_current": 53, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" + "supply_index": 5, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", + "supply_descr": "Black Drum 828AHP CF358A", + "supply_capacity": 100, + "supply_current": 53, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" }, { - "toner_index": 6, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", - "toner_descr": "Cyan Drum 828A HP CF359A", - "toner_capacity": 100, - "toner_current": 58, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" + "supply_index": 6, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", + "supply_descr": "Cyan Drum 828A HP CF359A", + "supply_capacity": 100, + "supply_current": 58, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" }, { - "toner_index": 7, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", - "toner_descr": "Magenta Drum 828A HP CF365A", - "toner_capacity": 100, - "toner_current": 58, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" + "supply_index": 7, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", + "supply_descr": "Magenta Drum 828A HP CF365A", + "supply_capacity": 100, + "supply_current": 58, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" }, { - "toner_index": 8, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", - "toner_descr": "Yellow Drum 828A HP CF364A", - "toner_capacity": 100, - "toner_current": 58, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" + "supply_index": 8, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", + "supply_descr": "Yellow Drum 828A HP CF364A", + "supply_capacity": 100, + "supply_current": 58, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" }, { - "toner_index": 9, - "toner_type": "transferUnit", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", - "toner_descr": "Transfer Kit HPD7H14A", - "toner_capacity": 100, - "toner_current": 89, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" + "supply_index": 9, + "supply_type": "transferUnit", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", + "supply_descr": "Transfer Kit HPD7H14A", + "supply_capacity": 100, + "supply_current": 89, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" }, { - "toner_index": 1, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", - "toner_descr": "Tray 1", - "toner_capacity": 100, - "toner_current": 0, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" + "supply_index": 1, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", + "supply_descr": "Tray 1", + "supply_capacity": 100, + "supply_current": 0, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" }, { - "toner_index": 2, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", - "toner_descr": "Tray 2", - "toner_capacity": 500, - "toner_current": 40, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" + "supply_index": 2, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", + "supply_descr": "Tray 2", + "supply_capacity": 500, + "supply_current": 40, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" }, { - "toner_index": 3, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", - "toner_descr": "Tray 3", - "toner_capacity": 1500, - "toner_current": 20, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" + "supply_index": 3, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", + "supply_descr": "Tray 3", + "supply_capacity": 1500, + "supply_current": 20, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" }, { - "toner_index": 5, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.5", - "toner_descr": "Tray 4", - "toner_capacity": 2000, - "toner_current": 20, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.5" + "supply_index": 5, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.5", + "supply_descr": "Tray 4", + "supply_capacity": 2000, + "supply_current": 20, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.5" } ] }, diff --git a/tests/data/konica.json b/tests/data/konica.json index d8a2049f12..2bee2f79eb 100644 --- a/tests/data/konica.json +++ b/tests/data/konica.json @@ -553,161 +553,161 @@ ] } }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Toner (Cyan)", - "toner_capacity": 100, - "toner_current": 29, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Toner (Cyan)", + "supply_capacity": 100, + "supply_current": 29, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 10, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", - "toner_descr": "Developer Cartridge (Yellow)", - "toner_capacity": 100, - "toner_current": 78, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" + "supply_index": 10, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", + "supply_descr": "Developer Cartridge (Yellow)", + "supply_capacity": 100, + "supply_current": 78, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" }, { - "toner_index": 11, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.11", - "toner_descr": "Drum Cartridge (Black)", - "toner_capacity": 100, - "toner_current": 20, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.11" + "supply_index": 11, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.11", + "supply_descr": "Drum Cartridge (Black)", + "supply_capacity": 100, + "supply_current": 20, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.11" }, { - "toner_index": 12, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.12", - "toner_descr": "Developer Cartridge (Black)", - "toner_capacity": 100, - "toner_current": 71, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.12" + "supply_index": 12, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.12", + "supply_descr": "Developer Cartridge (Black)", + "supply_capacity": 100, + "supply_current": 71, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.12" }, { - "toner_index": 13, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.13", - "toner_descr": "Waste Toner Box", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.13" + "supply_index": 13, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.13", + "supply_descr": "Waste Toner Box", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.13" }, { - "toner_index": 14, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.14", - "toner_descr": "Fusing Unit", - "toner_capacity": 100, - "toner_current": 68, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.14" + "supply_index": 14, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.14", + "supply_descr": "Fusing Unit", + "supply_capacity": 100, + "supply_current": 68, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.14" }, { - "toner_index": 15, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.15", - "toner_descr": "Image Transfer Belt Unit", - "toner_capacity": 100, - "toner_current": 41, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.15" + "supply_index": 15, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.15", + "supply_descr": "Image Transfer Belt Unit", + "supply_capacity": 100, + "supply_current": 41, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.15" }, { - "toner_index": 16, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.16", - "toner_descr": "Transfer Roller Unit", - "toner_capacity": 100, - "toner_current": 45, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.16" + "supply_index": 16, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.16", + "supply_descr": "Transfer Roller Unit", + "supply_capacity": 100, + "supply_current": 45, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.16" }, { - "toner_index": 17, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.17", - "toner_descr": "Ozone Filter", - "toner_capacity": 100, - "toner_current": 45, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.17" + "supply_index": 17, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.17", + "supply_descr": "Ozone Filter", + "supply_capacity": 100, + "supply_current": 45, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.17" }, { - "toner_index": 2, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Toner (Magenta)", - "toner_capacity": 100, - "toner_current": 31, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Toner (Magenta)", + "supply_capacity": 100, + "supply_current": 31, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Toner (Yellow)", - "toner_capacity": 100, - "toner_current": 58, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Toner (Yellow)", + "supply_capacity": 100, + "supply_current": 58, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Toner (Black)", - "toner_capacity": 100, - "toner_current": 83, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Toner (Black)", + "supply_capacity": 100, + "supply_current": 83, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 5, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", - "toner_descr": "Drum Cartridge (Cyan)", - "toner_capacity": 100, - "toner_current": 59, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" + "supply_index": 5, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", + "supply_descr": "Drum Cartridge (Cyan)", + "supply_capacity": 100, + "supply_current": 59, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" }, { - "toner_index": 6, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", - "toner_descr": "Developer Cartridge (Cyan)", - "toner_capacity": 100, - "toner_current": 79, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" + "supply_index": 6, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", + "supply_descr": "Developer Cartridge (Cyan)", + "supply_capacity": 100, + "supply_current": 79, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" }, { - "toner_index": 7, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", - "toner_descr": "Drum Cartridge (Magenta)", - "toner_capacity": 100, - "toner_current": 97, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" + "supply_index": 7, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", + "supply_descr": "Drum Cartridge (Magenta)", + "supply_capacity": 100, + "supply_current": 97, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" }, { - "toner_index": 8, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", - "toner_descr": "Developer Cartridge (Magenta)", - "toner_capacity": 100, - "toner_current": 78, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" + "supply_index": 8, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", + "supply_descr": "Developer Cartridge (Magenta)", + "supply_capacity": 100, + "supply_current": 78, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" }, { - "toner_index": 9, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", - "toner_descr": "Drum Cartridge (Yellow)", - "toner_capacity": 100, - "toner_current": 59, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" + "supply_index": 9, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", + "supply_descr": "Drum Cartridge (Yellow)", + "supply_capacity": 100, + "supply_current": 59, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" } ] }, diff --git a/tests/data/konica_2.json b/tests/data/konica_2.json index d12f554493..44ff1f6ef3 100644 --- a/tests/data/konica_2.json +++ b/tests/data/konica_2.json @@ -440,62 +440,62 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Toner", - "toner_capacity": 100, - "toner_current": 8, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Toner", + "supply_capacity": 100, + "supply_current": 8, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 2, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Drum", - "toner_capacity": 100, - "toner_current": 99, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Drum", + "supply_capacity": 100, + "supply_current": 99, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "fuser", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Fuser", - "toner_capacity": 100, - "toner_current": 58, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "fuser", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Fuser", + "supply_capacity": 100, + "supply_current": 58, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "transferUnit", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Transfer Roller", - "toner_capacity": 100, - "toner_current": 58, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "transferUnit", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Transfer Roller", + "supply_capacity": 100, + "supply_current": 58, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 1, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", - "toner_descr": "1st Cassette", - "toner_capacity": 500, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" + "supply_index": 1, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", + "supply_descr": "1st Cassette", + "supply_capacity": 500, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" }, { - "toner_index": 2, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", - "toner_descr": "Bypass", - "toner_capacity": 100, - "toner_current": 0, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" + "supply_index": 2, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", + "supply_descr": "Bypass", + "supply_capacity": 100, + "supply_current": 0, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" } ] }, diff --git a/tests/data/okilan_9450g.json b/tests/data/okilan_9450g.json index fcd2640d35..686e430913 100644 --- a/tests/data/okilan_9450g.json +++ b/tests/data/okilan_9450g.json @@ -413,125 +413,125 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Toner Cartridge OKI DATA C", - "toner_capacity": 100, - "toner_current": 59, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Toner Cartridge OKI DATA CORP", + "supply_capacity": 100, + "supply_current": 59, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 10, - "toner_type": "fuser", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", - "toner_descr": "Fuser Unit OKI DATA CORP", - "toner_capacity": 100000, - "toner_current": 99, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" + "supply_index": 10, + "supply_type": "fuser", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", + "supply_descr": "Fuser Unit OKI DATA CORP", + "supply_capacity": 100000, + "supply_current": 99, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" }, { - "toner_index": 2, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Cyan Toner Cartridge OKI DATA CO", - "toner_capacity": 100, - "toner_current": 69, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Cyan Toner Cartridge OKI DATA CORP", + "supply_capacity": 100, + "supply_current": 69, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Magenta Toner Cartridge OKI DATA", - "toner_capacity": 100, - "toner_current": 69, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Magenta Toner Cartridge OKI DATA CORP", + "supply_capacity": 100, + "supply_current": 69, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Yellow Toner Cartridge OKI DATA ", - "toner_capacity": 100, - "toner_current": 69, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Yellow Toner Cartridge OKI DATA CORP", + "supply_capacity": 100, + "supply_current": 69, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 5, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", - "toner_descr": "Black Image Drum Unit OKI DATA C", - "toner_capacity": 30000, - "toner_current": 95, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" + "supply_index": 5, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", + "supply_descr": "Black Image Drum Unit OKI DATA CORP", + "supply_capacity": 30000, + "supply_current": 95, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" }, { - "toner_index": 6, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", - "toner_descr": "Cyan Image Drum Unit OKI DATA CO", - "toner_capacity": 30000, - "toner_current": 96, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" + "supply_index": 6, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", + "supply_descr": "Cyan Image Drum Unit OKI DATA CORP", + "supply_capacity": 30000, + "supply_current": 96, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" }, { - "toner_index": 7, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", - "toner_descr": "Magenta Image Drum Unit OKI DATA", - "toner_capacity": 30000, - "toner_current": 96, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" + "supply_index": 7, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", + "supply_descr": "Magenta Image Drum Unit OKI DATA CORP", + "supply_capacity": 30000, + "supply_current": 96, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" }, { - "toner_index": 8, - "toner_type": "opc", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", - "toner_descr": "Yellow Image Drum Unit OKI DATA ", - "toner_capacity": 30000, - "toner_current": 96, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" + "supply_index": 8, + "supply_type": "opc", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", + "supply_descr": "Yellow Image Drum Unit OKI DATA CORP", + "supply_capacity": 30000, + "supply_current": 96, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" }, { - "toner_index": 9, - "toner_type": "transferUnit", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", - "toner_descr": "Belt Unit OKI DATA CORP", - "toner_capacity": 80000, - "toner_current": 98, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" + "supply_index": 9, + "supply_type": "transferUnit", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", + "supply_descr": "Belt Unit OKI DATA CORP", + "supply_capacity": 80000, + "supply_current": 98, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" }, { - "toner_index": 1, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", - "toner_descr": "TRAY1", - "toner_capacity": 300, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" + "supply_index": 1, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", + "supply_descr": "TRAY1", + "supply_capacity": 300, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" }, { - "toner_index": 2, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", - "toner_descr": "MPTRAY", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" + "supply_index": 2, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", + "supply_descr": "MPTRAY", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" }, { - "toner_index": 3, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", - "toner_descr": "TRAY2", - "toner_capacity": 530, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" + "supply_index": 3, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", + "supply_descr": "TRAY2", + "supply_capacity": 530, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" } ] }, diff --git a/tests/data/ricoh_mpc3002.json b/tests/data/ricoh_mpc3002.json index f660c2104d..b8c77fe3b9 100644 --- a/tests/data/ricoh_mpc3002.json +++ b/tests/data/ricoh_mpc3002.json @@ -933,98 +933,98 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Toner", - "toner_capacity": 100, - "toner_current": 40, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Toner", + "supply_capacity": 100, + "supply_current": 40, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 2, - "toner_type": "wasteToner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Waste Toner", - "toner_capacity": 100, - "toner_current": 100, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "wasteToner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Waste Toner", + "supply_capacity": 100, + "supply_current": 100, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Cyan Toner", - "toner_capacity": 100, - "toner_current": 20, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Cyan Toner", + "supply_capacity": 100, + "supply_current": 20, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Magenta Toner", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Magenta Toner", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 5, - "toner_type": "toner", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", - "toner_descr": "Yellow Toner", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" + "supply_index": 5, + "supply_type": "toner", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", + "supply_descr": "Yellow Toner", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" }, { - "toner_index": 1, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", - "toner_descr": "Tray 1", - "toner_capacity": 550, - "toner_current": 10, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" + "supply_index": 1, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.1", + "supply_descr": "Tray 1", + "supply_capacity": 550, + "supply_current": 10, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.1" }, { - "toner_index": 2, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", - "toner_descr": "Tray 2", - "toner_capacity": 550, - "toner_current": 10, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" + "supply_index": 2, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.2", + "supply_descr": "Tray 2", + "supply_capacity": 550, + "supply_current": 10, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.2" }, { - "toner_index": 3, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", - "toner_descr": "Tray 3", - "toner_capacity": 550, - "toner_current": 10, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" + "supply_index": 3, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.3", + "supply_descr": "Tray 3", + "supply_capacity": 550, + "supply_current": 10, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.3" }, { - "toner_index": 4, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.4", - "toner_descr": "Tray 4", - "toner_capacity": 550, - "toner_current": 0, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.4" + "supply_index": 4, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.4", + "supply_descr": "Tray 4", + "supply_capacity": 550, + "supply_current": 0, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.4" }, { - "toner_index": 5, - "toner_type": "input", - "toner_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.5", - "toner_descr": "Bypass Tray", - "toner_capacity": 100, - "toner_current": 0, - "toner_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.5" + "supply_index": 5, + "supply_type": "input", + "supply_oid": ".1.3.6.1.2.1.43.8.2.1.10.1.5", + "supply_descr": "Bypass Tray", + "supply_capacity": 100, + "supply_current": 0, + "supply_capacity_oid": ".1.3.6.1.2.1.43.8.2.1.9.1.5" } ] }, diff --git a/tests/data/xerox.json b/tests/data/xerox.json index 7839bb43f3..fe1d74fbc1 100644 --- a/tests/data/xerox.json +++ b/tests/data/xerox.json @@ -20,116 +20,116 @@ }, "poller": "matches discovery" }, - "toner": { + "printer-supplies": { "discovery": { - "toner": [ + "printer_supplies": [ { - "toner_index": 1, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", - "toner_descr": "Black Toner", - "toner_capacity": 5300, - "toner_current": 20, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" + "supply_index": 1, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.1", + "supply_descr": "Black Toner", + "supply_capacity": 5300, + "supply_current": 20, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.1" }, { - "toner_index": 10, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", - "toner_descr": "Waste Toner Container", - "toner_capacity": 100, - "toner_current": 5, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" + "supply_index": 10, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.10", + "supply_descr": "Waste Toner Container", + "supply_capacity": 100, + "supply_current": 5, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.10" }, { - "toner_index": 11, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.11", - "toner_descr": "Transfer Belt Cleaner", - "toner_capacity": 100, - "toner_current": 65, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.11" + "supply_index": 11, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.11", + "supply_descr": "Transfer Belt Cleaner", + "supply_capacity": 100, + "supply_current": 65, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.11" }, { - "toner_index": 12, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.12", - "toner_descr": "Second Bias Transfer Roll", - "toner_capacity": 100, - "toner_current": 86, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.12" + "supply_index": 12, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.12", + "supply_descr": "Second Bias Transfer Roll", + "supply_capacity": 100, + "supply_current": 86, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.12" }, { - "toner_index": 2, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", - "toner_descr": "Cyan Toner", - "toner_capacity": 3000, - "toner_current": 66, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" + "supply_index": 2, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.2", + "supply_descr": "Cyan Toner", + "supply_capacity": 3000, + "supply_current": 66, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.2" }, { - "toner_index": 3, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", - "toner_descr": "Magenta Toner", - "toner_capacity": 3000, - "toner_current": 72, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" + "supply_index": 3, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.3", + "supply_descr": "Magenta Toner", + "supply_capacity": 3000, + "supply_current": 72, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.3" }, { - "toner_index": 4, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", - "toner_descr": "Yellow Toner", - "toner_capacity": 3050, - "toner_current": 60, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" + "supply_index": 4, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.4", + "supply_descr": "Yellow Toner", + "supply_capacity": 3050, + "supply_current": 60, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.4" }, { - "toner_index": 5, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", - "toner_descr": "Drum Cartridge (R1)", - "toner_capacity": 100, - "toner_current": 50, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" + "supply_index": 5, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.5", + "supply_descr": "Drum Cartridge (R1)", + "supply_capacity": 100, + "supply_current": 50, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.5" }, { - "toner_index": 6, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", - "toner_descr": "Drum Cartridge (R2)", - "toner_capacity": 100, - "toner_current": 92, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" + "supply_index": 6, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.6", + "supply_descr": "Drum Cartridge (R2)", + "supply_capacity": 100, + "supply_current": 92, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.6" }, { - "toner_index": 7, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", - "toner_descr": "Drum Cartridge (R3)", - "toner_capacity": 100, - "toner_current": 93, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" + "supply_index": 7, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.7", + "supply_descr": "Drum Cartridge (R3)", + "supply_capacity": 100, + "supply_current": 93, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.7" }, { - "toner_index": 8, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", - "toner_descr": "Drum Cartridge (R4)", - "toner_capacity": 100, - "toner_current": 93, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" + "supply_index": 8, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.8", + "supply_descr": "Drum Cartridge (R4)", + "supply_capacity": 100, + "supply_current": 93, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.8" }, { - "toner_index": 9, - "toner_type": "markerSupply", - "toner_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", - "toner_descr": "Fuser", - "toner_capacity": 100, - "toner_current": 90, - "toner_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" + "supply_index": 9, + "supply_type": "markerSupply", + "supply_oid": ".1.3.6.1.2.1.43.11.1.1.9.1.9", + "supply_descr": "Fuser", + "supply_capacity": 100, + "supply_current": 90, + "supply_capacity_oid": ".1.3.6.1.2.1.43.11.1.1.8.1.9" } ] }, diff --git a/tests/module_tables.yaml b/tests/module_tables.yaml index dc7b48f780..1376f0cd79 100644 --- a/tests/module_tables.yaml +++ b/tests/module_tables.yaml @@ -117,10 +117,10 @@ storage: storage: excluded_fields: [device_id, storage_id] order_by: storage_index, storage_type -toner: - toner: - excluded_fields: [device_id, toner_id] - order_by: toner_oid, toner_index +printer-supplies: + printer_supplies: + excluded_fields: [device_id, supply_id] + order_by: supply_oid, supply_index vlans: vlans: excluded_fields: [vlan_id, device_id]