본문 바로가기

work/snmp

How to install net-snmp on AIX

 
 
           How to install net-snmp on AIX

 If you are still hunting for a solution for this subject, I hope what follows can help.

Also there is a useful link here: http://www.net-snmp.org/docs/README.aix.html

 

------------------------------------------------------------

Things you will need:

1.        Root access

2.        Run command


uname -a


To obtain below several pieces of information:


-operating system version,

-hardware platform

-net-snmp version desired


It will return something like:

AIX AIX52 2 5 000B64DF4C00

 

Once you have found the appropriate version, download it to a

distribution directory (making one if necessary) eg. /usr/local/dist

Go to http://net-snmp.sourceforge.net/download/ for source code

Or http://aixpdslib.seas.ucla.edu/packages/net-snmp.html to get binary ball.



------------------------------------------------------------

3.  Download the binary version of gcc, openSSL and net-snmp with appropriate version to a distribution directory e.g.: /opt


gcc-3.3.2-4.aix5.2.ppc.rpm

openssl-0.9.7-1.src.rpm

net-snmp.5.2.tar.Z


Download gcc and openSSL from:

http://www-03.ibm.com/servers/aix/products/aixos/linux/download.html

http://aixpdslib.seas.ucla.edu/packages/net-snmp.html


Download net-snmp from :

http://aixpdslib.seas.ucla.edu/packages/net-snmp.html


------------------------------------------------------------

4.Upload the package to dist directory,such as /opt.


# cd /opt

# ls


gcc-3.3.2-4.aix5.2.ppc.rpm

openssl-0.9.7-1.src.rpm

net-snmp.5.2.tar.Z




5.  Install gcc


Type the following:


# rpm -U gcc-3.3.2-4.aix5.2.ppc.rpm


gcc will be installed by default.


------------------------------------------------------------


------------------------------------------------------------

7.  Determine existing SNMP functionality (eg. AIX's snmpdx daemon)

 

Run the following commands:

 

# ps -ef|grep snmp

    root  5996  4176   0 22:31:35      -  0:00 /usr/sbin/snmpd

    root  7250  4176   0 22:31:41      -  0:00 /usr/sbin/snmpmibd

If the AIX’s SNMP are running, then disable it. Here is the procedure:


      # stopsrc -s snmpd

or

      # kill -9 5996


------------------------------------------------------------

8.  Installing net-snmp binaries


Type the following: (using the sample above)


# cd /opt

# uncompress *.Z

# cp net-snmp.5.2.tar /

# tar -xvf net-snmp.5.2.tar


The binaries, libraries, etc. will be installed in /usr/local by default.


------------------------------------------------------------

10.  Creating snmpd.conf and testing


When everything is installed, type:


cd /usr/local/bin

./snmpconf


And answer the questions appropriately. Here is the example of answer:

Select File: 3       -- snmpd.conf

Select Section: 1    -- System information setup

   The location of the system: rushmore office

   The contact information: contract administrator

Select Section: finished

Select Section: 2    -- Access control setup

   Select Section: 3    -- SNMPv1/SNMPv2c read-only access community name

      Enter rocommunity name: public

      The host name or network address…… : Enter

      The OID ……: Enter

   Select Section: 4    -- SNMPv1/SNMPv2c read-write access community name

      Enter rocommunity name: private

      The host name or network address…… : Enter

      The OID ……: Enter

Select Section: finished

Select Section: 6    -- Agent Operating Mode

      Select Section: 4    -- The IP address and port number that agent will listen on

Enter the port number: 161

Select Section: finished

Select Section: finished

Select Section: quit


Then add the following line to snmpd.conf

com2sec notConfigUser  default       public



#       groupName      securityModel securityName

group   notConfigGroup v1           notConfigUser

group   notConfigGroup v2c           notConfigUser



# Make at least  snmpwalk -v 1 localhost -c public system fast again.

#       name           incl/excl     subtree         mask(optional)

view    allview    included   .1.3.6

view    systemview    included   .1.3.6.1.2.1.1

view    systemview    included   .1.3.6.1.2.1.25.1.1



#       group          context sec.model sec.level prefix read   write  notif

access  notConfigGroup ""      any       noauth    exact  allview none none


After finished the setup, snmpd.conf file likes:


########################################################################

# snmpd.conf

#

#   - created by the snmpconf configuration program

#

######################################################################## SECTION: System Information Setup

#

#   This section defines some of the information reported in

#   the "system" mib group in the mibII tree.


# syslocation: The [typically physical] location of the system.

#   Note that setting this value here means that when trying to

#   perform an snmp SET operation to the sysLocation.0 variable will make

#   the agent return the "notWritable" error code.  IE, including

#   this token in the snmpd.conf file will disable write access to

#   the variable.

#   arguments:  location_string


syslocation  "rushmore office"


# syscontact: The contact information for the administrator

#   Note that setting this value here means that when trying to

#   perform an snmp SET operation to the sysContact.0 variable will make

#   the agent return the "notWritable" error code.  IE, including

#   this token in the snmpd.conf file will disable write access to

#   the variable.

#   arguments:  contact_string


syscontact  "contact administrator"



######################################################################## SECTION: Access Control Setup

#

#   This section defines who is allowed to talk to your running

#   snmp agent.


# rocommunity: a SNMPv1/SNMPv2c read-only access community name

#   arguments:  community [default|hostname|network/bits] [oid]


rocommunity  public 


# rwcommunity: a SNMPv1/SNMPv2c read-write access community name

#   arguments:  community [default|hostname|network/bits] [oid]


rwcommunity  private



#######################################################################

# agentaddress: The IP address and port number that the agent will listen on.

#   By default the agent listens to any and all traffic from any

#   interface on the default SNMP port (161).  This allows you to

#   specify which address, interface, transport type and port(s) that you

#   want the agent to listen on.  Multiple definitions of this token

#   are concatenated together (using ':'s).

#   arguments: [transport:]port[@interface/address],...


agentaddress  161



com2sec notConfigUser  default       public



#       groupName      securityModel securityName

group   notConfigGroup v1           notConfigUser

group   notConfigGroup v2c           notConfigUser



# Make at least  snmpwalk -v 1 localhost -c public system fast again.

#       name           incl/excl     subtree         mask(optional)

view    allview    included   .1.3.6

view    systemview    included   .1.3.6.1.2.1.1

view    systemview    included   .1.3.6.1.2.1.25.1.1



#       group          context sec.model sec.level prefix read   write  notif

access  notConfigGroup ""      any       noauth    exact  allview none none



Then type the following:

#cp snmpd.conf /usr/local/share/snmp/

      #/usr/local/sbin/snmpd &


Test the daemon's functionality by MIB-Browser or typing:


   snmpget -v 1 -c public localhost sysUpTime.0

   snmpwalk -v 2c -c public -m ALL localhost .1.3 | more


If you have problems, you can examine diagnostic messages

by running:


   /usr/local/sbin/snmpd -f -L


------------------------------------------------------------


You also could check SNMP through MIB-browser tool by walk.