Hi everybody
I need help with with SNMP daemon for Suse Linux. The simple situation - a have to send traps to 2 hosts if something is wrong in my OS.
Config snmpd.conf:
[CODE]mta-in-00:~/bck # cat /etc/snmp/snmpd.conf
syslocation mta-in-00.localdomain
syscontact Customer Name admin@customer.com
sysservices 78
rocommunity “public” default
agentaddress udp:161,tcp:161
trapcommunity “public”
trapsess -v 2c -c “public” 192.168.47.1:8165
trapsess -v 2c -c “public” 192.168.47.2:8165
[/CODE]
Log:
mta-in-00:~ # tail -f /var/log/net-snmpd.log
could not open /proc/net/if_inet6
cannot open /proc/net/snmp6 ...
NET-SNMP version 5.4.2.1
Ports are up:
mta-in-00:/etc/snmp # netstat -ntupl | grep snmp
tcp 0 0 0.0.0.0:161 0.0.0.0:* LISTEN 7774/snmpd
tcp 0 0 127.0.0.1:199 0.0.0.0:* LISTEN 7774/snmpd
udp 0 0 0.0.0.0:37797 0.0.0.0:* 7774/snmpd
udp 0 0 0.0.0.0:45044 0.0.0.0:* 7774/snmpd
udp 0 0 0.0.0.0:161 0.0.0.0:* 7774/snmpd
During starting, SNMP sends “cold” traps:
mta-in-00:~ # tcpdump -i any -s0 -n host 192.168.47.1 or host 192.168.47.2
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 65535 bytes
16:52:44.077940 IP 192.168.45.11.45044 > 192.168.47.1.8165: UDP, length 95
16:52:44.077949 IP 192.168.45.11.45044 > 192.168.47.1.8165: UDP, length 95
16:52:44.077952 IP 192.168.45.11.45044 > 192.168.47.1.8165: UDP, length 95
16:52:44.077998 IP 192.168.45.11.37797 > 192.168.47.2.8165: UDP, length 95
16:52:44.078001 IP 192.168.45.11.37797 > 192.168.47.2.8165: UDP, length 95
16:52:44.078003 IP 192.168.45.11.37797 > 192.168.47.2.8165: UDP, length 95
16:52:44.232191 IP 192.168.45.11.33207 > 192.168.47.1.8165: UDP, length 94
16:52:44.232196 IP 192.168.45.11.33207 > 192.168.47.1.8165: UDP, length 94
16:52:44.232198 IP 192.168.45.11.33207 > 192.168.47.1.8165: UDP, length 94
16:52:44.232308 IP 192.168.45.11.42188 > 192.168.47.2.8165: UDP, length 94
16:52:44.232310 IP 192.168.45.11.42188 > 192.168.47.2.8165: UDP, length 94
16:52:44.232312 IP 192.168.45.11.42188 > 192.168.47.2.8165: UDP, length 94
But if something is wrong in my system - ethernet cables are removed, hdd is full, sendmail is shutdown - there is no any traps.
Installed pkg:
mta-in-00:~ # rpm -qa | grep snmp
libsnmp15-5.4.2.1-8.12.6.1
snmp-mibs-5.4.2.1-8.12.6.1
net-snmp-5.4.2.1-8.12.6.1
rsyslog-module-snmp-5.8.7-0.5.5
Kernel:
mta-in-00:~ # uname -a
Linux mta-in-00 3.0.13-0.27-default #1 SMP Wed Feb 15 13:33:49 UTC 2012 (d73692b) x86_64 x86_64 x86_64 GNU/Linux
MIBs in the system:
mta-in-00:~ # ll /usr/share/snmp/mibs/
total 1764
-rw-r--r-- 1 root root 2140 Nov 26 17:59 .index
-rw-r--r-- 1 root root 17455 Jan 27 2012 AGENTX-MIB.txt
-rw-r--r-- 1 root root 50948 Jan 27 2012 BRIDGE-MIB.txt
-rw-r--r-- 1 root root 68177 Jan 27 2012 DISMAN-EVENT-MIB.txt
-rw-r--r-- 1 root root 24613 Jan 27 2012 DISMAN-SCHEDULE-MIB.txt
-rw-r--r-- 1 root root 64311 Jan 27 2012 DISMAN-SCRIPT-MIB.txt
-rw-r--r-- 1 root root 84492 Jan 27 2012 EtherLike-MIB.txt
-rw-r--r-- 1 root root 4660 Jan 27 2012 HCNUM-TC.txt
-rw-r--r-- 1 root root 52544 Jan 27 2012 HOST-RESOURCES-MIB.txt
-rw-r--r-- 1 root root 10583 Jan 27 2012 HOST-RESOURCES-TYPES.txt
-rw-r--r-- 1 root root 4743 Jan 27 2012 IANA-ADDRESS-FAMILY-NUMBERS-MIB.txt
-rw-r--r-- 1 root root 4299 Jan 27 2012 IANA-LANGUAGE-MIB.txt
-rw-r--r-- 1 root root 3518 Jan 27 2012 IANA-RTPROTO-MIB.txt
-rw-r--r-- 1 root root 24065 Jan 27 2012 IANAifType-MIB.txt
-rw-r--r-- 1 root root 5066 Jan 27 2012 IF-INVERTED-STACK-MIB.txt
-rw-r--r-- 1 root root 71691 Jan 27 2012 IF-MIB.txt
-rw-r--r-- 1 root root 16782 Jan 27 2012 INET-ADDRESS-MIB.txt
-rw-r--r-- 1 root root 46366 Jan 27 2012 IP-FORWARD-MIB.txt
-rw-r--r-- 1 root root 185928 Jan 27 2012 IP-MIB.txt
-rw-r--r-- 1 root root 15936 Jan 27 2012 IPV6-ICMP-MIB.txt
-rw-r--r-- 1 root root 48703 Jan 27 2012 IPV6-MIB.txt
-rw-r--r-- 1 root root 2367 Jan 27 2012 IPV6-TC.txt
-rw-r--r-- 1 root root 7257 Jan 27 2012 IPV6-TCP-MIB.txt
-rw-r--r-- 1 root root 4400 Jan 27 2012 IPV6-UDP-MIB.txt
-rw-r--r-- 1 root root 5931 Jan 27 2012 LM-SENSORS-MIB.txt
-rw-r--r-- 1 root root 15732 Jan 27 2012 NET-SNMP-AGENT-MIB.txt
-rw-r--r-- 1 root root 9160 Jan 27 2012 NET-SNMP-EXAMPLES-MIB.txt
-rw-r--r-- 1 root root 9198 Jan 27 2012 NET-SNMP-EXTEND-MIB.txt
-rw-r--r-- 1 root root 2036 Jan 27 2012 NET-SNMP-MIB.txt
-rw-r--r-- 1 root root 4495 Jan 27 2012 NET-SNMP-TC.txt
-rw-r--r-- 1 root root 5039 Jan 27 2012 NET-SNMP-VACM-MIB.txt
-rw-r--r-- 1 root root 24723 Jan 27 2012 NOTIFICATION-LOG-MIB.txt
-rw-r--r-- 1 root root 1174 Jan 27 2012 RFC-1215.txt
-rw-r--r-- 1 root root 3067 Jan 27 2012 RFC1155-SMI.txt
-rw-r--r-- 1 root root 79667 Jan 27 2012 RFC1213-MIB.txt
-rw-r--r-- 1 root root 147822 Jan 27 2012 RMON-MIB.txt
-rw-r--r-- 1 root root 45323 Jan 27 2012 SCTP-MIB.txt
-rw-r--r-- 1 root root 4595 Jan 27 2012 SMUX-MIB.txt
-rw-r--r-- 1 root root 15490 Jan 27 2012 SNMP-COMMUNITY-MIB.txt
-rw-r--r-- 1 root root 22342 Jan 27 2012 SNMP-FRAMEWORK-MIB.txt
-rw-r--r-- 1 root root 5496 Jan 27 2012 SNMP-MPD-MIB.txt
-rw-r--r-- 1 root root 20014 Jan 27 2012 SNMP-NOTIFICATION-MIB.txt
-rw-r--r-- 1 root root 9106 Jan 27 2012 SNMP-PROXY-MIB.txt
-rw-r--r-- 1 root root 22769 Jan 27 2012 SNMP-TARGET-MIB.txt
-rw-r--r-- 1 root root 39201 Jan 27 2012 SNMP-USER-BASED-SM-MIB.txt
-rw-r--r-- 1 root root 2205 Jan 27 2012 SNMP-USM-AES-MIB.txt
-rw-r--r-- 1 root root 21106 Jan 27 2012 SNMP-USM-DH-OBJECTS-MIB.txt
-rw-r--r-- 1 root root 34162 Jan 27 2012 SNMP-VIEW-BASED-ACM-MIB.txt
-rw-r--r-- 1 root root 8263 Jan 27 2012 SNMPv2-CONF.txt
-rw-r--r-- 1 root root 29305 Jan 27 2012 SNMPv2-MIB.txt
-rw-r--r-- 1 root root 8924 Jan 27 2012 SNMPv2-SMI.txt
-rw-r--r-- 1 root root 38034 Jan 27 2012 SNMPv2-TC.txt
-rw-r--r-- 1 root root 5775 Jan 27 2012 SNMPv2-TM.txt
-rw-r--r-- 1 root root 28564 Jan 27 2012 TCP-MIB.txt
-rw-r--r-- 1 root root 16414 Jan 27 2012 TRANSPORT-ADDRESS-MIB.txt
-rw-r--r-- 1 root root 284 Nov 26 17:59 TRAP-TEST-MIB.txt
-rw-r--r-- 1 root root 2163 Jan 27 2012 UCD-DEMO-MIB.txt
-rw-r--r-- 1 root root 4402 Jan 27 2012 UCD-DISKIO-MIB.txt
-rw-r--r-- 1 root root 3010 Jan 27 2012 UCD-DLMOD-MIB.txt
-rw-r--r-- 1 root root 8118 Jan 27 2012 UCD-IPFWACC-MIB.txt
-rw-r--r-- 1 root root 46443 Jan 27 2012 UCD-SNMP-MIB.txt
-rw-r--r-- 1 root root 20882 Jan 27 2012 UDP-MIB.txt
-rw-r--r-- 1 root root 22571 Jan 27 2012 VELOCITY-MIB.txt
-rw-r--r-- 1 root root 680 Jan 27 2012 VELOCITY-TYPES.txt
Interfaces and routing table:
[CODE]mta-in-00:~ # ifconfig
bond1 Link encap:Ethernet HWaddr 10:10:3E:A1:01:00
UP BROADCAST RUNNING MASTER MULTICAST MTU:1500 Metric:1
RX packets:1547270 errors:0 dropped:772543 overruns:0 frame:0
TX packets:34057 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:92565948 (88.2 Mb) TX bytes:3289193 (3.1 Mb)
bond1.600 Link encap:Ethernet HWaddr 10:10:3E:A1:01:00
inet addr:192.168.61.11 Bcast:192.168.63.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1496 Metric:1
RX packets:944 errors:0 dropped:0 overruns:0 frame:0
TX packets:1 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:40990 (40.0 Kb) TX bytes:42 (42.0 b)
bond1.700 Link encap:Ethernet HWaddr 10:10:3E:A1:01:00
inet addr:192.168.45.11 Bcast:192.168.47.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1496 Metric:1
RX packets:167533 errors:0 dropped:106 overruns:0 frame:0
TX packets:8739 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6679605 (6.3 Mb) TX bytes:2079606 (1.9 Mb)
bond1.800 Link encap:Ethernet HWaddr 10:10:3E:A1:01:00
inet addr:192.168.29.11 Bcast:192.168.31.255 Mask:255.255.240.0
UP BROADCAST RUNNING MULTICAST MTU:1496 Metric:1
RX packets:570 errors:0 dropped:0 overruns:0 frame:0
TX packets:155 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:35780 (34.9 Kb) TX bytes:16521 (16.1 Kb)
eth1 Link encap:Ethernet HWaddr 10:10:3E:A1:01:00
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:770559 errors:0 dropped:770379 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:46305279 (44.1 Mb) TX bytes:84 (84.0 b)
eth3 Link encap:Ethernet HWaddr 10:10:3E:A1:01:00
UP BROADCAST RUNNING SLAVE MULTICAST MTU:1500 Metric:1
RX packets:776711 errors:0 dropped:125 overruns:0 frame:0
TX packets:34055 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:46260669 (44.1 Mb) TX bytes:3289109 (3.1 Mb)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:244 errors:0 dropped:0 overruns:0 frame:0
TX packets:244 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:14620 (14.2 Kb) TX bytes:14620 (14.2 Kb)
mta-in-00:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.30.2 0.0.0.0 UG 0 0 0 bond1.800
10.49.128.0 192.168.46.2 255.255.255.0 UG 0 0 0 bond1.700
10.53.0.0 192.168.46.2 255.255.0.0 UG 0 0 0 bond1.700
10.60.0.0 192.168.46.2 255.255.0.0 UG 0 0 0 bond1.700
10.61.0.0 192.168.46.2 255.255.0.0 UG 0 0 0 bond1.700
10.80.137.208 192.168.46.2 255.255.255.240 UG 0 0 0 bond1.700
10.81.17.0 192.168.46.2 255.255.255.0 UG 0 0 0 bond1.700
10.81.34.0 192.168.46.2 255.255.255.0 UG 0 0 0 bond1.700
10.81.220.0 192.168.46.2 255.255.255.224 UG 0 0 0 bond1.700
82.182.8.6 192.168.46.2 255.255.255.255 UGH 0 0 0 bond1.700
loopback * 255.0.0.0 U 0 0 0 lo
192.168.16.0 * 255.255.240.0 U 0 0 0 bond1.800
192.168.32.0 * 255.255.240.0 U 0 0 0 bond1.700
192.168.48.0 * 255.255.240.0 U 0 0 0 bond1.600
217.174.65.0 192.168.46.2 255.255.255.224 UG 0 0 0 bond1.700
217.174.65.136 192.168.46.2 255.255.255.248 UG 0 0 0 bond1.700
[/CODE]
Of course, i don’t have any firewall, Iptables is clear
It looks that everyting is ok, but daemon doen’t know when and what to send. I guess i missed something.
I need your help Thanks and br/// Ilya