Tylan / check_snmp_printer

Icinga Plugin for Checking SNMP Printer Status (Trays, Consumables and Pagecounts)
GNU General Public License v3.0
12 stars 4 forks source link

Decode Hex-STRING #26

Closed michal965245 closed 1 year ago

michal965245 commented 2 years ago

While testing this plugin, I found a problem with decoding the name of a consumable reported by snmp as Hex-STRING. This is example:

[19:41]:~/plugins$ snmpwalk -v 1 -c public 10.0.0.1 .1.3.6.1.2.1.43.11.1.1.6.1.2 iso.3.6.1.2.1.43.11.1.1.6.1.2 = Hex-STRING: 5A 65 73 70 F3 B3 20 6F 62 72 61 7A 2E

and with option -Oa

[19:41]:~/plugins$ snmpwalk -v 1 -c public -Oa 10.0.0.1 .1.3.6.1.2.1.43.11.1.1.6.1.2 iso.3.6.1.2.1.43.11.1.1.6.1.2 = STRING: "Zesp.. obraz."

The plugin decode this as 0x5a657370f3b3206f6272617a2e.

When I add this line: -translate => [-octetstring => 0],

to %snmpargs

the plugin will read this as STRING.

Tylan commented 1 year ago

Hi thanks for this. I've added this to a be included in a future release.