This article describes how to utilize components of the CA NSM Integration for OpenVMS software to send SNMP traps from CA System Watchdog for OpenVMS to a system that can receive, process, and display SNMP traps. Be advised that the method described in this article is not guaranteed to work correctly with any third-party or open source software that can receive SNMP traps. The CA NSM Integration software has only been tested and certified to work with CA Network and Systems Management (NSM); however, multiple users have found that the traps can be received and processed with products such as NetCool and HP OpenView to name a few.
It is assumed that you are familiar with using the OpenVMS operating system, that you are generally familiar with using CA System Watchdog for OpenVMS, and that you have experience using the CA System Watchdog profile editor.
All of the steps described in this article must be performed on the OpenVMS system(s) where the CA System Watchdog consolidator is running.
Before you begin, determine the names and locations of the CA System Watchdog profile data files that are in use and record their names and locations. For purposes of example, this article will use a profile named SNS$PROFILE.DAT that is located in SYS$MANAGER:.
The application that actually sends the traps is located in a directory created during the installation of CA System Watchdog for OpenVMS, and the application must be run as a detached process or within a batch job; the process that runs the application is referred to as the "trap daemon". Typically, the trap daemon is started during system boot by adding the necessary commands to your system startup procedures.
The section titled "Instructions" will describe how to send traps when one of the standard internal events is detected by CA System Watchdog. If you are also using external messages, then you will also need to read the information contained in the "Additional Information" section of this document.
1. Login to a privileged user account, preferably the SYSTEM account. Define a logical name, CAPOLY$TRAP_DST, that equates to the IP host name of the system where you will send SNMP traps, and then start the trap daemon. For purposes of example, we will use "operstat.nosuch.org" for the host name of the system where traps will be sent. You should execute the following commands and add them to your system startup procedures to ensure that the logical name and trap daemon are defined and started during system boot. When adding them to your system startup procedures, make sure that they will be executed before your CA System Watchdog consolidators are started:
$ DEFINE/SYSTEM CAPOLY$TRAP_DST operstat.nosuch.org
$ Run /DETACHED SYS$COMMON:[UNIVMS.BIN]CAPOLY$PSWEVENT.EXE -
/PROCESS_NAME="CAPOLY$PSWEVENT"-
/INPUT=NL:-
/OUTPUT=SYS$MANAGER:CAPOLY$PSWEVENT.LOG -
/ERROR=SYS$MANAGER:CAPOLY$PSWEVENT.LOG -
/priv=ALL-
/UIC=SYSTEM
You may use any file specification that you wish for the output and error log files by updating the /OUTPUT and /ERROR qualifiers appropriately. Furthermore, the trap daemon neither has a command interface nor special requirements for system shutdown, therefore it is not unnecessary to take action during system shutdown.
2. Determine the names of the internal event classes used in your CA System Watchdog consolidator profiles. Here are example commands using SYS$MANAGER:SNS$PROFILE.DAT as the file name of the profile and MYPROFILE.OUT for the name of the output file that we will create with the editor:
$ SENSE WATCH EDIT PROFILE SYS$MANAGER:SNS$PROFILE.DAT
SNS$EDIT> SNOW ALL/FORMAT=COMMANDS/OUTPUT=MYPROFILE.OUT
SNS$EDIT> EXIT
$ SEARCH MYPROFILE.OUT "ADD CLASS"
ADD CLASS DEFAULT
ADD CLASS MYCLASS
$
The above output shows that we have two internal classes defined and they are named "DEFAULT" and "MYCLASS"; the class named "DEFAULT" is created automatically whenever a new profile is created. Your profiles may contain more message classes; record the names of all classes for use in the next step.
3. Create a command file using a name that includes the name of the profile that you are working with. Continuing with the example from step 1, we will use SNS$PROFILE_TRAP_SETUP.COM and add the following lines of text:
ADD MAILBOX_SET SEND_TRAP/MAILBOX=SNS$TNG_MBX
MODIFY CLASS DEFAULT/EVENT=ALL/MAILBOX=SEND_TRAP
Repeat the above MODIFY CLASS command once for each message class in your profile by substituting your class name for the word "DEFAULT". Continuing with the example started in step 1, we must also change the event class named "MYCLASS" by executing the following command:
MODIFY CLASS MYCLASS/EVENT=ALL/MAILBOX=SEND_TRAP
Optional: If you are also using external messages defined in external message classes, you can review the section titled "Additional Information", which immediately follows this section, and use the information contained therein to create a single command file that modifies both the internal and external message classes.
4. Now we will re-enter the profile editor and execute the command file that we just created:
$ SENSE WATCH EDIT PROFILE SYS$MANAGER:SNS$PROFILE.DAT
SNS$EDIT> @SNS$PROFILE_TRAP_SETUP.COM
SNS$EDIT> EXIT
The EXIT command will save all changes and terminate the editing session.
5. Repeat steps 2, 3, and 4 for each profile that you are using. Be sure to change the name of the output file used with the /OUTPUT command qualifier to something unique that will help you remember which profile it was produced from. Also be sure to use different names for the profile command files that you create in step 2.
6. Up to this point, we have modified the profile data files on disk but we have not yet made them active. You may either restart each consolidator, or use the DCL command $ SENSE WATCH RECONFIGURE to force the consolidator(s) to read the update profile(s); you must execute the command once for each consolidator by first identifying and selecting each consolidator. Use the DCL command $ SENSE WATCH SHOW CONSOLIDATOR/ALL/FULL in order to determine how many consolidators are running on your system. Here is an example from a system where two consolidators are running. Pay special attention to the line beginning with the word "Consolidator" that is followed by a colon (:) and a number; the number is the consolidator identifier (ID) and it will be unique for every consolidator that is running on the system:
$ SENSE WATCH SHOW CONSOLIDATOR/FULL/ALL
Controller : V2.5-0706
Consolidator : 115 V2.5-0706
Profile : SNS$PROFILE.DAT
Log file : SNS$LOG.DAT Disabled
Action routines : Enabled
DECtalk : Enabled
Mailbox : Disabled
Polling interval : 60
Before setting : Not specified
Since setting : Not specified
Watchdog information:
Node Status Class Version OS Version
ES54PR Enabled DEFAULT 2.4-1306 V8.4
Consolidator : 124 V2.5-0706
Profile : DEVCLUS_PROFILE.DAT
Log file : DEVCLUS$LOG.DAT Disabled
Action routines : Enabled
DECtalk : Enabled
Mailbox : Disabled
Polling interval : 60
Before setting : Not specified
Since setting : Not specified
Watchdog information:
Node Status Class Version OS Version
I64DV1 Enabled DEFAULT V2.5-0706 V8.3
The output above shows that there are two consolidators running on the system and that their ID numbers are 115 and 124. The consolidator with ID number 115 uses a profile name of SNS$PROFILE.DAT, and the consolidator with ID number 124 uses a profile name of DEVCLUS_PROFILE.DAT. If both of those profiles are edited (assume they are stored in SYS$MANAGER) by following steps 2, 3 and 4, then the following commands will force the consolidators to read and activate the updated profiles:
$ SENSE WATCH SET CONSOLIDATOR 115
$ SENSE WATCH RECONFIGURE
$SENSE WATCH SET CONSOLIDATOR 124
$ SENSE WATCH RECONFIGURE
At this point, you have successfully updated the consolidator profiles and made them active; you should start receiving traps on the system referenced by the logical name CAPOLY$TRAP_DST.
If you are using external message classes in your CA System Watchdog consolidator profiles, and you want to send traps whenever an external message is sent to the consolidator(s), then you must follow the instructions in this section. In order to save time and effort, you may merge the instructions shown below with those shown in the "Instructions" section immediately above:
1. Search the output file created by the profile editor during step 2. Continuing with the example from the "Instructions" section, we will search the file named MYPROFILE.OUT:
$ SEARCH MYPROFILE.OUT "MODIFY EXTERNAL"/WINDOW=3
MODIFY EXTERNAL_MESSAGE_CLASS MYCLASS -
/TEXT="Error closing database "/PRIORITY=HIGH/POSITION= 1 -
/SEVERITY=ERROR
MODIFY EXTERNAL_MESSAGE_CLASS MYCLASS -
/TEXT="Error opening database "/PRIORITY=HIGH/POSITION=2 -
/SEVERITY=FATAL
We can see that there is one external message class named "MYCLASS" that defines two external messages.
2. Re-execute the "SEARCH" command in step 1, but this time add a /OUTPUT qualifier in order to save the results of the search to a file that we can edit with a text editor. Continuing with the example, we'll execute the following with the result being to save the output of the search to the file named MODIFY_EXTERNAL.COM:
$ SEARCH MYPROFILE.OUT "MODIFY EXTERNAL"/WINDOW=3/OUTPUT=MODIFY_EXTERNAL.COM
3. Use your favorite text editor to edit the file we just created, namely MODIFY_EXTERNAL.COM, so that we can add a new command qualifier to each of the MODIFY commands. If we continue with the example, we will change commands shown in step 1 to look like the following; the necessary changes are shown in bold text:
MODIFY EXTERNAL_MESSAGE_CLASS MYCLASS -
/TEXT="Error closing database "/PRIORITY=HIGH/POSITION= 1 -
/SEVERITY=ERROR/MAILBOX_SET=SEND_TRAP
MODIFY EXTERNAL_MESSAGE_CLASS MYCLASS -
/TEXT="Error opening database "/PRIORITY=HIGH/POSITION=2 -
/SEVERITY=FATAL/MAILBOX_SET=SEND_TRAP
Exit the editor after making all of the necessary changes.
4. Now we update the external messages using the System Watchdog profile editor by executing the command file edited in step 3. Again, using our example, we execute the following commands to enter the profile editor, execute the command file, and save the changes:
$ SENSE WATCH EDIT PROFILE SYS$MANAGER:MYPROFILE.DAT
SNS$EDIT>@MODIFY_EXTERNAL
SNS$EDIT> EXIT
5. The final step is to activate the changes by executing step 6 in the "Instructions" section that is immediately above this section.