Configuring SNMP traps with qpasatraps.pl
To configure qpasatrap.pl
- Find and open the qpasatrap.pl script. This script must be on the same computer as the TMTM Event Service.
- 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
); - Copy the SNMP.pm module from the SNMP folder to your Perl installation. The standard location is the lib/net folder.
Call the qpasatrap.pl script with the following parameters:
Parameter
Description
event_typeIs 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.
pointnameMqhost: 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
qpdurationOptional 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.
qpappOptional 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.
qpcontactOptional 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.
qptimeOptional 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
- Ensure that SNMP support is installed and verified. See Installing-SNMP-support-for-TrueSight-Middleware-and-Transaction-Monitor for details.
- Ensure that Perl and the other prerequisites were installed and that the central SNMP management software can receive traps sent manually.
- Create an event trigger. See Creating-a-trigger.
- Create an event action. This event action must contain the Execute-program action:
- Right-click on the action and select properties.
- In the Program box, enter the path to the qpasatrap.pl file. If necessary, edit qpasatrap.pl to configure the output of the MIB.
- For Arguments, right-click and select Insert Script. Select the SNMP script and click OK.
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.
Manually execute the qpasatrap.pl file (with the appropriate parameters) to ensure that the script and the Perl libraries are properly configured.
- View the results in the central SNMP management software.