.TH TRIMHISTORY 8 "Version 4.3.28: 17 Jan 2017" "Xymon" .SH NAME trimhistory \- Remove old Xymon history-log entries .SH SYNOPSIS .B "trimhistory \-\-cutoff=TIME [options]" .SH DESCRIPTION The \fBtrimhistory\fR tool is used to purge old entries from the Xymon history logs. These logfiles accumulate information about all status changes that have occurred for any given service, host, or the entire Xymon system, and is used to generate the event- and history-log webpages. Purging old entries can be done while Xymon is running, since the tool takes care not to commit updates to a file if it changes mid-way through the operation. In that case, the update is aborted and the existing logfile is left untouched. Optionally, this tool will also remove logfiles from hosts that are no longer defined in the Xymon .I hosts.cfg(5) file. As an extension, even logfiles from services can be removed, if the service no longer has a valid status-report logged in the current Xymon status. .SH OPTIONS .IP "\-\-cutoff=TIME" This defines the cutoff-time when processing the history logs. Entries dated before this time are discarded. TIME is specified as the number of seconds since the beginning of the Epoch. This is easily generated by the GNU .I date(1) utility, e.g. the following command will trim history logs of all entries prior to Oct. 1st 2004: .br .sp trimhistory \-\-cutoff=`date +%s \-\-date="1 Oct 2004"` .IP "\-\-outdir=DIRECTORY" Normally, files in the XYMONHISTDIR directory are replaced. This option causes trimhistory to save the shortened history logfiles to another directory, so you can verify that the operation works as intended. The output directory must exist. .IP \-\-drop Causes trimhistory to delete files from hosts that are not listed in the .I hosts.cfg(5) file. .IP \-\-dropsvcs Causes trimhistory to delete files from services that are not currently tracked by Xymon. Normally these files would be left untouched if only the host exists. .IP \-\-droplogs Process the XYMONHISTLOGS directory also, and delete status-logs from events prior to the cut-off time. Note that this can dramatically increase the processing time, since there are often lots and lots of files to process. .IP "\-\-progress[=N]" This will cause trimhistory to output a status line for every N history logs or status-log collections it processes, to indicate how far it has progressed. The default setting for N is 100. .IP "\-\-env=FILENAME" Loads the environment from FILENAME before executing trimhistory. .IP \-\-debug Enable debugging output. .SH FILES .IP "$XYMONHISTDIR/allevents" The eventlog of all events that have happened in Xymon. .IP "$XYMONHISTDIR/HOSTNAME" The per-host eventlogs. .IP "$XYMONHISTDIR/HOSTNAME.SERVICE" The per-service eventlogs. .IP "$XYMONHISTLOGS/*/*" The historical status-logs. .SH "ENVIRONMENT VARIABLES" .IP XYMONHISTDIR The directory holding all history logs. .IP XYMONHISTLOGS The top-level directory for the historical status-log collections. .IP HOSTSCFG The location of the hosts.cfg file, holding the list of currently known hosts in Xymon. .SH "SEE ALSO" xymon(7), hosts.cfg(5)