Wednesday, September 29, 2010

SNMP Query in AIX

I see that AIX 6.1 supports Counter64 MIBs as defined in the /etc/mib.defs file, but I can't list any of these MIBs using the 'snmpinfo' command. How can I query these Counter64 MIBs using an AIX command?

Answer
Since the Counter64 MIBs are part of SMI-v2, they are not supported by the SNMPv1 protocol so you must enable SNMPv2 or v3 in order to query them. The snmpinfo command only supports SNMPv1 as well so you would have to use 'clsnmp' command on AIX to make SNMPv2 or v3 queries.
You can set up SNMP v2 on AIX via the procedure below.

Note: In this example, we're going to define a new community name "publicv2c". If you want to use "public", you can just replace publicv2c with public.

- Stop snmpd
# stopsrc -s snmpd

- In /etc/snmpdv3.conf file, add following lines:
VACM_GROUP group2 SNMPv2c publicv2c -
VACM_ACCESS group2 - - noAuthNoPriv SNMPv2c defaultView - defaultView -
COMMUNITY publicv2c publicv2c noAuthNoPriv 0.0.0.0 0.0.0.0 -

- Start snmpd
# startsrc -s snmpd

- In /etc/clsnmp.conf file, add this line:
v2c 127.0.0.1 snmpv2c

- Using clsnmp to query v2c view
clsnmp -h v2c -c publicv2c walk system

Once you have clsnmp configured, you can use it to query one of the Counter64 MIBs, like this:
# clsnmp -h v2c -v -c publicv2c walk ipSystemStatsHCInReceives
ipSystemStatsHCInReceives.1 = 4247601
ipSystemStatsHCInReceives.2 = 25833

Please contact IBM AIX Support for further questions.

No comments:

Post a Comment