当设备包含冗余电源时,您可以选择在其中一个电源失效或状态更改时让设备生成陷阱。路由器和交换机上都存在陷阱,它们会通知状态更改或故障,并指向有关更改性质的进一步信息。本文档介绍如何使用简单网络管理协议(SNMP)跟踪其中一个冗余电源失效或状态改变的时间。
本文档没有任何特定的要求。
本文档中的信息对具有冗余电源的思科路由器和交换机有效。
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您使用的是真实网络,请确保您已经了解所有命令的潜在影响。
有关文件规则的更多信息请参见“ Cisco技术提示规则”。
对于路由器,从CISCO-ENVMON-MIB MIB中观察ciscoEnvMonRedundantSupplyNotification陷阱。变量ciscoEnvMonSupplyDescr和ciscoEnvMonSupplyState提供有关更改性质的详细信息。必须配置snmp-server enable traps envmon命令以启用陷阱。
.1.3.6.1.4.1.9.9.13.3.0.5 ciscoEnvMonRedundantSupplyNotification OBJECT-TYPE -- FROM CISCO-ENVMON-MIB TRAP VARBINDS { ciscoEnvMonSupplyStatusDescr, ciscoEnvMonSupplyState } DESCRIPTION "A ciscoEnvMonRedundantSupplyNotification is sent if the redundant power supply (where extant) fails. Since such a notification is usually generated before the shutdown state is reached, it can convey more data and has a better chance of being sent than does the ciscoEnvMonShutdownNotification." ::= { iso(1) org(3) dod(6) internet(1) private(4) enterprises(1) cisco(9) ciscoMgmt(9) ciscoEnvMonMIB(13) ciscoEnvMonMIBNotificationPrefix(3)ciscoEnvMonMIBNotifications(0) 5 } .1.3.6.1.4.1.9.9.13.1.5.1.2 ciscoEnvMonSupplyStatusDescr OBJECT-TYPE -- FROM CISCO-ENVMON-MIB -- TEXTUAL CONVENTION DisplayString SYNTAX OCTET STRING (0..32) DISPLAY-HINT "255a" MAX-ACCESS read-only STATUS Current DESCRIPTION "Textual description of the power supply being instrumented. This description is a short textual label, suitable as a human-sensible identification for the rest of the information in the entry." ::= { ISO(1) org(3) DOD(6) Internet(1) private(4) enterprises(1) cisco(9) ciscoMgmt(9) ciscoEnvMonMIB(13) ciscoEnvMonObjects(1) ciscoEnvMonSupplyStatusTable(5) ciscoEnvMonSupplyStatusEntry(1) 2 } .1.3.6.1.4.1.9.9.13.1.5.1.3 ciscoEnvMonSupplyState OBJECT-TYPE -- FROM CISCO-ENVMON-MIB -- TEXTUAL CONVENTION CiscoEnvMonState SYNTAX Integer { normal(1), warning(2), critical(3), shutdown(4), notPresent(5) } MAX-ACCESS read-only STATUS Current DESCRIPTION "The current state of the power supply being instrumented." ::= { ISO(1) org(3) DOD(6) Internet(1) private(4) enterprises(1) cisco(9) ciscoMgmt(9) ciscoEnvMonMIB(13) ciscoEnvMonObjects(1) ciscoEnvMonSupplyStatusTable(5) ciscoEnvMonSupplyStatusEntry(1) 3 }
对于交换机,请观察SNMP陷阱机箱AlarmOn。陷阱中包含变量chassisTempAlarm、chassisMinorAlarm和chassisMajorAlarm,这些变量对于确定正在进行的特定机箱警报是必需的。所有这些陷阱都来自CISCO-STACK-MIB。
.1.3.6.1.4.1.9.5.0.5 chassisAlarmOn OBJECT-TYPE -- FROM CISCO-STACK-MIB TRAP VARBINDS { chassisTempAlarm, chassisMinorAlarm, chassisMajorAlarm } DESCRIPTION "A chassisAlarmOn trap signifies that the agent entity has detected the chassisTempAlarm, chassisMinorAlarm, or chassisMajorAlarm object in this MIB has transitioned to the on(2) state. The generation of this trap can be controlled by the sysEnableChassisTraps object in this MIB." ::= { ISO(1) org(3) DOD(6) Internet(1) private(4) enterprises(1) cisco(9) workgroup(5) ciscoStackNotificationsPrefix(0) 5 } .1.3.6.1.4.1.9.5.1.2.13 chassisTempAlarm OBJECT-TYPE -- FROM CISCO-STACK-MIB SYNTAX Integer { off(1), on(2), critical(3) } MAX-ACCESS read-only STATUS Current DESCRIPTION "The chassis temperature alarm status." ::= { ISO(1) org(3) DOD(6) Internet(1) private(4) enterprises(1) cisco(9) workgroup(5) ciscoStackMIB(1) chassisGrp(2) 13 } .1.3.6.1.4.1.9.5.1.2.11 chassisMinorAlarm OBJECT-TYPE -- FROM CISCO-STACK-MIB SYNTAX Integer { off(1), on(2) } MAX-ACCESS read-only STATUS Current DESCRIPTION "The chassis minor alarm status." ::= { ISO(1) org(3) DOD(6) Internet(1) private(4) enterprises(1) cisco(9) workgroup(5) ciscoStackMIB(1) chassisGrp(2) 11 } .1.3.6.1.4.1.9.5.1.2.12 chassisMajorAlarm OBJECT-TYPE -- FROM CISCO-STACK-MIB SYNTAX Integer { off(1), on(2) } MAX-ACCESS read-only STATUS Current DESCRIPTION "The chassis major alarm status." ::= { ISO(1) org(3) DOD(6) Internet(1) private(4) enterprises(1) cisco(9) workgroup(5) ciscoStackMIB(1) chassisGrp(2) 12 }