VMware Cloud Community
adrianlewis
Contributor
Contributor

How can I use TEXTUAL-CONVENTION sections from SNMP MIBs?

Hi,

Still a bit of a newbie with SNMP and HQ but I'm trying to create an SNMP plugin for a Fortinet device using just XML. Some of the metrics and/or properties that I'd like to pull from the device simply return a decimal value where each value represents a textual option.

For example, If I query fnSysHaMode (high availability mode) I get a value from 1 to 3, each corresponding to standalone, active-active, and active-passive. In the MIB file from Fortinet, there are sections describing each option but I can't seem to work out how to use this information programmatically.

Using the above example, the relevant sections in the MIB are:

FnHaMode ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION "enumerated type for HA cluster modes"
SYNTAX INTEGER {
standalone ( 1 ),
activeActive ( 2 ),
activePassive ( 3 )
}

and further down there is:

fnSysHaMode OBJECT-TYPE
SYNTAX FnHaMode
MAX-ACCESS read-only
STATUS current
DESCRIPTION "High-availabilty mode (Standalone, A-A or A-P)"
::= { fnSystem 6 }

Can anyone help?

TIA,

Adrian
0 Kudos
3 Replies
excowboy
Virtuoso
Virtuoso

Hi,

I've already played with SNMP plugins and I don't know about a conversion from integer to string values. There are two problems: as already mentioned you can't convert it and HQ doesn't offer a metric to display strings. You can only display strings as properties, but not as metric.

Mirko
adrianlewis
Contributor
Contributor

Most of what I need to do is to display these OIDs as properties but the problem is not that the OIDs in question return a string, but that the integers returned need to be looked up in the manufacturer's MIB file to determine what string to be displayed in the GUI.

This is similar to when you query the status of an interface - instead of displaying just the number 1, I'd rather be able to see this as "up" (or "down" if I get the integer 2 returned).
0 Kudos
adrianlewis
Contributor
Contributor

A bit more searching around and I get the impression that there's nothing that I can do about this with just an XML based plugin. The underlying SNMP4J code does however have the ability to process TC descriptions (see: http://www.snmp4j.org/agent/doc/org/snmp4j/agent/mo/snmp/tc/TextualConvention.html ).

Is there a possibility of getting this added as a feature request? Something along the lines of "SNMP Plugin - Enumeration of textual conventions for SNMP property values returned as integers". Have I missed the boat for v4 already?

corrected link


Message was edited by: adrianlewis
0 Kudos