Jephe Wu - http://linuxtechres.blogspot.com
Objective: understanding snmp, snmptrap under zabbix
Note:For zabbix, –with-net-snmp zabbix compiling option is not needed if you only want to receive traps. if you also want to poll snmp, then it is required.
part I - snmp monitoring - snmpget, snmpwalk
1. snmp items with zabbix
refer to http://www.zabbix.com/wiki/howto/monitor/snmp/snmp?s[]=snmp&s[]=item
2. get snmp item name
# snmpwalk snmpserver -v1 -c public
# snmpwalk -c public -v 2c ipaddress
root@snmp:~/ # snmpget -c public -v 1 172.16.62.3 .1.3.6.1.4.1.9.9.171.1.2.1.1.0
SNMPv2-SMI::enterprises.9.9.171.1.2.1.1.0 = Gauge32: 9
Note: 1.3.6.1.4.1.9.9.171.1.2.1.1 is a cisco ipsec mib at http://www.oidview.com/mibs/9/CISCO-IPSEC-FLOW-MONITOR-MIB.html, refer to cikeGlobalActiveTunnels
Refer to free snmp MIB library at http://www.oidview.com/mibs/detail.html
and http://www.iana.org/assignments/enterprise-numbers
Part II - snmptrap
1. snmptrapd.conf
root@snmptrap:/etc/snmp/ # chkconfig --list snmptrapd
snmptrapd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
root@snmptrap:/etc/snmp/ # /etc/init.d/snmptrapd status
snmptrapd (pid 27227) is running...
root@snmptrap:/etc/snmp/ # more snmptrapd.conf
authCommunity execute public
authCommunity execute PUBLIC
disableAuthorization yes
#log syslog
traphandle default /usr/bin/zabbix_snmptraphandler.pl
traphandle default /usr/bin/perl /usr/bin/traptoemail -s jephe.mailserver.com -f snmptrap@snmptrap.domain jwu@domain.com
Note: if community string is not public, please change the first/second line.
refer to http://www.zabbix.com/wiki/howto/monitor/snmp/snmp_traps_-_a_new_solution for traphandle perl script
2. test it from snmptrap server itself, you should receive email.
# snmptrap -Ci -v 2c -c public localhost "" "NET-SNMP-MIB::netSnmpExperimental" NET-SNMP-MIB:netSnmpExperimental s "test"
root@snmptrap:/etc/snmp/ # which snmptrap
/usr/bin/snmptrap
root@snmptrap:/etc/snmp/ # rpm -qf /usr/bin/snmptrap
net-snmp-utils-5.3.2.2-14.el5_7.1
Note: you might want to look at SNMPTT at http://snmptt.sourceforge.net/
3. sample zabbix templates for snmp devices
http://www.zabbix.com/wiki/templates/cisco_2960
Part III - References
http://www.zabbix.com/wiki/howto/monitor/snmp/a_simple_snmp_trap_handler
http://www.oidview.com/mibs/detail.html
http://www.iana.org/assignments/enterprise-numbers
http://ireasoning.com/mibbrowser.shtml (better to use for snmp walk)
http://www.manageengine.com/products/mibbrowser-free-tool/download.html (absolutely free, for snmpwalk, put .iso.org.dod.internet.mgmt in the Object ID column, then click 'snmpwalk' button)
http://www.youtube.com/watch?v=TiBrB0qxQao
http://www.youtube.com/watch?v=J0fPuXZySXE&feature=related
http://www.youtube.com/watch?v=biH-UAPxo_0&feature=related
Showing posts with label snmptrap. Show all posts
Showing posts with label snmptrap. Show all posts
Setup snmp and snmptrap monitoring under Zabbix
how to setup hardware montoring for HP Proliant server under RHEL 5
note: this article is obsolete, please refer to http://linuxtechres.blogspot.com/2009/09/installing-hardware-monitoring-system.html
Objective: After installing RHEl 5 on HP Proliant server, whenever there's hardware failure, especially hard disk failure and server operating system restart, we will be notified by email.
Steps:
- install RHEL 5.1 remotely and disklessly, pls refer to another article - http://linuxtechres.blogspot.com/2009/01/how-to-use-hp-ilo-to-do-nfs-diskless.html
- download HP Proliant system management RPM packages HPSMH(system management homepage) and HPASM(HP system health application and insight management agents) from HP website
- rpm -ivh hpasm* and hpsmh*
- hpasm activate
- setup snmp trap server, make /etc/snmp/snmptrapd.conf as follows:
traphandle default /usr/bin/perl /usr/bin/traptoemail -s localhost -f hpsnmptrap@domain.com jephe.wu@domain1.com
traphandle default /usr/bin/perl /usr/bin/traptoemail -s localhost -f hpsnmptrap@domain.com jephe.wu@domain2.com
- start up snmptrapd services and make it automatic for next restart
You can configure to send out email as well after generating snmp trap:
- go to /opt/compaq to edit cma.conf trapemail line
- that's it.
Subscribe to:
Posts (Atom)