Snmp
There are many instructions on the net on how to install the monitoring server The Dude from Mikrotik. Now the monitoring server package is released only for RouterOS. I used version 4.0 for Windows.
Here I wanted to consider how to monitor printers on the network: monitor the level of toner, if it is over, display a notification.
Click connect:
Click add device (red plus) and enter the ip address of the printer:
In the next step, click discovery, it finds all available probes, click finish:
Double-click on the icon that appears, the settings open, select the type "printer", and click "ok":
Right click on the icon and select view:
In the label field, write OIDs:
[Device.Name] β device name
[oid("1.3.6.1.2.1.43.5.1.1.16.1")] β printer model
[oid("1.3.6.1.2.1.43.11.1.1.6.1.1")] β cartridge type
[oid("1.3.6.1.2.1.43.11.1.1.9.1.1")] β toner level
In the image tab, you can attach your icon:
We leave, it turns out like this:
Not on all printers, oid("1.3.6.1.2.1.43.11.1.1.9.1.1") immediately shows the toner level, on some this parameter shows how many pages are left to print. To calculate the toner level, you need to divide how many pages are left to print by the total cartridge resource and multiply by 100. To do this, select βviewβ again, then Functions:
Click create new function (red plus):
I called the function toner:
In the code field, write the formula and save:
round(100*oid("1.3.6.1.2.1.43.11.1.1.9.1.1")/oid("1.3.6.1.2.1.43.11.1.1.8.1.1"))
In the label, replace [oid("1.3.6.1.2.1.43.11.1.1.9.1.1")] with the function call [toner()]
We leave. It turns out like this:
To find out the necessary oid and set the necessary parameters, you can use the snmp walk function, the right button on the printer - Snmp bypass tools:
A tree of printer objects is produced:
We right-click on the one we need and click copy OID.
Notifications
Now let's set up event notifications (the cartridge is over). Open the printer, go to the services tab, press the plus sign (add a new service):
In the probe field, click three dots to select the desired probe:
Let's create our own probe, press the red plus:
I named it toner, select type SNMP, default agent, default Snmp profile,
We prescribe Oid which is responsible for the toner level 1.3.6.1.2.1.43.11.1.1.9.1.1, type Oid Integer, comparison method>= 1
We save and select the newly created toner in the probe field, in the alerts tab you can configure which alerts we want to receive and save:
For demonstration, I chose that the toner level should not be lower than 80, the printer turned red:
Source: habr.com