Home | Mirror | Search

6. SNMP

v1 / v2

set snmp community "public" Read-Only Trap-on version v2
set snmp host "public" 172.16.0.0 255.255.255.0 src-interface ethernet0/0
set snmp location "XXX Build 4F"
set snmp contact "neo.chen@example.com"
set snmp port listen 161
		

v2c

set snmp community "public" Read-Only Trap-on version v2c
set snmp host "public" 192.168.3.5 255.255.255.255 src-interface ethernet0/0 trap v2
set snmp location "XXX Build 4F"
set snmp contact "neo.chen@example.com"
set snmp port listen 161
set snmp port trap 162
		

登錄Linux測試SNMP

		
$ snmpwalk -v 2c -c public <juniper address>

$ snmpwalk -v 2c -Ob -c public 172.16.0.254 |head
iso.3.6.1.2.1.1.1.0 = STRING: "SSG-520 version 6.2.0r5.0 (SN: JN119AD15ADA, Firewall+VPN)"
iso.3.6.1.2.1.1.2.0 = OID: iso.3.6.1.4.1.3224.1.50
iso.3.6.1.2.1.1.3.0 = Timeticks: (508773200) 58 days, 21:15:32.00
iso.3.6.1.2.1.1.4.0 = STRING: "neo.chen@example.com"
iso.3.6.1.2.1.1.5.0 = STRING: "SSG520"
iso.3.6.1.2.1.1.6.0 = STRING: "TianXiang Build 4F"
iso.3.6.1.2.1.1.7.0 = INTEGER: 72
iso.3.6.1.2.1.2.1.0 = INTEGER: 5
iso.3.6.1.2.1.2.2.1.1.1 = INTEGER: 1
iso.3.6.1.2.1.2.2.1.1.2 = INTEGER: 2

		
		

http://www.juniper.net/techpubs/software/junos/junos74/swconfig74-net-mgmt/html/enterprise-traps3.html#1097425

unset snmp community "public"
		
comments powered by Disqus