[Xymon] Managing Xymon Server Data Disk Usage

Henrik Størner henrik at hswn.dk
Tue Aug 23 23:33:26 CEST 2011


On 23-08-2011 23:02, John Aldridge wrote:
> I've been watching disk usage grow on a Xymon server for about the past
> six months, and this growth seems fairly steady and linear.
>
> The big directories are histlogs and hostdata.
>
> After digging into the documentation, I'm wondering what strategies
> Xymon admins prefer for managing disk usage.

hostdata: Used primarily for troubleshooting incidents. So you probably 
don't need to save this for very long. I keep it for one month, and 
simply run a cron-job to delete any files older than 30 days.

histlogs: Holds the detailed statuslogs that are linked to from the 
"History" and reports-pages. On the 1st of each month, I run a script to 
archive all of the history logs generated during the past month into a 
compressed cpio archive. They compress very well, so this is an 
effective way of archiving them. Then I delete all of the files that are 
older than 3 months.

With bash + GNU date, this will do it (run it on the 1st of the month):


# Delete histlogs from 4 months ago (so we always have the
# last 3 months online)
FNPATTERN=`date --date="today -4 months" +"???_%b_*_%Y"`
find histlogs -name "$FNPATTERN" | xargs rm

# Archive histlogs generated in the past month
FNPATTERN=`date --date="today -1 month" +"???_%b_*_%Y"`
ARCFN=`date --date="today -1 month" +"histlogs_%Y_%m.cpio.gz"`
find histlogs -name "$FNPATTERN" | \
    cpio -o | gzip >archive/$ARCFN

# Delete hostdata-files older than 30 days
find hostdata -mtime +30 | xargs rm


Regards,
Henrik



More information about the Xymon mailing list