On 03/06/2020 22:49, me at tdiehl.org wrote:
Hi,
I am trying to configure xymon dependencies so that if the core router is down my xymon server only pages me for the core router.
In reading the man page it says to do something like the following:
1.2.3.4 cg1.example.com # noconn https://cg1.example.com depends=(http:router.example.com/conn)
The above works for a single service but the above host for example has http and sslcert. How can I tell xymon that if router.example.com is down all of the other services for a host should go clear?
I tried setting the service to a * that does not work. and I tried listing services separated with either a comma or a pipe but no joy.
"man hosts.cfg" suggests that the syntax you want is
depends=(testA:host1/test1,host2/test2),(testB:host3/test3)
so for your example,
depends=(http:router.example.com/conn),(sslcert:router.example.com/conn)
As the man page says, "depends" only applies to tests performed by xymonnet. Wildcards do not appear to be supported but protocols.cfg will show you most of the tests that xymonnet might perform.
Also is there a way to test the syntax to know if I got it right short of waiting for 5 or 10 minutes to see if it worked?
Because the tests are performed by xymonnet, you can just ran that command yourself. Your tasks.cfg will show you the xymonnet command you're currently running, so something like
xymonnet $(list_of_options) cg1.example.com router.example.com
will test just those two hosts. (NB xymonnet might not be on your path so you may need to explicitly use the full path to the binary) You could add --no-update to have xymonnet dump messages to stdout rather than sending the status message to your xymon server if you prefer.
Adam