Xymon Mailing List Archive search

http checks for multiple domains in the same server

4 messages in this thread

list David Hay-Currie · Wed, 26 Jun 2013 14:32:36 -0400 ·
We have a web server that has 7 web sites running, and about 100 domains. Most of the domains are in the same web site.
Currently I have listed the most of the important sites, and I am trying to also get dnsreg (more on that later).
What I would like to do, is run http check on these sites once a day, and not every day. Is it possible? Without changing the default http setting? (the top critical sites I want to check on default schedule)

While I am on the domain topic, I recently moved the server from hobbit to xymon, but the package deleted most of the hobbit folders automatically and I don't remember exactly which folders I had to put the dnsreg check. I though it was a server/ext but it is possible it is %XYMONHOME/client/ext?

David Hay-Currie
IT Manager
Leisure Fitness Equipment LLC
XXX Executive Dr. Suite XX
Newark, DE XXXXX
Phone: (XXX) XXX-XXXX
[cid:user-18a7d2d6ed62@xymon.invalid8EDDA0]<http://www.leisurefitness.com/?referrer=dhaycurrie>;
list Jeremy Laidman · Thu, 27 Jun 2013 13:17:05 +1000 ·
The dnsreg script runs server-side, so should go into server/ext/.

The answer to most "can I..." questions is "yes, it's open source".  ;-)
 Seriously though, you can certainly do an HTTP check daily if you like,
from an ext script, and setting the lifetime on your status messages to 24
hours so as to prevent purples after 5 minutes.  Something like this,
listed in tasks.cfg (or tasks.d/somefile.cfg) to run every day or whatever
you need:

#!/bin/sh
LIFETIME=24h
SITES="http://www.moo.com/this/that https://www.example.net/ ..."
FAILSITES=""; OKSITES=""
for SITE IN $SITES; do
    wget $SITE && OKSITES="$OKSITES $SITE" || FAILSITES="$FAILSITES $SITE"
done
if [ "$FAILSITES" ]; then
    $XYMON status+24h "$HOSTNAME.webchecks red `date` - failed one or more
web checks
These sites FAILED: $FAILSITES
These sites OK: $OKSITES"
else
    $XYMON status+$LIFETIME "$HOSTNAME.webchecks green `date` - all web
checks OK
Sites tested: $OKSITES"
fi

This lumps all tests into one status - adjust the "webchecks" hostname
accordingly if you want.

If you need to do per-site timing to go into RRD, it's a bit more
complicated but doable using the NCV technique.

If you're asking if you can do this kind of thing with the built-in net
checks, then I would think it's possible somehow, but you'd need to do
something a bit more fancy.  I'm thinking that you'd need to setup an
alternative instance of xymonnet using "--test-untagged" and "--validity"
flags and the XYMONNETWORK variable, and tagging hosts.cfg entries with
NET:location.  See the man page for xymonnet for more on this.

J
quoted from David Hay-Currie


On 27 June 2013 04:32, David Hay-Currie <user-ab244b10c769@xymon.invalid>wrote:
We have a web server that has 7 web sites running, and about 100 domains.
Most of the domains are in the same web site.****

Currently I have listed the most of the important sites, and I am trying
to also get dnsreg (more on that later).****

What I would like to do, is run http check on these sites once a day, and
not every day. Is it possible? Without changing the default http setting?
(the top critical sites I want to check on default schedule)****

** **

While I am on the domain topic, I recently moved the server from hobbit to
xymon, but the package deleted most of the hobbit folders automatically and
I don’t remember exactly which folders I had to put the dnsreg check. I
though it was a server/ext but it is possible it is %XYMONHOME/client/ext?
****

** **

*David Hay-Currie*****

*IT Manager*****

*Leisure Fitness Equipment LLC*****

*XXX Executive Dr. Suite XX*****

*Newark, DE XXXXX*****

*Phone: (XXX) XXX-XXXX*****

