Previous Topic: Types of Action RoutinesNext Topic: Create Image Actions


Creating Command Procedure Actions

Command procedures are the simplest and easiest mechanism to use to get notification of an event. Any command procedure can be dispatched when the rules specified by a filter definition are met. The only requirement is a correctly defined entry for the action in the configuration database. Event attributes are passed as arguments on the command line. For example, P1, P2... Pn.

The following example shows the command procedure for the Mail action routine supplied with Console Manager.

$ !
$ ! COPYRIGHT (c) 1997 BY
$ ! CA, Inc.
$ ! ALL RIGHTS RESERVED.
$ !
$ ! THIS COMPUTER SOFTWARE PROGRAM IS PROPRIETARY AND
$ ! CONFIDENTIAL INFORMATION OWNED BY COMPUTER
$ ! ASSOCIATES INTERNATIONAL, INC. USE OF THIS
$ ! SOFTWARE IS AUTHORIZED ONLY PURSUANT TO A VALID
$ ! LICENSE AGREEMENT FROM CA. THIS
$ ! COMPUTER SOFTWARE PROGRAM IS PROTECTED BY THE
$ ! COPYRIGHT LAWS OF THE UNITED STATES AND THE
$ ! INTERNATIONAL TREATY AND MAY NOT BE DISCLOSED,
$ ! REPRODUCED, OR DUPLICATED IN WHOLE OR IN PART
$ ! WITHOUT THE EXPRESS WRITTEN AUTHORIZATION
$ ! OF CA.
$ !
$ ! THIS COMPUTER PROGRAM AND DOCUMENTATION IS
$ ! PROVIDED WITH RESTRICTED RIGHTS. USE, DUPLICATION
$ ! OR DISCLOSURE BY THE U.S. GOVERNMENT IS SUBJECT TO
$ ! THE RESRTICTIONS SET FORTH IN 48 CFR 52.227-19
$ ! (C) (1)AND (2) OR DFARS 252.227-7013 (C) (1) (ii)
$ ! OR APPLICABLE SUCCESSOR PROVISIONS. THE
$ ! MANUFACTURER IS CA INTERNATIONAL,
$ ! INC.
$ !
$ !
$ ! Console Manager action routine to deliver a mail
$ ! message to a person or a distribution list
$ !
$ CM_HOST == F$GETSYI("NODENAME")
$ UNIQUE == F$GETJPI("","PID")
$ FILENAME == "CONSOLE$TMP:''UNIQUE'.TMP"
$ open/write mailfile 'FILENAME'
$ write mailfile " Message from Console Manager host ''CM_HOST' "
$ write mailfile " "
$ write mailfile " An event occurred on the console for system ''P7'"
$ write mailfile " "
$ write mailfile " The details for this event are as follows :- "
$ write mailfile " "
$ write mailfile " Event : ''P1'"
$ write mailfile " Class : ''P2'"
$ write mailfile " Info : ''P3'"
$ write mailfile " Text : ''P4'"
$ write mailfile " Priority : ''P5'"
$ write mailfile " Time : ''P6'"
$ write mailfile " "
$ close mailfile
$ !
$ !
$ MAIL/SUBJECT="Console Manager Event Notification" -
 'FILENAME' "''P8'"
$ DELETE 'FILENAME';*
$ exit