Assignments of day 2 in week #1
SNMP
Last Updated : Friday, 12-Apr-2002 15:30:47 HKT
- Compile and install the ucd-snmp
- Download the latest ucd-snmp from
http://net-snmp.sourceforge.net/
- Compile and install the ucd-snmp package with
prefix=/usr
(i.e install the ucd-snmp in /usr, not /usr/local)
- Start up your snmpd
- cp EXAMPLE.conf /usr/share/snmp/snmpd.conf
- edit the snmpd.conf accordingly
At least, change the syslocation, syscontact, community
- /etc/rc.d/init.d/snmpd start
- tail /var/log/snmpd.log to see if there is any error
- Query your host information through snmp
- 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
- post the results of the above query on your web pages and annotate them
- Run a shell script through snmp
- 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
- Restart the snmpd by /etc/rc.d/init.d/snmpd restart
- 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
- post the result of the above query on your web pages and annotate them
References: