Translate return values from snmp data query

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
atom04
Posts: 6
Joined: Sun Feb 26, 2012 1:17 pm

Translate return values from snmp data query

Post by atom04 »

How can I get an SNMP data query to translate an integer value to text for vendor specific MIBs? Such as is done with the snmpwalk command.The SNMP query just gives me '2' instead of 'active' or 'active(2)'. Is this something that needs to be configured for snmp-php, the MIBDIR environment variable, or snmp.conf? I am using 0.8.7i

Code: Select all

# snmpwalk -v2c -c publ1c15 10.80.2.159 -m SONUS-NODE-MIB 1.3.6.1.4.1.2879.2.1.1.1.1.7.1.12
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.1 = INTEGER: active(2)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.2 = INTEGER: standby(1)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.3 = INTEGER: active(2)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.4 = INTEGER: standby(1)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.11 = INTEGER: active(2)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.12 = INTEGER: active(2)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.13 = INTEGER: active(2)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.14 = INTEGER: active(2)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.15 = INTEGER: active(2)
SONUS-NODE-MIB::sonusNodeSrvrStatMode.1.16 = INTEGER: standby(1)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Translate return values from snmp data query

Post by gandalf »

This is not possible yet. We have translation code in SVN/main already to do so. But this will work for Data Queries only
R.
atom04
Posts: 6
Joined: Sun Feb 26, 2012 1:17 pm

Re: Translate return values from snmp data query

Post by atom04 »

This is already done for standard MIBs (ie. IF-MIB) in interfaces.xml.

Code: Select all

# snmpwalk -v 1 -c something host 1.3.6.1.2.1.2.2.1.8
IF-MIB::ifOperStatus.1 = INTEGER: up(1)
IF-MIB::ifOperStatus.2 = INTEGER: up(1)
IF-MIB::ifOperStatus.3 = INTEGER: down(2)
# snmpwalk -v 1 -c something host 1.3.6.1.2.1.2.2.1.3
IF-MIB::ifType.1 = INTEGER: softwareLoopback(24)
IF-MIB::ifType.2 = INTEGER: ethernetCsmacd(6)
IF-MIB::ifType.3 = INTEGER: ethernetCsmacd(6)
Image

When running an SNMP query php-snmp (/prod/cacti/lib/snmp.php) is being used, correct? Or are the system snmpget/snmpwalk commands being used? From my understanding MIBs can be loaded with with php-snmp (http://php.net/manual/en/function.snmp-read-mib.php) and of course they can be loaded with the system snmp commands.

So is there no easy way to tell Cacti to load a vendor MIB? Please let me know if I am wrong in anything stated. I refuse to believe this is not possible!
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Translate return values from snmp data query

Post by gandalf »

This is ONLY done for interface stats. And it is done statically in the code == bad solution.
We do NOT use MIBs (they are often broken and badly written).
And, as already told, you will be able to do any conversion with upcoming data query XML. See http://docs.cacti.net/manual:088:3a_adv ... xml_syntax, especially "rewrite_index"
R.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests