You can write your script in any language you want. When called with the set of arguments you defined in the parameters
element of your plugin XML file, your script should run a test based on the arguments. If the test was completed successfully, your script should print a zero or a positive integer on standard output that corresponds to the value determined by testing. If your test failed for some reason, you can print one of the following error codes:
-1
, to indicate that the test failed for an unknown reason (UNKNOWN), or -2
to indicate that the test failed for a known reason (FAIL).Note: The plugin monitor takes the last numerical value on a line by itself as the test result.
You can also pass out debugging or error information from your script. Any lines beginning with the string DEBUG:
is logged to the monitor.log
file under $TRAVERSE_HOME/logs/
directory. Any lines beginning with the string ERROR:
are logged to the error.log
file in the logs
directory with WARN
severity.
Once you're done writing your script, you should test it out separately on the command line to be sure it works. Next, place your script in $TRAVERSE_HOME/plugin/monitors/<test_type>
directory (where <test_type>
is the type name specified in the configuration file. Place the XML test descriptor in $TRAVERSE_HOME/plugin/monitors
. If Traverse is installed in a distributed environment (multiple hosts), the monitor script and configuration file should be installed on each host running Traverse. The web application and DGE components must be restarted before the new monitor is usable.