Using SNMP through Agent Procedures - Collecting information through SNMP from the command line
It is not always required to setup SNMP monitoring for a networked device. In some cases it is enough to periodically check the status of a value on such a system and document it. In this example we show how we can see the pages printed count and write the information into a custom field. This was originally created for a pay per print solution. Other examples with different topics can follow the same logic.
Note: The agent procedure (screenshot below) will use SNMP tools from net-snmp (www.net-snmp.org) zipped together in a usr.zip, as the required snmpget.exe is not by default on the targeted agent machine. The procedure will assume that you use a usr.zip file, change the procedure accordingly if you have obtained snmpget.exe differently.
The first step is to upload the "usr.zip" file to the shared managed files folder.
Once this is in place we can have a look at the agent procedure.
This procedure assumes the printer IP is in a custom field printerIP. It will query this custom field to determine the printer's IP. It will then verify if the snmpget.exe exists and if not in the agent working directory, it will download the file and unzip it.
If all pre-requisites have been met, and the custom field which you'll use to fill the page count has been created, the procedure will use the following statement to get the page count:
C:\kworking\usr\bin\snmpget -v 2c -O vq -c public #ip# 18.104.22.168.22.214.171.124.2.1.4 - This will return a numeric value and will be written to the pre-defined custom field.
!! If the SNMP tools are installed, the snmpget.exe can also be called from Live Connect's command line. This can very helpful to test the procedure.
The OID used can be found in the standard printer MIB (http://www.oidview.com/mibs/0/Printer-MIB.html). Some manufacturers may choose not to use this OID and put the relevant information under other OID's. In that case try to obtain the correct OID information / vendor MIB and maybe verify that with an MIB browser.