Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 4 135
Testing a Resource Monitor with montest
Using montest
Using montest
To invoke the montest tool, issue the following command:
$ /opt/resmon/devkit/montest/montest [-f
filename
]
The
filename
is the full path name of a montest script. If you specify the
-f
filename
option, montest executes the script and sends the output to
a log file in the /var/opt/resmon/log/montest directory. Log files are
called emslog
hh:mm:ss
, where
hh:mm:ss
is the time the file was created.
A sample montest script is supplied in
/opt/resmon/devkit/montest/montest.template.
If you do not specify the -f
filename
option, the montest tool runs
interactively. In interactive mode, montest asks you for the name of a
resource. When you specify a resource class, montest lists the resource
classes and instances below the specified resource class in the resource
tree. If you specify a resource instance, montest prompts you for the
information it needs to create a monitor request.
When run interactively, montest sends its output to standard output. It
stores your answers to its prompts in the file
/var/opt/resmon/log/montest/ems_cmds. You can use the ems_cmds
file as a montest script by typing the following commands:
$ cd /opt/resmon/devkit/montest
$ montest -f /var/opt/resmon/log/montest/ems_cmds
Your answers to prompts are appended to the ems_cmds file, if the file
already exists. If the file does not exist, montest creates it.
NOTE If you interrupt an interactive montest session, the ems_cmds file may
contain an incomplete montest script. Be sure the ems_cmds file contains
the output from a complete montest session before you attempt to run it
as a montest script.