snmptrapd 是一个接收并记录 SNMP 陷阱和通知消息的 SNMP 应用程序。在系统可以接收此类消息之前,必须配置陷阱守护进程以侦听这些消息。
配置陷阱守护进程:
配置 SNMP 陷阱目的地。
以下示例显示如何使用 snmpset 命令配置 snmptrapd 守护进程:
% snmpset SNMP_agent ilomCtrlAlertType.1 i 2 ilomCtrlAlertSeverity.1 i 2 ilomCtrlAlertDestinationIP.1 a dest_ipaddress ilomCtrlAlertDestinationPort.1 i port_number ilomCtrlAlertSNMPCommunityOrUsername.1 s private ilomCtrlAlertSNMPVersion.1 i 2 SUN-ILOM-CONTROL-MIB::ilomCtrlAlertType.1 = INTEGER: snmptrap(2) SUN-ILOM-CONTROL-MIB::ilomCtrlAlertSeverity.1 = INTEGER: critical(2) SUN-ILOM-CONTROL-MIB::ilomCtrlAlertDestinationIP.1 = IpAddress: dest_ipaddress SUN-ILOM-CONTROL-MIB::ilomCtrlAlertDestinationPort.1 = INTEGER: port_number SUN-ILOM-CONTROL-MIB::ilomCtrlAlertSNMPCommunityOrUsername.1 = STRING: private SUN-ILOM-CONTROL-MIB::ilomCtrlAlertSNMPVersion.1 = INTEGER: v2c(2)
启动陷阱接收器应用程序 snmptrapd。
生成测试陷阱,以检验陷阱是否由代理(位于受管理节点上)发送,由陷阱接收器(管理站)接收。
守护进程运行时,登录到正在运行 SNMP 代理的主机上的 Oracle ILOM CLI 并键入以下命令:
-> set /SP/alertmgmt/rules/n testrule=true
以下屏幕显示管理站接收到 testalert 陷阱时的样例输出:
SUN-ILOM-CONTROL-MIB::ilom.103.2.1.20.0 = STRING: "This is a test trap"