📜 ⬆️ ⬇️

The Dude. Setting up email notifications for toner level in network printers

Good day. Task: set up email notifications about low ink levels in network printers.
Preface: there was an attempt to find such a ready-made application, a review was made of a not very close look at various monitoring systems (Lansweeper, Spiceworks) in general, as it didn’t go away, the monitoring system of the network and servers was already configured on The Dude, because all the components in it.
Solution: general scheme - The Dude polls the printer via snmp for ink level and sends a notification to the mail.
Let's start.
Most printers on the network are Kyocera, a search engine prompted what is the value of the current toner quantity and maximum, using a small formula, we get the percentages: oid ("iso.org.dod.internet.mgmt.mib-2.43.11.1.1.9.1.1") * 100 /oid(13isiso.org.dod.internet.mgmt.mib-2.43.11.1.1.8.1.1 ")
Create a function (in the Functions section), I called it toner:

After that we create a probe (Probe)

Here I will explain a little, Available - if the condition is met - the service is available, in our case the toner in the printer is more than 10%
Error, did not fully understand how it works, if the first condition is satisfied, an empty string is returned and the service is considered available? (Comments on this are welcome) if the condition is not met, then the string Low is returned in my case.
The third parameter, Value, is used for plotting graphs.
We add our printer to devices (Devices), we add manually a toner probe. Since I have disabled SNMP in the global configuration, it is necessary to enable the Snmp Profile in the appropriate mode (I have v1-public), otherwise the toner probe will return the Down status.


I’ll skip the mail alert setting, everything is standard there.
And finally, the very low toner alert letter:


Thanks for attention. Comments are welcome.

')

Source: https://habr.com/ru/post/238063/


All Articles