[image:
http://www.leisurefitness.com/images/LF_4C_Logosig.png?referrer=dhaycurrie]<http://www.leisurefitness.com/?referrer=dhaycurrie>;
****

** **

list David Hay-Currie · Thu, 27 Jun 2013 17:10:34 -0400 ·
For the dnsreg..that is what I thought, and it is where I have it.
I also have /etc/xymon/xymonserver.d
Which does
[dnsreg]
                #DISABLED
                ENVFILE /etc/xymon/xymonserver.cfg
                CMD /usr/lib/xymon/server/ext/dnsreg
                LOGFILE /var/log/xymon/xymonlaunch.log
                INTERVAL 1440m

This is to launch the dnsreg, but I guess it is not launching it
Just in case I also added it to tasks.cfg

For the http checks. I created a httoweb.cfg in tasks.d with the code, and I added the domains (20 at the moment).
What I am wondering is:

1.       Do I need to rename the domain check from the host file (only the http like http://somedomain.com)

2.       And, If I remove the http check, where will it report the status?
quoted from Jeremy Laidman


David Hay-Currie
IT Manager
Leisure Fitness Equipment LLC
XXX Executive Dr. Suite XX
Newark, DE XXXXX
Phone: (XXX) XXX-XXXX

[cid:user-2b381056c201@xymon.invalid11930]<http://www.leisurefitness.com/?referrer=dhaycurrie>;
quoted from Jeremy Laidman

From: Jeremy Laidman [mailto:user-71895fb2e44c@xymon.invalid]
Sent: Wednesday, June 26, 2013 11:17 PM
To: David Hay-Currie
Cc: xymon at xymon.com
Subject: Re: [Xymon] http checks for multiple domains in the same server

The dnsreg script runs server-side, so should go into server/ext/.

The answer to most "can I..." questions is "yes, it's open source".  ;-)  Seriously though, you can certainly do an HTTP check daily if you like, from an ext script, and setting the lifetime on your status messages to 24 hours so as to prevent purples after 5 minutes.  Something like this, listed in tasks.cfg (or tasks.d/somefile.cfg) to run every day or whatever you need:

#!/bin/sh
LIFETIME=24h
SITES="http://www.moo.com/this/that https://www.example.net/ ..."
FAILSITES=""; OKSITES=""
for SITE IN $SITES; do
    wget $SITE && OKSITES="$OKSITES $SITE" || FAILSITES="$FAILSITES $SITE"
done
if [ "$FAILSITES" ]; then
    $XYMON status+24h "$HOSTNAME.webchecks red `date` - failed one or more web checks
These sites FAILED: $FAILSITES
These sites OK: $OKSITES"
else
    $XYMON status+$LIFETIME "$HOSTNAME.webchecks green `date` - all web checks OK
Sites tested: $OKSITES"
fi

This lumps all tests into one status - adjust the "webchecks" hostname accordingly if you want.

If you need to do per-site timing to go into RRD, it's a bit more complicated but doable using the NCV technique.

If you're asking if you can do this kind of thing with the built-in net checks, then I would think it's possible somehow, but you'd need to do something a bit more fancy.  I'm thinking that you'd need to setup an alternative instance of xymonnet using "--test-untagged" and "--validity" flags and the XYMONNETWORK variable, and tagging hosts.cfg entries with NET:location.  See the man page for xymonnet for more on this.

J


On 27 June 2013 04:32, David Hay-Currie <user-ab244b10c769@xymon.invalid<mailto:user-ab244b10c769@xymon.invalid>> wrote:
We have a web server that has 7 web sites running, and about 100 domains. Most of the domains are in the same web site.
Currently I have listed the most of the important sites, and I am trying to also get dnsreg (more on that later).
What I would like to do, is run http check on these sites once a day, and not every day. Is it possible? Without changing the default http setting? (the top critical sites I want to check on default schedule)

While I am on the domain topic, I recently moved the server from hobbit to xymon, but the package deleted most of the hobbit folders automatically and I don't remember exactly which folders I had to put the dnsreg check. I though it was a server/ext but it is possible it is %XYMONHOME/client/ext?
list Jeremy Laidman · Mon, 1 Jul 2013 12:41:50 +1000 ·
quoted from David Hay-Currie
On 28 June 2013 07:10, David Hay-Currie <user-ab244b10c769@xymon.invalid>wrote:
This is to launch the dnsreg, but I guess it is not launching it

Just in case I also added it to tasks.cfg
Xymon will ignore extra task configs with the same name.  I don't know
which would be honoured, but having two might lead to confusion.  If you're
not sure that it's taking the tasks.d version, just add to tasks.cfg until
you know it's working.

If it doesn't appear to be running:
1) Look at the log file listed in the tasks.cfg config for [dnsreg],
perhaps even change the logfilename to /var/log/xymon/dnsreg.log and see if
the logfile gets created, and if anything interesting appears.
2) Change the command to something simple like "/usr/bin/date" and see if
the output appears in your log, then work backwards.
3) Try running the command manually, from within "xymoncmd", after sourcing
the environment.  Something like this:

$ /usr/lib/xymon/server/bin/xymoncmd
$ . /etc/xymon/xymonserver.cfg
[might show an error if you have an include line, just ignore]
$ /usr/lib/xymon/server/ext/dnsreg

See if this gives any output that shows problems.
quoted from David Hay-Currie

****
** For the http checks. I created a httoweb.cfg in tasks.d with the code
I'm assuming that you didn't put the code directly in the httoweb.cfg file.
 Doing that would not work.
quoted from David Hay-Currie

What I am wondering is:
**1.       **Do I need to rename the domain check from the host file
(only the http like http://somedomain.com)
They are independent, and will only cause a problem if the status message
name clashes.  In the case of the hosts.cfg entries (run by xymonnet) the
status message (and thus the name of the dot on your Xymon display) is
called "http".  With my example script, I used "webchecks".  Feel free to
rename this in the script, but be sure to avoid a clash with any existing
check names.  You could use "http" for this if you wanted to, and remove
all "http://"; or "https://"; checks from hosts.cfg so that xymonnet doesn't
report http status messages.
quoted from David Hay-Currie
****

**2.       **And, If I remove the http check, where will it report the
status?
In the "webchecks" test.

J