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 πŸ—‘οΈ. TIME is given as the number of seconds since the beginning of the Epoch. easiest way to make one of those is the GNU date(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 the XYMONHISTDIR directory get replaced. this option makes trimhistory save 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 β€” causes trimhistory to delete files from hosts that are not listed in the hosts.cfg(5) file. gone, not sorry πŸ’€
  • --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 still exists. but with this flag? she's cleaning them out too.
  • --droplogs β€” processes the XYMONHISTLOGS directory 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] β€” makes trimhistory output a status line for every N history logs or status-log collections it processes, so you can see how far along she is. the default setting for N is 100.
  • --env=FILENAME β€” loads the environment from FILENAME before executing trimhistory. 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 the hosts.cfg file, which holds the list of currently known hosts in Xymon. this is how she knows who's still invited to the party πŸŽ‰

πŸ‘‘ SEE ALSO πŸ‘‘

xymon(7), hosts.cfg(5)


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