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

Icinga2 Director #12

Closed bumblebee-tgl closed 3 years ago

bumblebee-tgl commented 3 years ago

Hello,

is it possible to receive an how-to to integrate this in Icinga2 Director? I´m a newbe on this section. sorry.

Many Thanks! Have a nice Weekend

Optimaximal commented 3 years ago
bumblebee-tgl commented 3 years ago

Great - that is it! It Works and big Thanks to you! :-D

I´ve a Kyocera Ecosys M5526cdn. The Toner shown as:

OK: TK5240CS is at 75.00% remaining. OK: TK5240KS is at 55.00% remaining. OK: TK5240YS is at 75.00% remaining. OK: TK5240MS is at 77.00% remaining.

But it´s OK -thanks for your Work! :-)

Have a nice Week :-)

Tylan commented 3 years ago

Thanks for the assist Optimaximal :)

I can fix the code to properly report the toner numbers into colors, but if you are able to provide the snmpwalk for the following OIDs that would help:

1.3.6.1.2.1.25.3.2.1.3.1 1.3.6.1.2.1.43

snmpwalk -On -c \<SNMP Community> -v \<SNMP Version> \<Printer IP> \<OID>

so an example:

snmpwalk -On -c public -v 1 192.168.1.200 1.3.6.1.2.1.43

bumblebee-tgl commented 3 years ago

Many Thanks :-) did this help you? .1.3.6.1.2.1.43.11.1.1.6.1.1 = STRING: "TK-5240CS" .1.3.6.1.2.1.43.11.1.1.6.1.2 = STRING: "TK-5240MS" .1.3.6.1.2.1.43.11.1.1.6.1.3 = STRING: "TK-5240YS" .1.3.6.1.2.1.43.11.1.1.6.1.4 = STRING: "TK-5240KS" .1.3.6.1.2.1.43.11.1.1.6.1.5 = STRING: "Waste Toner Box" And .1.3.6.1.2.1.43.12.1.1.4.1.1 = STRING: "cyan" .1.3.6.1.2.1.43.12.1.1.4.1.2 = STRING: "magenta" .1.3.6.1.2.1.43.12.1.1.4.1.3 = STRING: "yellow" .1.3.6.1.2.1.43.12.1.1.4.1.4 = STRING: "black"

Do you more Infos?

BTW: Ist realy interessting to know how is the Wastebox filled :-)

Tylan commented 3 years ago

Great, thanks! I have the wastebox excluded from reporting as I found it to be mostly useless. If it's important to people I can put the reporting for that in.

I'll modify the code to change the TK values to it's color designation and I'll put it in the next release :)

bumblebee-tgl commented 3 years ago

Big many Thanks! :-) great Man! :-)

BTW: My English is not perfectl, but I do my best :-D

If you want, i can tell you the Items of Lexmark and som Kyocera Devices too. We need it :-)

Tylan commented 3 years ago

Your English is perfect as far as I can tell :)

Sure, always happy to add more support! For Lexmark I need the entire trees of the following through an snmpwalk: 1.3.6.1.4.1.641 1.3.6.1.2.1.43 1.3.6.1.2.1.25.3.2.1.3.1

For Kyocera I need the entire trees of the following through an snmpwalk: 1.3.6.1.2.1.25.3.2.1.3.1 1.3.6.1.2.1.43 1.3.6.1.4.1.1347

bumblebee-tgl commented 3 years ago

Thanks a lot :-)

For Kyocera Devices like "ECOSYS M5526cdn" is the output: See the Textfile Kyocera 5526cdn.txt

And the last output ist very, very long - you need some specified?

Tylan commented 3 years ago

Can you output it to a text file and attach the text file? usually if you put: > filename.txt that will put the output to a file instead of your screen. I really only need 1.3.6.1.4.1.1347.42.2.2.1.1.2.1 (for Kyocera) and 1.3.6.1.4.1.641.2.1.5 (for Lexmark) but if they come up blank I might need the entire long tree.

bumblebee-tgl commented 3 years ago

yes of course. I can post only the Kyocera Device today.. But the Lexmark Devices in the next few Days.

The 1.3.6.1.4.1.1347.42.2.2.1.1.2.1 output is: .1.3.6.1.4.1.1347.42.2.2.1.1.2.1.1 = STRING: "Monochrome" .1.3.6.1.4.1.1347.42.2.2.1.1.2.1.2 = STRING: "Full Color"

Is this what you need? :-)

Tylan commented 3 years ago

no problem on the Lexmark, whenever you get the chance :)

I guess I need the whole tree because I thought that OID would have given me the numbers of the monocrome and full color and not the description name - unless you see those numbers somewhere in the long tree - I just need those.

bumblebee-tgl commented 3 years ago

OK, here is the tree of the output. See in Atteched files. :-) Is this, what you need?

Kyocera1.3.6.1.4.1.1347.txt

Tylan commented 3 years ago

Perfect, thanks!

