Chinaunix

标题: 思科 snmp配置 [打印本页]

作者: 稻草人萤火虫    时间: 2014-07-15 18:40
标题: 思科 snmp配置
#snmp-server community <string> ro
#snmp-server enable traps all
#snmp-server host <ip-address> <string> informs
#copy running-config startup-config

我这样配置但snmp还是不通,纠结了很久,求高手指教


作者: kojiunjau    时间: 2014-08-07 16:16
我的run config 只有設定
snmp-server community public RO


2014-08-07 16:15:40 [kec@hqdc041 ~]$  snmpwalk -v2c -On -c public 192.168.11.98|more
.1.3.6.1.2.1.1.1.0 = STRING: Cisco IOS Software, C2960 Software (C2960-LANBASEK9
-M), Version 12.2(5SE2, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2011 by Cisco Systems, Inc.
Compiled Thu 21-Jul-11 02:13 by prod_rel_team
.1.3.6.1.2.1.1.2.0 = OID: .1.3.6.1.4.1.9.1.799
.1.3.6.1.2.1.1.3.0 = Timeticks: (511761553) 59 days, 5:33:35.53


我確定這樣就可以要到資料,你要不要試試?
作者: 稻草人萤火虫    时间: 2014-08-11 17:32
回复 2# kojiunjau


    这样设置也不行啊,其他的机器这样配置可以,就这一台不可以,不知道为什么
作者: kojiunjau    时间: 2014-08-12 11:25
本帖最后由 kojiunjau 于 2014-08-12 11:29 编辑

請先到設備運行

cisco2960g#show access-list
確認設備本機並無ACL限制阻擋....

cisco2960g#show snmp
Chassis: FOC1224U62X
59381 SNMP packets input
    0 Bad SNMP version errors
    3 Unknown community name
    0 Illegal operation for community name supplied
    0 Encoding errors
    140008 Number of requested variables
    0 Number of altered variables
    43728 Get-request PDUs
    15582 Get-next PDUs
    0 Set-request PDUs
    0 Input queue packet drops (Maximum queue size 1000)
59378 SNMP packets output
    0 Too big errors (Maximum packet size 1500)
    13 No such name errors
    0 Bad values errors
    0 General errors
    59376 Response PDUs
    0 Trap PDUs
SNMP global trap: disabled

SNMP logging: disabled
SNMP agent enabled

1.確認snmpd運行無誤
2.再來檢查是否有思科設備與snmp 查詢主機間是否有firewall 設備阻擋

其他檢查項目,可能就要大家幫忙想一想了
作者: 稻草人萤火虫    时间: 2014-08-13 17:31
回复 4# kojiunjau


    错了,我的交换机是华为S5700
作者: 稻草人萤火虫    时间: 2014-08-13 17:31
回复 4# kojiunjau


    错了,我的交换机是华为S5700
作者: 稻草人萤火虫    时间: 2014-08-14 09:58
回复 6# 稻草人萤火虫


    不是华为S5700,是Dell
作者: kojiunjau    时间: 2014-08-14 13:52
您玩笑也開太大了~
該不會那台Dell 也沒有支援snmp?
作者: 稻草人萤火虫    时间: 2014-08-14 16:45
回复 8# kojiunjau


    我show run 看到这条Cut-through mode is configured as disabled,有没有影响?
作者: kojiunjau    时间: 2014-08-15 13:51
沒有關係
也不應該是Cut-through 造成的~
你看能不能po switch的完整設定,讓大夥端詳
作者: 稻草人萤火虫    时间: 2014-08-18 14:38
回复 10# kojiunjau

以下是一些关于snmp的配置,用snmpwalk检测不到,其他交换机同样的配法可以,这个却不行,好悲伤

#show run
!Current Configuration:
!System Description "apple 6324, 3.2.0.7, VxWorks 6.5"
!System Software Version 3.2.0.7
!Cut-through mode is configured as disabled
!
configure
vlan database
vlan 2-4,101-200,1090-1091,3000
vlan routing 1 1
vlan routing 101 2
vlan routing 3000 3
exit
stack
member 1 1
exit
ip address 98.163.109.45 255.255.255.192
ip default-gateway 98.163.109.62
ip address vlan 1090
ip routing
interface vlan 1
routing
ip address 192.168.1.1 255.255.255.0
exit
interface vlan 101
routing
ip address 16.0.0.11 255.255.255.0
exit
interface vlan 3000
routing
ip address 10.10.0.10 255.255.255.0
exit
spanning-tree priority 61440
snmp-server enable traps dvmrp
snmp-server enable traps pim
snmp-server enable traps captive-portal
snmp-server enable traps captive-portal client-auth-failure
snmp-server enable traps captive-portal client-connect

                     
snmp-server enable traps captive-portal client-db-full
snmp-server enable traps captive-portal client-disconnect
snmp-server enable traps ospf all
snmp-server enable traps ospfv3 all

......

snmp-server community apple123 ro ipaddress 98.163.109.166
snmp-server host 98.163.109.166 apple informs
exit


!
作者: kojiunjau    时间: 2014-08-18 17:42
你的檢測主機IP是???

設定檔看來有做ACL 只允許ipaddress 98.163.109.166 查詢(還是dell 的寫法不一樣?)
snmp-server community apple123 ro ipaddress 98.163.109.166
snmp-server host 98.163.109.166 apple informs

可以嘗試把ipaddress 98.163.109.166 拿掉,允許所有機器進行snmp查詢嗎??
作者: hexilanlan    时间: 2014-08-19 10:54
看看。。。。。。。。。。
作者: 稻草人萤火虫    时间: 2014-08-20 15:13
回复 12# kojiunjau


    我的监控就是这个地址呀98.163.109.166
作者: kojiunjau    时间: 2014-08-22 11:16
如果,設備地址與設定無誤
ip address 98.163.109.45 255.255.255.192
ip default-gateway 98.163.109.62
監控地址是98.163.109.166

請你試試,是不是ACL(Access Control List) 發生錯誤造成的

所以我才問你
可以嘗試把ipaddress 98.163.109.166 拿掉,允許所有機器進行snmp查詢試試嗎??

若是,拿掉後
1. 98.163.109.166 仍舊不行,但是其他機器可以,那問題就在98.163.109.166
2. 98.163.109.166 仍舊不行,但是其他機器也不可以,那問題就在98.163.109.45
3. 98.163.109.166 行,但是其他機器也可以,那就檢查一下gateway 或其他網路設定吧
作者: chengchow    时间: 2014-08-22 11:40
snmp-server community $COMMUNITY RO
snmp-server trap link ietf
snmp-server enable traps snmp authentication linkdown linkup coldstart warmstart
snmp-server host $IP version 2c $COMMUNITY





欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2