I’m trying to use SNMP to get data from a printer. If I turn the printer off and on, the OID that I need to get is .1.3.6.1.2.1.43.18.1.1.8.1.1. Each time the printer has an “event”, such as getting paused, running out of paper or having a paper jam, the OIDfor the data I want increments.
For example, I turn the printer on and query .1.3.6.1.2.1.43.18.1.1.8.1.1. and I get “paused” as the value. I unpause the printer and remove all of the paper from the printer, and to get the “add paper” message I have to query .1.3.6.1.2.1.43.18.1.1.8.1.2.
I don’t know if this is normal SNMP behavior but I wonder what people suggest I do in these cases to be able to programatically get the printer state?
Yes it’s normal you are retreiving rows from an alert table :
Just have a look to the mib :
The corresponding text part of the mib is (from RFC 1759):
So the way SNMP works is to is to suffix the OID entry of the MIB by the index of the row. You can get the whole table by a Get-Bulk, but I think that the first thing for you is to understand how to retreive an SNMP table.
In your exact case :
1.3.6.1.2.1.43.18.1.1.8.1.1you have to read it as :1.3.6.1.2.1.43.18.1.1.8: prtAlertDescription followed by1: the hrDeviceIndex followed by1: the prtAlertIndex which is the row.An Advice you can find an assembly called snmpsharpnet which is very helpful to play with SNMP on the top of .NET.