Can you just confirm these are the printed numbers? I'm nearly positive these are the correct numbers just want to verify before I implement this into the code.

.1.3.6.1.4.1.1347.42.2.2.1.1.3.1.1 = INTEGER: 186 (B&W) .1.3.6.1.4.1.1347.42.2.2.1.1.3.1.2 = INTEGER: 366 (Color)

bumblebee-tgl commented 3 years ago

Yes, that´s true :-) I think so :-)

Tylan commented 3 years ago

Great :) It's in the code now and will be in the next release that should hopefully go out within the next week +/- a few days.

bumblebee-tgl commented 3 years ago

Great - youre Best :-) I hope I have stated everything correctly

Should it not be so, please - I´´m sorry :-)

Have a nice evening and many thanks! :-)

Optimaximal commented 3 years ago

Heya @Tylan.

Here are the SNMP walks for 3 Lexmarks (M5155 B&W, C4150 Colour & XC2132 MFP) and our Kyocera TaskAlfa 3252ci MFP. Numbers correspond to the walk requests from https://github.com/Tylan/check_snmp_printer/issues/12#issuecomment-675000386

Let me know if you want any numbers confirmed against actual printer readings... Kyocera 3 is HUGE, so have fun with that.

M5155-1.txt M5155-2.txt M5155-3.txt

XC2132-1.txt XC2132-2.txt XC2132-3.txt

kyocera1.txt kyocera2.txt kyocera3.txt

C4150-1.txt C4150-2.txt C4150-3.txt

Optimaximal commented 3 years ago

Great, thanks! I have the wastebox excluded from reporting as I found it to be mostly useless. If it's important to people I can put the reporting for that in.

@Tylan FYI, recording any and all consumables, including waste bottles, would be good, because the printers will shut down if they believe the waste collectors are full - in our case, we have one for each model in stores so it can be swapped out and it's replaced with our monthly stock replen, but if multiple printers are getting low at the same time, notifying our supplier that I need more than one solves a problem ahead of time 😉

Tylan commented 3 years ago

bumblebee-tgl if you apply this patch to the current release it should provide support for your printers, let me know if you run into any issues with it.

patch check_snmp_printer < check_snmp_printer_1.2.2-patch.txt

check_snmp_printer_1.2.2-patch.txt

bumblebee-tgl commented 3 years ago

Hi, I replaced the patch file with the old file and restarted icinga2. Unfortunately I do not recognize any changes in the display. Toner is labeled the same, also the page number

Did i something wrong?

Tylan commented 3 years ago

If you run from the command line: check_snmp_printer --version do you see it as v1.2.2?

check_snmp_printer v1.2.2 (nagios-plugins 2.3.1) The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute copies of the plugins under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.

If so then yes it was patched correctly. Can you then run: check_snmp_printer -C \<SNMP COMMUNITY NAME> -v \<SNMP VER> -H \<PRINTER IP> --consum and see if it still reports incorrectly? Thanks!

bumblebee-tgl commented 3 years ago

I have run in the commandline:

[root@carme plugins]# ./check_snmp_printer --version ./check_snmp_printer v1.2.2 (monitoring-plugins 2.2) The Monitoring Plugins come with ABSOLUTELY NO WARRANTY. You may redistribute copies of the plugins under the terms of the GNU General Public License. For more information about these matters, see the file named COPYING.

and the other output: [root@carme plugins]# ./check_snmp_printer -C public -v V1 -H 10.0.0.7 --consum OK: TK5240KS is at 55.00% remaining. OK: TK5240CS is at 75.00% remaining. OK: TK5240MS is at 77.00% remaining. OK: TK5240YS is at 75.00% remaining. |TK5240KS=55.00;;;; TK5240CS=75.00;;;; TK5240MS=77.00;;;; TK5240YS=75.00;;;;

Of course I restart icinga2 too :-)

Tylan commented 3 years ago

Oops I see my mess up :) Apply this patch and let me know!

check_snmp_printer_1.2.2-patch2.txt

bumblebee-tgl commented 3 years ago

It works! :-)

See on my output: [root@carme plugins]# patch check_snmp_printer < check_snmp_printer_1.2.2-patch2.txt patching file check_snmp_printer [root@carme plugins]# /etc/init.d/icinga2 restart [ ok ] Restarting icinga2 (via systemctl): icinga2.service. [root@carme plugins]# ./check_snmp_printer -C public -v V1 -H 10.0.0.7 --consum OK: Yellow Toner is at 75.00% remaining. OK: Black Toner is at 55.00% remaining. OK: Magenta Toner is at 77.00% remaining. OK: Cyan Toner is at 75.00% remaining. |Yellow_Toner=75.00;;;; Black_Toner=55.00;;;; Magenta_Toner=77.00;;;; Cyan_Toner=75.00;;;;

Tylan commented 3 years ago

Sweet! Gonna close this issue and if you find anything else don't hesitate to reach out :)