FairCom Server supports a configuration option to call an external script when a specified DISK_FULL_LIMIT or DISK_FULL_VOLUME limit is reached. This allows server administrator to configure an external process to run when a disk-full limit is reached, for example, the process could write information to a log or notify the administrator.
To configure an external process to run when the space on the specified volume is below the specified limit, set the DISK_FULL_ACTION configuration option in ctsrvr.cfg with the run action.
The supported syntax is:
SUBSYSTEM EVENT DISK_FULL_ACTION {
volume VOLUME
limit LIMIT
run EXE [OPTIONS]
freq FREQUENCY
maxruntime MAXRUNTIME
}
The volume, limit, and run parameters are required. The freq and maxruntime are optional.
Note: When setting a MAXRUNTIME value, consider that no other DISK_FULL_ACTION checks will take place until the script completes, regardless of the FREQ setting. This is of particular importance if more than one DISK_FULL_ACTION is created.
In V12 and later, disk full monitoring keywords have been added to the default ctsrvr.cfg. These keywords are present in this config file, but they have been commented out for so they are there if you need them, but they are NOT enabled.
; SUBSYSTEM EVENT DISK_FULL_ACTION {
volume VOLUME
limit LIMIT
run EXE [OPTIONS]
freq FREQUENCY
maxruntime MAXRUNTIME
}
Example DISK_FULL_ACTION with external process action
The following configuration option causes the batch file diskfull.bat to be run when writing to a c-tree data or index file detects that the space on C:\ has dropped below 1 GB. This disk-full condition is checked once every 60 seconds.
SUBSYSTEM EVENT DISK_FULL_ACTION {
volume C:\
limit 1 GB
run diskfull.bat
freq 60
maxruntime 120
}
Reading parameters sent from the server to the external process
FairCom Server passes a set of ASCII key/value pairs to the external process using standard input, where the input format is key=value, one per line. The keys that FairCom Server passes to the external process are:
Writing parameters from the external process to the server
The external process can optionally pass ASCII key/value pairs back to the server by writing them to standard output in the format key=value, one entry per line. FairCom Server recognizes the following keys:
or
Note: FairCom Server reads only the first 1024 bytes of the output data returned by the script. All data after the first 1024 bytes of output data is ignored.
If the external script's output is not in the supported format, a message is written to CTSTATUS.FCS. Example:
DISK_FULL_ACTION: Command diskfull.bat output does not match format var=value: line 3 column 8
Unlimited MAXRUNTIME script
An unlimited script runtime can be set with MAXRUNTIME 0. When configured as unlimited and a script is run due to the LIMIT and RUN options, the script will never be forced to terminate.
Note: When setting a MAXRUNTIME value, consider that no other DISK_FULL_ACTION checks will take place until the script completes, regardless of the FREQ setting. This is of particular importance if more than one DISK_FULL_ACTION is created.