GETting The Most Out of SNMP

GETting the most out of SNMP

As SNMP becomes more widespread across many industries, it is important to understand some of the subtleties of using it to interface with various pieces of equipment.

One of the important points to consider when using SNMP is the syntax of GET commands, and the ability of SNMP managers, appliances or hardware to make sense of the data returned by a GET command.

The results returned following a GET will always be made up of a binary code, but what this binary code represents is of key importance. The code could be defined as a number, a text, a string of bits representing switch positions, an IP address, a true or false or a whole set of other meanings, and the definition of what these bits represent is called the syntax.

The SNMP standard has defined a certain number of syntax types varying from integers to display strings all the way through IP addresses and counters. However, some rudimentary SNMP managers or devices can only accept basic syntax types like integers, counters or truth values, and this can leave users in a bind if the devices they need to monitor via SNMP provide their data in other formats. In these cases, the monitoring device will not be able to do anything useful with the data, it won’t have the capability of understanding the results. Something like Lost in Translation!

Davicom’s built-in SNMP manager understands many different syntax types. This ensures easier communications between monitored devices and monitoring units.

The table below shows the principal syntaxes supported by Davicom units:

 

Integers 32-bit signed integer (can be sent to a metering input, and may need to be multiplied or divided—see below)
Octet Strings Binary number that is similar to a display string, but not strictly ASCII
Display Strings ASCII or Unicode values
Object Identifiers Yes, an OID within an OID!
IP Addresses Plain IP address like 192.168.2.1
Physical Addresses MAC (physical-Ethernet) device address like ‎30-8D-99-6A-29-FD
Counters32-bit counter
GaugesValue that can be sent to a Metering input
Time TicksIndicates time since last power-up of device. Can be used to check if a device has powered-down since the last checkup. Similar to what is used in Linux systems
Bit StringsValue like 00001000, where a single bit indicates a condition.
Unsigned IntegersImportant distinction with the Integers shown in #1 above
64-bit countersSelf-evident
Truth Values1=true and 2=false (go figure—this is the SNMP standard!)

 

In addition to these standard syntax types, Davicom has added extra functionality to ensure its RTU’s can understand “special dialects”. One of these additional syntax types is the Float from String type. This syntax is not part of the SNMP standard, but it is extremely useful for taking readings from devices whose designers have used “poetic license” in their equipment.

Some equipment manufacturers code actual numerical readings in the “Display String” format. For example, one transmitter manufacturer codes the data returned to a GET request as the ASCII values for the readings. So for a 100W power, they return ASCII 1 followed by ASCII 0 and ASCII 0. This is fine if the final goal is just to display the returned value, but if we wish to have a machine monitor that value and check it continuously for out-of-bounds conditions, the process isn’t simple. If the value had been coded as a direct 32-bit integer, it would have been easily readable and useable by a machine.  This is exactly what the Davicom unit’s Float from String type does. It converts a string of ASCII characters into a floating-point number that is readily useable to check for out of bound conditions.

It is crucial to know what type of result will come out of your GET command, so that you can get the most out of SNMP.

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *