[Xymon] Xymongrep in 4.3.17 does not load local hosts.cfg

J.C. Cleaver cleaver at terabithia.org
Tue Jul 29 18:53:50 CEST 2014



On Tue, July 29, 2014 1:20 am, Wladimir K wrote:
> Hi,
>
> I compiled xymon 4.3.17 on Suse 11 distribution successfuly and the
> server is running. But when I call xymongrep I get the following:
>
> xymon at n1000 > xymongrep test
> 2014-07-29 09:24:01 Cannot load
> /opt/xymon/default/server/etc/hosts.cfg, or file is empty
>
> Xymon is installed in /opt/xymon/default/.
>
> The file exists and has the necessery permissions:
>
> -rw-rw-r-- 1 xymon users 1308 2014-07-18 14:45
> /opt/xymon/default/server/etc/hosts.cfg
>
> The hosts.cfg is also not empty and worked with Xymon 4.2.3.
>
> With strace I don't see that xymongrep even tries to open the file:
>
*snip*
>
> Actually, instead of opening the file it is trying to get it via network:
> socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 3 fcntl(3, F_SETFL,
> O_RDONLY|O_NONBLOCK)  = 0 connect(3, {sa_family=AF_INET,
> sin_port=htons(1984), sin_addr=inet_addr("127.0.0.1")}, 16) = -1
> EINPROGRESS (Operation now in progress)
> select(4, [3], [3], NULL, {15, 0})      = 1 (out [3], left {14, 999998})
> getsockopt(3, SOL_SOCKET, SO_ERROR, [72058139498774528], [4]) = 0
> write(3, "config hosts.cfg", 16)        = 16
>
> Which does not work as the port is not 1984 but 1988. But why does it
> try to make network connection and doesn't open the local file. And
> even then it writes to stdout that it tries to open the file locally
> but it doesn't.
>
> Thanks in advance for your help.
>
> WK

I'd have to validate, however it seems like xymongrep might do that when
it's running without an environment. Typically its use case is in scripts
that are being executed via xymonlaunch and have already had an "ENV
/path/to/xymonserver.cfg" (or equivalent) set up for them. This would also
explain not hitting your custom XYMONDPORT value.

>From the command line, can you try running 'xymoncmd
--env=/path/to/xymonservercfg xymongrep test', or explicitly specifying
'env HOSTSCFG=/path/to/hosts.cfg xymongrep test'?


HTH,
-jc




More information about the Xymon mailing list