Xymon Mailing List Archive search

Trimhistory error

7 messages in this thread

list Rich Smrcina · Wed, 13 Sep 2006 19:20:44 -0500 ·
I'm trying to run the trimhistory command and I get the following errors:

hobbit at hobbit:~/server/bin> ./trimhistory --drop --dropsvcs --droplogs 
--cutoff=`date +%s --date="1 Sep 2005"`
2006-09-13 19:18:40 Whoops ! bb failed to send message - timeout
2006-09-13 19:18:40 Cannot get list of host/test combinations

-- 
Rich Smrcina
VM Assist, Inc.
Phone: XXX-XXX-XXXX
Ans Service:  XXX-XXX-XXXX
user-61add9955ef9@xymon.invalid

Catch the WAVV!  http://www.wavv.org
WAVV 2007 - Green Bay, WI - May 18-22, 2007
list Henrik Størner · Thu, 14 Sep 2006 07:35:47 +0200 ·
quoted from Rich Smrcina
On Wed, Sep 13, 2006 at 07:20:44PM -0500, Rich Smrcina wrote:
I'm trying to run the trimhistory command and I get the following errors:

hobbit at hobbit:~/server/bin> ./trimhistory --drop --dropsvcs --droplogs 
--cutoff=`date +%s --date="1 Sep 2005"`
2006-09-13 19:18:40 Whoops ! bb failed to send message - timeout
2006-09-13 19:18:40 Cannot get list of host/test combinations
What happens if you run it via the "bbcmd" utility ? i.e.
   ./bbcmd trimhistory --drop --dropsvcs --droplogs \
     --cutoff=`date +%s --date="1 Sep 2005"`


Regards,
Henrik
list Rich Smrcina · Thu, 14 Sep 2006 05:14:14 -0500 ·
That appears to run just fine.
quoted from Henrik Størner

Henrik Stoerner wrote:
On Wed, Sep 13, 2006 at 07:20:44PM -0500, Rich Smrcina wrote:
I'm trying to run the trimhistory command and I get the following errors:

hobbit at hobbit:~/server/bin> ./trimhistory --drop --dropsvcs --droplogs --cutoff=`date +%s --date="1 Sep 2005"`
2006-09-13 19:18:40 Whoops ! bb failed to send message - timeout
2006-09-13 19:18:40 Cannot get list of host/test combinations
What happens if you run it via the "bbcmd" utility ? i.e.
   ./bbcmd trimhistory --drop --dropsvcs --droplogs \
     --cutoff=`date +%s --date="1 Sep 2005"`


Regards,
Henrik

-- 
Rich Smrcina
VM Assist, Inc.
Phone: XXX-XXX-XXXX
Ans Service:  XXX-XXX-XXXX
user-61add9955ef9@xymon.invalid

Catch the WAVV!  http://www.wavv.org
WAVV 2007 - Green Bay, WI - May 18-22, 2007
list Dirk Kastens · Wed, 23 Sep 2015 17:03:12 +0200 ·
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?

Regards,
Dirk
list Dirk Kastens · Wed, 23 Sep 2015 17:07:53 +0200 ·
Oh, I'm using Xymon 4.3.20-1.el6.terabithia
list Japheth Cleaver · Wed, 23 Sep 2015 11:39:46 -0700 ·
quoted from Dirk Kastens
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
list Dirk Kastens · Thu, 24 Sep 2015 08:33:15 +0200 ·
Hi Japheth,
quoted from Japheth Cleaver
A quick fix is to re-split the lines on the datestamp so that the
history CGI can read through it.
I ran an "sed" script, yesterday, to clean up the logs. Now the display 
is ok. I will wait an see, if there will be new corrupted files after 
trimhistory is running.

Dirk