Edit: The link no longer works.
Originally posted December 16, 2008 on AIXchange
Many of us are familiar with Simple Network Management Protocol (SNMP). I wanted to see what information I could display from my SNMP agent on a fresh AIX 6.1 install, so I logged into an AIX 6.1 machine and ran the snmpinfo command:
snmpinfo -m dump -c public –v
All I got back was:
ibm.2.1.1.1.0 = 32769
That seemed odd. My AIX 5.3 machines give me much more information out of the box. After searching Google and the IBM developerWorks forums, I found some information. So I stopped the snmpd daemons and sub-agents:
# stopsrc -s aixmibd
# stopsrc -s hostmibd
# stopsrc -s snmpmibd
# stopsrc -s snmpd
Then I entered this command:
vi /etc/snmpdv3.conf
And located these lines:
#VACM_VIEW defaultView internet – included –
VACM_VIEW defaultView 1.3.6.1.4.1.2.6.191 – excluded –
I then needed to uncomment the first line and change the second line from excluded to included. Next, I restarted snmpd and its sub-agents:
# startsrc -s snmpd
# startsrc -s aixmibd
# startsrc -s hostmibd
# startsrc -s snmpmibd
After this, running my snmpinfo command yielded much more information. In my case, I was looking for the object identifier (OID) for available and used memory, which are found in hrStorage.
I ran these commands:
snmpinfo -m dump -c public -v hrStorage > /tmp/snmp-v.out
snmpinfo -m dump -c public hrStorage > /tmp/snmp.out
When I looked at the verbose listing (captured from the –v command output), I found the line I was interested in:
hrStorageType.9 = hrStorageRam (1.3.6.1.2.1.25.2.1.2)
Once I knew that I was looking for, I found:
hrStorageSize.9 = 262144
hrStorageUsed.9 = 175084
hrStorageAllocationUnits.9 = 4096
To find the OIDs associated with these values, I ran a grep 262144 /tmp/snmp* and got:
snmp-v.out:hrStorageSize.9 = 262144
snmp.out:1.3.6.1.2.1.25.2.3.1.5.9 = 262144
After I ran grep 175084 /tmp/snmp* I found:
snmp-v.out:hrStorageUsed.9 = 175084
snmp.out:1.3.6.1.2.1.25.2.3.1.6.9 = 175084
Now I knew the OIDs that I was interested in for this machine:
1.3.6.1.2.1.25.2.3.1.6.9
1.3.6.1.2.1.25.2.3.1.5.9
The last number (.9 in this case) change based on the number of logical volumes that are on the AIX machine.
To determine out how much memory I had on the machine, I did some math:
(262144*4096)/1024 = 1048576 (or about a gig of RAM on this machine)
To see how much was being used, I calculated:
(175117*4096)/1024 = 700468
With appropriate monitoring software, you can use SNMP polling to get all kinds of information about your machines. You can also set up SNMP traps to be sent to your management machine based on predefined thresholds or events.
Of course, there’s much more with SNMP. I didn’t touch on security, community strings or the fact that many organizations turn off SNMP completely in their environments. When writing this I’m assuming that using SNMP is acceptable in your environment, or you’re looking at this in a non-production/test environment or you’ve taken additional steps to set up SNMP security before deploying it.
SNMP is supported by all kinds of hardware. It’s certainly worth investigating, especially as the number of devices in your data center increases and/or becomes more difficult to manage.