Sends ERRM events to an SNMP manager.
snmpevent [-a host-name] [-c community] [-h]
The snmpevent script sends a Simple Network Management Protocol (SNMP) trap of an event response resource manager (ERRM) event to a host running an SNMP agent. The agent formats the trap information into an SNMP trap and sends it to the SNMP manager defined in its configuration file. This script is meant to be called by the predefined ERRM response Generate SNMP trap. Event or rearm event information is captured and posted by ERRM in environment variables that are generated when an ERRM event or a rearm event occurs.
The snmpevent script can also be used as a template to create other user-defined actions. See the RSCT Guide and Reference to understand how an event response resource runs an action command.
The following message template is sent as a trap when an event or a rearm event occurs and snmpevent is the defined response:
[ERRM_COND_SEVERITY] [ERRM_TYPE] occurred: Condition: [ ERRM_COND_NAME] Node: [ERRM_NODE_NAME] Resource: [ERRM_RSRC_NAME] Resource Class: [ERRM_RSRC_CLASS_NAME] Resource Attribute: [ERRM_ATTR_NAME] Attribute Type: [ERRM_DATA_TYPE] Attribute Value: [ERRM_VALUE]
The environment variables have the following definitions:
The snmpevent command captures these environment variable values and formats a generic message that is sent as a trap via a call to the snmptrap command.
The log_file is treated as a circular log and has a fixed size of 64KB. When log_file is full, new entries are written over the oldest existing entries.
If log_file already exists, event information is appended to it. If log_file does not exist, it is created so that event information can be written to it.
This script must be run on the node where the ERRM is running.
When the -h flag is specified, this script's usage statement is written to standard output.
VACM_GROUP group1 SNMPv1 public - VACM_VIEW defaultView internet - included -VACM_ACCESS group1 - - noAuthNoPriv SNMPv1 defaultView - defaultView - NOTIFY notify1 traptag trap - #TARGET_ADDRESS Target1 UDP 127.0.0.1 traptag trapparms1 - - - TARGET_ADDRESS Target1 UDP 9.117.16.246 traptag trapparms1 - - - TARGET_PARAMETERS trapparms1 SNMPv1 SNMPv1 public noAuthNoPriv - COMMUNITY public public noAuthNoPriv 0.0.0.0 0.0.0.0 - DEFAULT_SECURITY no-access - - logging file=/usr/tmp/snmpdv3.log enabled logging size=0 level=0 smux 1.3.6.1.4.1.2.3.1.2.1.2 gated_password # gated snmpd smuxtimeout=200 #muxatmd smux 1.3.6.1.4.1.2.3.1.2.3.1.1 muxatmd_password #muxatmdThen, restart the snmpd daemon by first killing the snmpd daemon that is currently running and then starting it again:
# ps -ef | grep snmpd root 4570 12956 1 08:24:32 pts/0 0:00 grep snmpd root 13810 1 0 08:11:04 - 0:00 snmpd # kill -9 13810 # snmpdNext, change the LParID property of node c175n08 to 12:
# chnode c175n08 LParID=12Now, on the machine 9.117.16.158 (the machine with the SNMP manager that was specified in the /etc/snmpdv3.conf file), the SNMP manager should record something like this:
2002-07-15 09:09:25 c174tr1.ppd.pok.ibm.com [9.114.78.17] TRAP, SNMP v1, community public enterprises.ibm Enterprise Specific Trap (1) Uptime: 0:01:45.00 enterprises.ibm.ibmProd.191.1.6.1.0 = "Informational Event occurred. Condition=NodeChanged Node=c174tr1.ppd.pok.ibm.com Resource=c175n08.ppd.pok.ibm.com Resource Class=Node Resource Attribute=Changed Attributes Attribute Type=CT_CHAR_PTR_ARRAY Attribute Val={LParID} "
The output varies based on SNMP managers.
Commands: snmptrap
Books: see the RSCT Guide and Reference for information about the event response resource manager (ERRM) and about how to use ERRM environment variables