Assignments of day 2 in week #1

SNMP

Last Updated : Friday, 12-Apr-2002 15:30:47 HKT

  1. Compile and install the ucd-snmp
    1. Download the latest ucd-snmp from http://net-snmp.sourceforge.net/

    2. Compile and install the ucd-snmp package with prefix=/usr
      (i.e install the ucd-snmp in /usr, not /usr/local)

  2. Start up your snmpd
    1. cp EXAMPLE.conf /usr/share/snmp/snmpd.conf
    2. edit the snmpd.conf accordingly
    3. At least, change the syslocation, syscontact, community

    4. /etc/rc.d/init.d/snmpd start
    5. tail /var/log/snmpd.log to see if there is any error

  3. Query your host information through snmp
    1. Get the following information from your snmp agent
      • snmpwalk [your_host] [your_community] system
      • snmpwalk [your_host] [your_community] interface
      • snmpwalk [your_host] [your_community] system.sysContact.0
      • snmpwalk [your_host] [your_community] system.sysUpTime.0
      • snmpwalk [your_host] [your_community] interfaces.ifTable.ifEntry.ifInUcastPkts.2
      • snmpwalk [your_host] [your_community] interfaces.ifTable.ifEntry.ifOutUcastPkts.2
      • snmpwalk [your_host] [your_community] enterprises.ucdavis.laTable.laEntry

    2. post the results of the above query on your web pages and annotate them

  4. Run a shell script through snmp
    1. Edit the /etc/snmp/snmpd.conf file and add the follow entries. exec .1.3.6.1.4.1.2021.50 pstable /bin/ps -ef
      exec .1.3.6.1.4.1.2021.51 netstat /bin/netstat -tu
      exec .1.3.6.1.4.1.2021.52 lastquery /usr/bin/last

    2. Restart the snmpd by /etc/rc.d/init.d/snmpd restart

    3. Now make the following snmp query
      snmpwalk [your_host] [your_community] .1.3.6.1.4.1.2021.50
      snmpwalk [your_host] [your_community] .1.3.6.1.4.1.2021.51
      snmpwalk [your_host] [your_community] .1.3.6.1.4.1.2021.52

    4. post the result of the above query on your web pages and annotate them

References: