Sun Management Center 3.6 System Reliability Manager User's Guide

Validation Script

During a refresh of the module, if the module detects that the timestamp of a file has changed, the associated validation script is executed. The exit code of the last execution is displayed in the Exit Code field. When a new value is given to the script field, the module checks whether the path given is a valid file. If the path is not valid, the Exit Code field displays NO_SUCH_SCRIPT. The field could also display killed if the validation script that was running was killed. In this case, specify regular expressions on which to generate alarms for Exit Code.

You can place your own validation scripts in the /var/opt/SUNWsymon/SysMgmtPack/filewch/scripts directory or use the fileparse binary installed with the module.

fileparse Binary

fileparse is a C binary located in /var/opt/SUNWsymon/SysMgmtPack/filewch/scripts/.

The default list of script files has a value set for Validation Script and Record Format. For example, for /etc/hosts, the values are set as follows:

The binary parses filename against the record_format specified in the file definition contained in the Watched File table. Errors are reported if the file contents do not conform to the input file record_format. Blank lines and comment lines are skipped. The binary returns the following values:

0

Success

1

Cannot open file

2

record_format is not correct

3

file format is not correct

–1

program error, such as not enough memory

–2

argument error