Skip to content

Commit cccf286

Browse files
authored
Printers: don't error on missing prtMarkerCounterUnit (librenms#17847)
* Printers: don't error on missing prtMarkerCounterUnit * Update konica_c250i.json
1 parent cfaef5c commit cccf286

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

includes/discovery/sensors/count/printer.inc.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'.1.3.6.1.2.1.43.10.2.1.4.' . $index, // Printer-MIB::prtMarkerLifeCount.1.1
2323
'prtMarkerLifeCount',
2424
$device['os'],
25-
'Life time ' . ($data['prtMarkerCounterUnit'] ?? null),
25+
'Life time ' . ($data['prtMarkerCounterUnit'] ?? '?'),
2626
1,
2727
1,
2828
null,
@@ -39,7 +39,7 @@
3939
'.1.3.6.1.2.1.43.10.2.1.5.' . $index, // Printer-MIB::prtMarkerPowerOnCount.1.1
4040
'prtMarkerPowerOnCount',
4141
$device['os'],
42-
ucfirst($data['prtMarkerCounterUnit'] ?? null) . ' since powered on',
42+
ucfirst($data['prtMarkerCounterUnit'] ?? '?') . ' since powered on',
4343
1,
4444
1,
4545
null,

tests/data/konica_c250i.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@
529529
"sensor_oid": ".1.3.6.1.2.1.43.10.2.1.4.1.1",
530530
"sensor_index": "prtMarkerLifeCount",
531531
"sensor_type": "konica",
532-
"sensor_descr": "Life time ",
532+
"sensor_descr": "Life time ?",
533533
"group": null,
534534
"sensor_divisor": 1,
535535
"sensor_multiplier": 1,
@@ -554,7 +554,7 @@
554554
"sensor_oid": ".1.3.6.1.2.1.43.10.2.1.5.1.1",
555555
"sensor_index": "prtMarkerPowerOnCount",
556556
"sensor_type": "konica",
557-
"sensor_descr": " since powered on",
557+
"sensor_descr": "? since powered on",
558558
"group": null,
559559
"sensor_divisor": 1,
560560
"sensor_multiplier": 1,
@@ -897,7 +897,7 @@
897897
"sensor_oid": ".1.3.6.1.2.1.43.10.2.1.4.1.1",
898898
"sensor_index": "prtMarkerLifeCount",
899899
"sensor_type": "konica",
900-
"sensor_descr": "Life time ",
900+
"sensor_descr": "Life time ?",
901901
"group": null,
902902
"sensor_divisor": 1,
903903
"sensor_multiplier": 1,
@@ -922,7 +922,7 @@
922922
"sensor_oid": ".1.3.6.1.2.1.43.10.2.1.5.1.1",
923923
"sensor_index": "prtMarkerPowerOnCount",
924924
"sensor_type": "konica",
925-
"sensor_descr": " since powered on",
925+
"sensor_descr": "? since powered on",
926926
"group": null,
927927
"sensor_divisor": 1,
928928
"sensor_multiplier": 1,

0 commit comments

Comments
 (0)