router>
router> enable
router# conf terminal
#snmp-server community cisco ro
#snmp-server community secret rw
#snmp-server enable traps
#snmp-server host 10.254.190.1 rw
在路由器上配置日誌信息(Syslog Message Logging)
router(config) # logging on
router(config) # logging server-ip-address
router(config) # logging trap severity-level
華爲交換機SNMP配置
<switch>
<switch>system-view
[switch]snmp-agent community read huawei 配置community 只讀屬性爲huawei
[switch]snmp-agent community write huawei配置community 可寫屬性爲huawei
[switch]snmp-agent sys-info version all
港灣交換機配置TELNET SNMP
啓動SNMP服務的配置步驟如下:
配置步驟
步驟1 service snmp enable 使能SNMP agent服務
步驟2 service snmp trap enable 使能SNMP trap服務
步驟3 config snmp community readonly <string> 設置SNMP只讀權限認證密碼
步驟4 config snmp community readwrite <string> 設置SNMP讀寫權限認證密碼
步驟5 config snmpauthentrap [enable|disable] 使用enable設置當SNMP認證失敗時發送trap
步驟6 show service 顯示SNMP是否啓動
步驟7 show snmp community-string 顯示當前的權限認證密碼
配置SNMP trap
交換機上的SNMP agent會產生很多種類的trap信息,如啓動(start)、接口(interface)、RMON(遠程監控)等。可以在交換機上配置SNMP trap來指定一臺或多臺trap接收站(trap receiver),並指定哪些種類的trap信息會發送到這些接收站。
配置步驟
步驟1 service snmp enable 使能SNMP agent服務
步驟2 service snmp trap enable 使能SNMP trap服務
步驟3 config snmp trap type [all|interface|bgp|ospf|vrrp|stp|rmon|start|auth|pppoe|isis] [on|off] 配置發送trap的類型
步驟4 config snmp trapreceiver add <A.B.C.D> version [v1|v2c] {community <string>}*1 添加一個trap接收站
步驟5 config snmp trapreceiver add <A.B.C.D> version [v1|v2c] {community <string>}*1 添加另一個trap接收站
步驟6 show snmp trap type 顯示系統允許發送的trap種類
步驟7 Show snmp trapreceiver 顯示已經添加的所有trap接收站