[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Commands Reference, Volume 5

snmpevent Command


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:

           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:

Specifies the significance of the condition resource that caused the event or rearm event. The valid values are: Critical, Warning, or Informational.
Specifies the type of event that occurred. The valid values are: event or rearm event.
Specifies the name of the condition resource with the attribute value that changed to cause this event or rearm event.
Specifies the host name on which this event or rearm event occurred.
Specifies the name of the resource with the attribute that changed to cause this event or rearm event.
Specifies the name of the resource class to which the resource that caused this event or rearm event belongs.
Specifies the name of the resource attribute that changed to cause this event or rearm event.
Specifies the data type of the resource attribute.
Specifies the value of the resource attribute that changed to cause this event or rearm event.

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.


Defines the host name of the SNMP agent to which the AIX subagent will connect.
Specifies the SNMP community to be used. This can be any string the SNMP agent will accept. The default is public.
Writes this script's usage statement to standard output.


Specifies the name of the file where event information is logged. An absolute path for the log_file parameter should be specified.

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.

Exit Status

The script has run successfully.
An error occurred when the script was run.


This script must be run on the node where the ERRM is running.

Standard Output

When the -h flag is specified, this script's usage statement is written to standard output.


  1. Suppose the command /usr/sbin/rsct/bin/snmpevent is an action in the critical-notification response, which is associated with the CSM predefined condition NodeChanged. This can be done with the mkcondresp command followed by the startcondresp command. The /etc/snmpdv3.conf file should be configured to where the trap will be sent. In this example, if you want the trap sent to, write the /etc/snmpdv3.conf file as follows:
    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       traptag trapparms1 - - -
    TARGET_ADDRESS Target1 UDP       traptag trapparms1 - - -
    TARGET_PARAMETERS trapparms1 SNMPv1  SNMPv1  public  noAuthNoPriv -
    COMMUNITY public    public     noAuthNoPriv         -
    DEFAULT_SECURITY no-access - -
    logging         file=/usr/tmp/snmpdv3.log       enabled
    logging         size=0                          level=0
    smux           gated_password  # gated
    snmpd smuxtimeout=200 #muxatmd
    smux muxatmd_password #muxatmd 
    Then, 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
    # snmpd
    Next, change the LParID property of node c175n08 to 12:
    # chnode c175n08 LParID=12
    Now, on the machine (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 [] TRAP, SNMP v1, 
    community public
            enterprises.ibm Enterprise Specific Trap (1) Uptime: 0:01:45.00
            enterprises.ibm.ibmProd. = "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.


Contains the snmpevent script

Related Information

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

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]