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.
If fileparse is specified, the module ignores the parameters provided. The arguments are built from the delimiter, comment, and record format values that are known for the file. If you specify a value, all the parameters are replaced by the ones built into the module. This behavior ensures that no unsupported comment or unsupported delimiter is specified.
If, for example, you specify mytest.sh -a myarg, the mytest.sh script will be executed, with -a myarg as argument.
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:
Validation Script is set to fileparse
Record Format is set to IPADDRESS STRING STRING
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:
Success
Cannot open file
record_format is not correct
file format is not correct
program error, such as not enough memory
argument error