Top
ServerView Resource Coordinator VE Operation Guide

Appendix C Event Handling Function

This appendix explains the event handling function.

This function allows execution of pre-defined scripts (batch file) whenever the Admin Server receives SNMP Traps (events) from a registered device. This function works with the following devices.

The following script is executed each time an event occurs.

Installation folder\Manager\etc\trapop.bat Argument 1 Argument 2 Argument 3 Argument 4 Argument 5 Argument 6

The default-installed script will log each event, but will not trigger any action based on those events.
However, it is possible to trigger operations such as email notifications or calls to external management software (command calls or event notifications) by providing a custom-script to use in place of the default script.

For the following events, however, only the event log is displayed. The event handling script is not executed.

Note

In a clustered Manager configuration, it is necessary to store the same script (batch file) on both the primary and secondary nodes for this function to work properly.


E-Mail Notification Sample

Below is an example of a trapopt.bat script that will send e-mail notifications for each event received. To use this example, remove comments and set the following addresses to match actual environment values. Perform any additional customization if necessary.

E-Mail Notification Sample

@echo off
rem set MAIL_SERVER_ADDRESS=server.address           <- mail server address
rem set MAIL_FROM=from_your@e-mail.address           <- sender address 
rem set MAIL_TO=to_your@e-mail.address               <- destination address
rem set MAIL_SUBJECT="Resource Coordinator VE (%COMPUTERNAME%) event mail"
rem set SENDMAIL_VBS=sendmail.vbs
rem set MAILCMD=cscript"%~dp0%SENDMAIL_VBS%" %MAIL_FROM% %MAIL_TO% %MAIL_SUBJECT% %MAIL_SERVER_ADDRESS% %1 %2 %3 %4 %5 %6 //nologo
rem %MAILCMD%

When actually using this script, remove all comments and enter appropriate addresses.

@echo off
set MAIL_SERVER_ADDRESS=server.address               <- mail server address
set MAIL_FROM=from_your@e-mail.address               <- sender address
set MAIL_TO=to_your@e-mail.address                   <- destination address
set MAIL_SUBJECT="Resource Coordinator VE (%COMPUTERNAME%) event mail"
set SENDMAIL_VBS=sendmail.vbs
set MAILCMD=cscript"%~dp0%SENDMAIL_VBS%" %MAIL_FROM% %MAIL_TO% %MAIL_SUBJECT% %MAIL_SERVER_ADDRESS% %1 %2 %3 %4 %5 %6 //nologo
%MAILCMD%

Information

The sample sendmail.vbs file (stored in the same folder as trapopt.bat) is making use of Windows CDO (Microsoft Collaboration Data Objects) to connect to an external SMTP server and send e-mail notifications.
If it becomes necessary to customize the contents of notification e-mails, use this sample script as a reference for the creation of custom scripts.
For details on VBScript and CDO, refer to the technical reference provided by Microsoft.