Additional tests from xymon server
list Ioan Damian
Hi,
I'm trying to add a test to the xymon server. This one has to reside
server-side because not it does domain checks and not all domains have an
assigned IP. Also, connectivity is not a concern here. What I'm trying to
do is add some domain in a subpage and check for changes in their
nameserver IPs. I've written a perl script that does the job and it takes
the domain name as a parameter. In practice I'm trying to replicate what
xymonnet does with the various checks like dns, http, smtp, etc.
I would have something like this hosts.cfg:
page domainchecks <H3>Domain Checks<H3>
<some IP> <the domain name> # noconn <my_test_name>
I did scrip this to check all domains at once but, that's not a desired
behavior because I need to xymon to treat them separately and tell me for
each if something changed or not according to my script.
I setup a test task in tasks.cfg like this:
[Environment]
ENVFILE /var/lib/xymon/server/etc/xymonserver.cfg
NEEDS xymond
CMD $XYMONSERVERROOT/server/ext/env.pl
LOGFILE $XYMONSERVERLOGS/ext-env.log
INTERVAL 5m
I've set it up for some hosts to no avail:
<some ip> <hostname> # env
It only shows up for the xymon server, which leads me to think this is more
cumbersome than I first thought. Has anyone managed to do something like
this before?
--
All I know is that I like you. I have no taste, but I like you.
list Steven Carr
How is your script identifying the hosts in hosts.cfg that have the test set? are you using the xymongrep utility within env.pl? The stanza in tasks.cfg only kicks off the script (every 5 mins as you have specified), it doesn't pass any data to it and doesn't run it for each host, you have to go and grab the data and work out which hosts to check, so use 'xymongrep env' to find all the hosts to check, then split and work out each domain, check each domain and pass the data back to xymon using the 'xymon status' command. Steve
▸
On 13 April 2012 18:10, Ioan Damian <user-1956e6eb648a@xymon.invalid> wrote:
Hi,
I'm trying to add a test to the xymon server. This one has to reside
server-side because not it does domain checks and not all domains have an
assigned IP. Also, connectivity is not a concern here. What I'm trying to
do is add some domain in a subpage and check for changes in their
nameserver IPs. I've written a perl script that does the job and it takes
the domain name as a parameter. In practice I'm trying to replicate what
xymonnet does with the various checks like dns, http, smtp, etc.
I would have something like this hosts.cfg:
page domainchecks <H3>Domain Checks<H3>
<some IP> <the domain name> # noconn <my_test_name>
I did scrip this to check all domains at once but, that's not a desired
behavior because I need to xymon to treat them separately and tell me for
each if something changed or not according to my script.
I setup a test task in tasks.cfg like this:
[Environment]
ENVFILE /var/lib/xymon/server/etc/xymonserver.cfg
NEEDS xymond
CMD $XYMONSERVERROOT/server/ext/env.pl
LOGFILE $XYMONSERVERLOGS/ext-env.log
INTERVAL 5m
I've set it up for some hosts to no avail:
<some ip> <hostname> # env
It only shows up for the xymon server, which leads me to think this is
more cumbersome than I first thought. Has anyone managed to do something
like this before?
--
All I know is that I like you. I have no taste, but I like you.
list Bruce White
How are you passing the domain names to the Perl script? I don't see
how it could find any other name except the one from the xymon server
itself. Generally I have a script which runs and "greps" the hosts.cfg
(old bb-hosts) file to find entries which I want the script run against
and in that script call the actual script which performs the test, pass
the variables needed (hostname or IP address).
.....Bruce
From: xymon-bounces at xymon.com [mailto:xymon-bounces at xymon.com] On Behalf
Of Ioan Damian
Sent: Friday, April 13, 2012 12:11 PM
To: xymon at xymon.com
Subject: [Xymon] Additional tests from xymon server
▸
Hi,
I'm trying to add a test to the xymon server. This one has to reside
server-side because not it does domain checks and not all domains have
an assigned IP. Also, connectivity is not a concern here. What I'm
trying to do is add some domain in a subpage and check for changes in
their nameserver IPs. I've written a perl script that does the job and
it takes the domain name as a parameter. In practice I'm trying to
replicate what xymonnet does with the various checks like dns, http,
smtp, etc.
I would have something like this hosts.cfg:
page domainchecks <H3>Domain Checks<H3>
<some IP> <the domain name> # noconn <my_test_name>
I did scrip this to check all domains at once but, that's not a desired
behavior because I need to xymon to treat them separately and tell me
for each if something changed or not according to my script.
I setup a test task in tasks.cfg like this:
[Environment]
ENVFILE /var/lib/xymon/server/etc/xymonserver.cfg
NEEDS xymond
CMD $XYMONSERVERROOT/server/ext/env.pl
LOGFILE $XYMONSERVERLOGS/ext-env.log
INTERVAL 5m
I've set it up for some hosts to no avail:
<some ip> <hostname> # env
It only shows up for the xymon server, which leads me to think this is
more cumbersome than I first thought. Has anyone managed to do something
like this before?
--
All I know is that I like you. I have no taste, but I like you.
Bruce White Senior Enterprise Systems Engineer | Phone: X-XXX-XXX-XXXX | Fax: XXX-XXX-XXXX | user-58f975e8bf9d@xymon.invalid | http://www.fellowes.com/ Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. Fellowes, Inc.
list Ioan Damian
Hi
Thank you all for your replies. xymongrep is what I was looking for.
Also, Buchan's script was very helpful.
I've managed to add the desired checks by adding a new task in
$XYMONHOME/servers/etc/tasks.d/domain-checks.cfg like this:
[Domain]
ENVFILE $XYMONSERVERROOT/server/etc/xymonserver.cfg
NEEDS xymond
CMD $XYMONSERVERROOT/server/ext/domain_check.pl
LOGFILE $XYMONSERVERLOGS/ext-domain_check.log
INTERVAL 5m
In $XYMONSERVERROOT/server/ext/domain_check.pl I used xymongrep to
filter out only the hosts with the domain tag in hosts.cfg and sent the
status for each of the hostnames I've found back to xymon.
I'm a bit suprised I couldn't find documentation for such endevours more
easily.
▸
On 4/16/2012 12:25 PM, Buchan Milne wrote:On Friday, 13 April 2012 19:10:34 Ioan Damian wrote:Hi, I'm trying to add a test to the xymon server. This one has to reside server-side because not it does domain checks and not all domains have an assigned IP. Also, connectivity is not a concern here. What I'm trying to do is add some domain in a subpage and check for changes in their nameserver IPs. I've written a perl script that does the job and it takes the domain name as a parameter. In practice I'm trying to replicate what xymonnet does with the various checks like dns, http, smtp, etc. I would have something like this hosts.cfg:
page domainchecks<H3>Domain Checks<H3> <some IP> <the domain name> # noconn<my_test_name>
▸
I did scrip this to check all domains at once but, that's not a desired behavior because I need to xymon to treat them separately and tell me for each if something changed or not according to my script. I setup a test task in tasks.cfg like this: [Environment] ENVFILE /var/lib/xymon/server/etc/xymonserver.cfg NEEDS xymond CMD $XYMONSERVERROOT/server/ext/env.pl LOGFILE $XYMONSERVERLOGS/ext-env.log INTERVAL 5m I've set it up for some hosts to no avail: <some ip> <hostname> # env It only shows up for the xymon server, which leads me to think this is more cumbersome than I first thought. Has anyone managed to do something like this before?
Please find an example attached. If I were to write this script today, I might
rather use a perl module I have that handles the communication with hobbitd.
This one uses 'ol' as the service name, or tag that should be in the hosts.cfg
file. I haven't modified it to run in Xymon 4.3.x, the bbhostgrep, and
possibly $ENV{BB} and $ENV{BBDISP} may need to be changed ...
I would recommend against using 'env' as a test name though, as some tests
(e.g. Devmon templates) use 'env' for 'environmental monitoring', such as
temperature, humidity etc.
Regards,
Buchanlist Jeremy Laidman
▸
On Wed, Apr 18, 2012 at 4:42 PM, Ioan Damian <user-1956e6eb648a@xymon.invalid> wrote:
I'm a bit suprised I couldn't find documentation for such endevours more easily.
It's on the "Xymon Tips and Tricks" page from the Help menu in Xymon. Where would you have expected to see the documentation?
list Ioan Damian
▸
On 4/24/2012 3:50 AM, Jeremy Laidman wrote:
On Wed, Apr 18, 2012 at 4:42 PM, Ioan Damian <user-1956e6eb648a@xymon.invalid <mailto:user-1956e6eb648a@xymon.invalid>> wrote:
I'm a bit suprised I couldn't find documentation for such
endevours more easily.
It's on the "Xymon Tips and Tricks" page from the Help menu in Xymon. Where would you have expected to see the documentation?
Face palm... I went like crazy through the man pages. Especially tasks.cfg and xymonserver.cfg.