TRIMHISTORY(8)
π TRIMHISTORY π
okay bestie, welcome to trimhistory, part of the Xymon System Manager's Manual situation. she's a section 8 tool, she's here to clean house, and she's lowkey iconic for it. let's get into it π§Ήβ¨
πΈ NAME πΈ
trimhistory β remove old Xymon history-log entries. that's it, that's the job, and she does it flawlessly π
β¨ SYNOPSIS β¨
trimhistory --cutoff=TIME [options]
π¦ DESCRIPTION π¦
so the whole point of trimhistory is purging old entries out of the Xymon history logs. these logfiles are out here accumulating info about every single status change that ever happened β for any given service, any host, or the entire Xymon system as a whole. and that info is what gets used to generate the event- and history-log webpages. so yeah, she's important π«Ά
here's the cute part: you can do the purging while Xymon is actively running. no downtime, no drama. the tool is super careful and will not commit updates to a file if that file changes mid-way through the operation. if that happens? the update gets aborted and the existing logfile is left completely untouched. she's not messy, she's respectful π
and optionally β because she loves an extra credit moment β this tool will also remove logfiles from hosts that are no longer defined in the Xymon hosts.cfg(5) file. and as an extension, she can even remove logfiles from services, if that service no longer has a valid status-report logged in the current Xymon status. so thorough. so main character. periodt π
π OPTIONS π
--cutoff=TIMEβ this is the one that sets the cutoff-time when she's processing the history logs. anything dated before this time gets discarded, bye bye ποΈ.TIMEis given as the number of seconds since the beginning of the Epoch. easiest way to make one of those is the GNUdate(1)utility β for example, this command trims history logs of all entries prior to Oct. 1st 2004:
trimhistory --cutoff=`date +%s --date="1 Oct 2004"`
--outdir=DIRECTORYβ normally, files in theXYMONHISTDIRdirectory get replaced. this option makestrimhistorysave the shortened history logfiles somewhere else instead, so you can verify the operation is doing what you intended (vibe check β ). heads up: the output directory must already exist.--dropβ causestrimhistoryto delete files from hosts that are not listed in thehosts.cfg(5)file. gone, not sorry π--dropsvcsβ causestrimhistoryto delete files from services that are not currently tracked by Xymon. normally these files would be left untouched if only the host still exists. but with this flag? she's cleaning them out too.--droplogsβ processes theXYMONHISTLOGSdirectory as well, and deletes status-logs from events prior to the cut-off time. > β οΈ note that this can dramatically increase the processing time, because there are often lots and lots of files to process. like, a lot a lot. she's not exaggerating, bestie.--progress[=N]β makestrimhistoryoutput a status line for everyNhistory logs or status-log collections it processes, so you can see how far along she is. the default setting forNis100.--env=FILENAMEβ loads the environment fromFILENAMEbefore executingtrimhistory. cute little pre-game ritual π--debugβ enable debugging output. for when you wanna see all the internal thoughts π§ β¨
π FILES π
$XYMONHISTDIR/alleventsβ the eventlog of all events that have happened in Xymon. the whole timeline, basically π$XYMONHISTDIR/HOSTNAMEβ the per-host eventlogs.$XYMONHISTDIR/HOSTNAME.SERVICEβ the per-service eventlogs.$XYMONHISTLOGS/*/*β the historical status-logs.
π ENVIRONMENT VARIABLES π
XYMONHISTDIRβ the directory holding all history logs. the main closet she's cleaning out π§ΊXYMONHISTLOGSβ the top-level directory for the historical status-log collections.HOSTSCFGβ the location of thehosts.cfgfile, which holds the list of currently known hosts in Xymon. this is how she knows who's still invited to the party π
π SEE ALSO π
and that's the whole page, bestie!! π«Ά this was Xymon, Version 4.3.30: 4 Sep 2019, and honestly? she ate. go forth and trim your history, you absolute legend πβ¨ππ¦πΈ
π¦ where this page comes from
- debian bookworm: xymon 4.3.30-1+b2 Β· GPL-2.0-only WITH OpenSSL exception
- debian trixie: xymon 4.3.30-4 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu jammy: xymon 4.3.30-1build2 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu jammy: xymon 4.3.30-1ubuntu0.1 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu noble: xymon 4.3.30-2build3 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu noble: xymon 4.3.30-2ubuntu0.1 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu questing: xymon 4.3.30-4
- ubuntu resolute: xymon 4.3.30-5 Β· GPL-2.0-only WITH OpenSSL exception
- ubuntu stonking: xymon 4.3.30-6 Β· GPL-2.0-only WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms