Configuring SNMP traps with qpasatraps.pl


qpasatrap.pl is a Perl script that uses the SNMP.pm Perl module to send an SNMP trap to a specific destination.

The Perl script qpasatraps.pl is a legacy script. BMC_SNMPTRAP.pl offers greater ease of use and more features, and should be used in its place.

qpasatraps.pl is overwritten during upgrades and should be part of the regular backup routine.

To configure qpasatrap.pl

  1. Find and open the qpasatrap.pl script. This script must be on the same computer as the TMTM Event Service.
  2. Configure the qpasatrap.pl script for the environment. Set the host name and port number in the script. See sample below where MySNMPServer is the host name. Port 162 is used for the trap.

    @consoles = qw
    (
    MySNMPServer,162
    );
  3. Copy the SNMP.pm module from the SNMP folder to your Perl installation. The standard location is the lib/net folder.
  4. Call the qpasatrap.pl script with the following parameters:

    Parameter

    Description

    event_type

    Is the event type that defines the SNMP oid and severity. This value is an index into the $event_info hash. If this value is not in this hash, the trap is aborted with an error message of RULE NOT DEFINED.

    pointname

    Mqhost: host name where the event occurred. Qmgr: queue manager name where the event occurred. Object: object name on which the event occurred. Attr: attribute associated with the event. Value: value associated with this event

    qpduration

    Optional value to be sent in the duration field of the trap. Length of time the event must be continuously true before the event is triggered. Type as free form text. For example, 5 minutes is the default entry defined in Perl script. Scalar is $duration.

    qpapp

    Optional value to be sent in the app field of the trap. Application associated with the event. Type as free form text. For example, Domestic Insurance is the default entry defined in Perl script. Scalar is $app.

    qpcontact

    Optional value to be sent in the contact field of the trap. Details of the department or person to contact. Type as free form text. For example, Middleware Support is the default entry defined in Perl script. Scalar is $contact.qptime.

    qptime

    Optional value to be sent in the time field of the trap. Time range associated with the event. The SNMP trap is only sent when the local time is in the defined range. Must be specified as follows hh:mm-hh:mm. For example, 10:00-18:00. There is no default defined so the event always triggers.

    Example of qpasatraps.pl with parameter markers

    Perl qpasatrap.pl event_type pointname value
    [qpduration value]
    [qpapp value]
    [qpcontact value]
    [qptime value]

To use SNMP traps in the event actions with qpasatrap.pl

  1. Ensure that SNMP support is installed and verified. See Installing-SNMP-support-for-TrueSight-Middleware-and-Transaction-Monitor for details.
  2. Ensure that Perl and the other prerequisites were installed and that the central SNMP management software can receive traps sent manually.
  3. Create an event trigger. See Creating-a-trigger.
  4. Create an event action. This event action must contain the Execute-program action:
    1. Right-click on the action and select properties.
    2. In the Program box, enter the path to the qpasatrap.pl file. If necessary, edit qpasatrap.pl to configure the output of the MIB.
    3. For Arguments, right-click and select Insert Script. Select the SNMP script and click OK.
    4. Select the script from the Insert Script list causing the perl script to execute to create parameters for use by the qpasatrap.pl script. Parameters generated include Event Trigger Name, Event Topic Name (that is, the qualified name of a queue or channel), and the current value.

      The current directory is used for file names defined in the trigger action. You might need to specify the full path for the Perl executable and the qpasatrap.pl script.

      Note

      The Event Trigger Name must match the event_types hash table in qpasatrap.pl for a trap to be generated. To receive the trap successfully at the trap receiver, a corresponding trap definition must exist in BMCMM.MIB. In addition to generating the SNMP trap, a log file is created. It is qpasa_dir/qpasatraps.txt. If you want to add a new event you must edit the hash table in qpasatrap.pl to add the new event and you must also edit BMCMM.MIB to define the new trap as a TRAP-TYPE macro. See also Installing-SNMP-support-for-TrueSight-Middleware-and-Transaction-Monitor.

  5. Manually execute the qpasatrap.pl file (with the appropriate parameters) to ensure that the script and the Perl libraries are properly configured.

    Under some circumstances it might be necessary to move qpasatrap.pl to the root of the TrueSight Middleware and Transaction Monitor installation directory. Also, you might need to put double quotes around the path even if the path does not contain any spaces.

  6. View the results in the central SNMP management software.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*