On Sat, 2013-07-20 at 19:10 +0000, cleaver at terabithia.org wrote:
On Wed, 2013-07-17 at 00:38 +0000, cleaver at terabithia.org wrote:
Hello,
Using Xymon 4.3.10 I wanted to remove a host completely, so used the following command on the Xymon server:
xymon xxx.xxx.xxx.xxx "drop lib-srvr10"
This removed all of the host data except for the 'lib-srvr10' subdirectory in the 'data/hostdata' directory. The subdirectory still contained all of the data files for the host.
I had already removed the host from the hosts.cfg file, and restarted Xymon. No errors were seen in any of the log files.
Hmm. Just ran this myself on the occasion of having a host to drop and it seemed to be working okay. Worked both for a host I was dropping "live" and one that had already been deleted a restart or two ago ; in both cases the directory under hostdata/* was removed properly.
Is this still occurring for you? Had it happened before?
I can probably test this with some test servers. However, where does the deletion of 'hostdata' directories occur? I'll add some logging/debugging to see if I can see what is going on.
The deletion is handled by xymond_hostdata.c when it gets a @@drophost message (which gets sent to all channels by xymond and bypasses xymond_channel filters). It's around 263 in the .c code in my copy.
== snip == else if ((metacount > 3) && (strncmp(metadata[0], "@@drophost", 10) == 0)) { /* @@drophost|timestamp|sender|hostname */ char hostdir[PATH_MAX]; sprintf(hostdir, "%s/%s", clientlogdir, metadata[3]); dropdirectory(hostdir, 1); } == snip ==
At the risk of stating the obvious :) , did you double-check owner and permissions on the dir?
Hello, Yes I rechecked the ownership and permissions on the directory path and filenames. They are fine :-) I've started xymond_hostdata with the '--debug' option, but am not seeing the '@@drophost' command being received. The main xymond log sees the actual 'drop jhvm2' command though ('jhvm2' is the test host name). So I am currently testing the above bit of code to see that it is actually being reached. John. -- John Horne Tel: +44 (0)1752 587287 Plymouth University, UK Fax: +44 (0)1752 587001