On 9/23/2015 8:03 AM, Dirk Kastens wrote:
Hi,
I'm running the trimhistory command every night to clean up the logfiles from events that happend more than a year ago using the following command:
/bin/su - xymon -c '/usr/libexec/xymon/trimhistory --cutoff=
date +%s --date="today -1 year"--drop --droplogs --env=/etc/xymon/xymonserver.cfg'Now I found out, that most of the files in the /var/lib/xymon/hist directory are corrupted and that the history of these tests are not displayed any longer on the web page. The first line of the files look like this:
Tue Jun 17 12:41:45 2014 green 1403001705Tue Jun 17 12:41:45 2014 green 1403001705 37051426
I'm not sure, but I think that the trimhistory command is responsible for that. Any ideas?
On 9/23/2015 8:07 AM, Dirk Kastens wrote:
Oh, I'm using Xymon 4.3.20-1.el6.terabithia
Dirk,
I'm not aware of any specific issue with the trimhistory command. If you were following along with the test RPMs last year there was a bug in xymond_history that could sometimes cause this in 4.3.18-0.0.7464 that I believe was fixed by 4.3.18-0.0.7471. It may be a left-over line from around that time, if you were running that.
A quick fix is to re-split the lines on the datestamp so that the history CGI can read through it. Something like (untested!): perl -pe 's/(\d+)([A-Z][a-z]))/\1\n\2/' <historyfile> might correct the display (and can be run recursively once tested).
If previously-OK history files are being clobbered by trimhistory going forward, that's definitely a problem. Do you think you might be able to gather a before/after file set in that case? It would definitely help with debugging.
Additionally, I'd recommend upgrading to RPM 4.3.21-4, though I don't believe there are any specific fixes that would affect this there.
HTH, -jc