Xymon Mailing List Archive search

Send apache /server-status page to server via client.

11 messages in this thread

list Deepak Deore · Tue, 29 Oct 2013 14:18:56 +0530 ·
Hi,

I know how to pull and graph /server-status page of apache from xymon.
But my apache servers are into amazon vpc and cant be contacted by xymon.
Xymon client sends data to the server.

/server-stauts page can be accessed from localhost, is there a way where
xymon client can send /server-status page to the server ?
list Mike Burger · Tue, 29 Oct 2013 08:16:57 -0400 (EDT) ·
quoted from Deepak Deore
Hi,

I know how to pull and graph /server-status page of apache from xymon.
But my apache servers are into amazon vpc and cant be contacted by xymon.
Xymon client sends data to the server.

/server-stauts page can be accessed from localhost, is there a way where
xymon client can send /server-status page to the server ?
If your apache servers in Amazon's cloud can't be contacted by Xymon,
they're not likely to be contacted by anyone/anything else, which could
very well make the web servers useless.

Are you sure that the web servers can't be accessed, or is it more that
you're using the stock server-status stanza, and haven't added or modified
the Allow from line to include your Xymon server, and so your apache
server is responding with "403 Forbidden"?

-- 
Mike Burger
http://www.bubbanfriends.org

"It's always suicide-mission this, save-the-planet that. No one ever just
stops by to say 'hi' anymore." --Colonel Jack O'Neill, SG1
list Jeremy Laidman · Wed, 30 Oct 2013 10:49:51 +1100 ·
quoted from Deepak Deore
On 29 October 2013 19:48, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
/server-stauts page can be accessed from localhost, is there a way where
xymon client can send /server-status page to the server ?

You can just write a script on the client to fetch via localhost, and
report to the Xymon server via a status message.

However, if you're unable to get a script running on the client, you can
probably do something in client-local.cfg on the Xymon server.  For
example, setup a "file:" entry like so:

  file:`( echo "client/apache-status $MACHINE.$OSTYPE"; echo
"[server-status]"; wget -q -O- http://127.1/server-status ) | $XYMON
$XYMSRV @ >/dev/null`

You should end up with the server status output in the client data for the
server.  You can then fetch it server-side from a script by using:

  $XYMON $XYMSRV "clientlog $SERVERNAME section=server-status"

and parse it for whatever you need.


J
list Ralph Mitchell · Tue, 29 Oct 2013 22:07:06 -0400 ·
You can simulate the "apache" tag in the xymon hosts.cfg by running little
script on the client itself.  It reports the short-form server-status info
as a data message that will be picked up on the xymon server and reported
on the trends page.

Ralph Mitchell

===== cut - here =====
#!/bin/sh

STATE=`curl -s -S http://localhost/server-status?auto`

$XYMON  $XYMSRV  "data $MACHINE.apache
$STATE"

exit 0
===== cut - here =====
quoted from Jeremy Laidman


On Tue, Oct 29, 2013 at 7:49 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 29 October 2013 19:48, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
/server-stauts page can be accessed from localhost, is there a way where
xymon client can send /server-status page to the server ?

You can just write a script on the client to fetch via localhost, and
report to the Xymon server via a status message.

However, if you're unable to get a script running on the client, you can
probably do something in client-local.cfg on the Xymon server.  For
example, setup a "file:" entry like so:

  file:`( echo "client/apache-status $MACHINE.$OSTYPE"; echo
"[server-status]"; wget -q -O- http://127.1/server-status ) | $XYMON
$XYMSRV @ >/dev/null`

You should end up with the server status output in the client data for the
server.  You can then fetch it server-side from a script by using:

  $XYMON $XYMSRV "clientlog $SERVERNAME section=server-status"

and parse it for whatever you need.


J

list Deepak Deore · Wed, 30 Oct 2013 12:27:44 +0530 ·
The web servers are behind ELB and only ELB can access them directly, and
end user goes via ELB. I dont want the status page to be accessible from
internet (i know i can restrict the access from apache "allow from" but
dont want to do it)

Let me try one of a solution provided by Jeremy and Ralph.
quoted from Mike Burger

On Tue, Oct 29, 2013 at 5:46 PM, Mike Burger <user-cc5c6e80f4c5@xymon.invalid>wrote:
Hi,

I know how to pull and graph /server-status page of apache from xymon.
But my apache servers are into amazon vpc and cant be contacted by xymon.
Xymon client sends data to the server.

/server-stauts page can be accessed from localhost, is there a way where
xymon client can send /server-status page to the server ?
If your apache servers in Amazon's cloud can't be contacted by Xymon,
they're not likely to be contacted by anyone/anything else, which could
very well make the web servers useless.

Are you sure that the web servers can't be accessed, or is it more that
you're using the stock server-status stanza, and haven't added or modified
the Allow from line to include your Xymon server, and so your apache
server is responding with "403 Forbidden"?

--
Mike Burger
http://www.bubbanfriends.org

"It's always suicide-mission this, save-the-planet that. No one ever just
stops by to say 'hi' anymore." --Colonel Jack O'Neill, SG1

list Deepak Deore · Wed, 30 Oct 2013 13:11:57 +0530 ·
Hi Ralph,
I have setup this script on client side to run after every 1 minute.
On server hosts.cfg i changed the line as below:

1.2.3.4   server1.example.com  #
apache=http://127.0.0.1/server-status?autonoconn nofiles nobbd
CLASS:WEB
TRENDS:*,vmstat:vmstat1|vmstat3|vmstat4|vmstat5|apache:apache|apache1|apache2|apache3

But I am not getting the apache graph in trends. Could you tell what am I
doing wrong?
quoted from Ralph Mitchell


On Wed, Oct 30, 2013 at 7:37 AM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>wrote:
You can simulate the "apache" tag in the xymon hosts.cfg by running little
script on the client itself.  It reports the short-form server-status info
as a data message that will be picked up on the xymon server and reported
on the trends page.

Ralph Mitchell

===== cut - here =====
#!/bin/sh

STATE=`curl -s -S http://localhost/server-status?auto`<http://localhost/server-status?auto>;
quoted from Ralph Mitchell

$XYMON  $XYMSRV  "data $MACHINE.apache
$STATE"

exit 0
===== cut - here =====


On Tue, Oct 29, 2013 at 7:49 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 29 October 2013 19:48, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
/server-stauts page can be accessed from localhost, is there a way where
xymon client can send /server-status page to the server ?

You can just write a script on the client to fetch via localhost, and
report to the Xymon server via a status message.

However, if you're unable to get a script running on the client, you can
probably do something in client-local.cfg on the Xymon server.  For
example, setup a "file:" entry like so:

  file:`( echo "client/apache-status $MACHINE.$OSTYPE"; echo
"[server-status]"; wget -q -O- http://127.1/server-status ) | $XYMON
$XYMSRV @ >/dev/null`

You should end up with the server status output in the client data for
the server.  You can then fetch it server-side from a script by using:

  $XYMON $XYMSRV "clientlog $SERVERNAME section=server-status"

and parse it for whatever you need.


J

list Jeremy Laidman · Wed, 30 Oct 2013 23:13:53 +1100 ·
quoted from Deepak Deore
On 30 October 2013 18:41, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
Hi Ralph,
I have setup this script on client side to run after every 1 minute.
Every minute?  Xymon network checks are usually every 5 minutes.  Do you
need it that often?

On server hosts.cfg i changed the line as below:
You don't need any changes to hosts.cfg.  Those settings only tell xymonnet
to poll the server, and you don't want that.  You don't want the Xymon
server creating the "apache" status.  Instead, you need the client to do
it, which should happen just by running the script.
quoted from Deepak Deore

But I am not getting the apache graph in trends. Could you tell what am I
doing wrong?
Check your ghost report.  Also try manually running the script from within
a "xymoncmd" shell and see if you get any errors.

How are you running the script?  From a cron job, or as an "ext" script?

J
list Deepak Deore · Thu, 31 Oct 2013 12:40:17 +0530 ·
Yes, I need the stats every minute. I am running it as an ext script, now
the graphs are coming under trends after undoing the changes in hosts.cfg.

One problem coming is the graphs are coming 2 times under trends. However
they are getting updated, I tried : -

1. Remove apache.rrd, waited for some time and checked after the rrd is
generated, still 2 graphs for each stats i.e. apache utilizaition, aapche
workers, apache cpu utilization, apache requests/ Second.
2. Removed "|apache:apache|apache1|apache2|apache3" from hosts.cfg which
shows only one graph of apache utilizaition.
3. Added "|apache:apache|apache1|apache2|apache3" again and removed
apache.rrd, still same problem.
quoted from Jeremy Laidman


On Wed, Oct 30, 2013 at 5:43 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 30 October 2013 18:41, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
Hi Ralph,
I have setup this script on client side to run after every 1 minute.
Every minute?  Xymon network checks are usually every 5 minutes.  Do you
need it that often?

On server hosts.cfg i changed the line as below:
You don't need any changes to hosts.cfg.  Those settings only tell
xymonnet to poll the server, and you don't want that.  You don't want the
Xymon server creating the "apache" status.  Instead, you need the client to
do it, which should happen just by running the script.

But I am not getting the apache graph in trends. Could you tell what am I
doing wrong?
Check your ghost report.  Also try manually running the script from within
a "xymoncmd" shell and see if you get any errors.

How are you running the script?  From a cron job, or as an "ext" script?

J

list Deepak Deore · Thu, 31 Oct 2013 12:43:54 +0530 ·
clientlaunch.cfg entry: -

[apache]
        ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg
        CMD $XYMONCLIENTHOME/ext/apache.sh
        LOGFILE $XYMONCLIENTLOGS/xymonclient.log
        INTERVAL 1m
quoted from Deepak Deore


On Thu, Oct 31, 2013 at 12:40 PM, deepak deore <user-7b03b2a1ee70@xymon.invalid>wrote:
Yes, I need the stats every minute. I am running it as an ext script, now
the graphs are coming under trends after undoing the changes in hosts.cfg.

One problem coming is the graphs are coming 2 times under trends. However
they are getting updated, I tried : -

1. Remove apache.rrd, waited for some time and checked after the rrd is
generated, still 2 graphs for each stats i.e. apache utilizaition, aapche
workers, apache cpu utilization, apache requests/ Second.
2. Removed "|apache:apache|apache1|apache2|apache3" from hosts.cfg which
shows only one graph of apache utilizaition.
3. Added "|apache:apache|apache1|apache2|apache3" again and removed
apache.rrd, still same problem.


On Wed, Oct 30, 2013 at 5:43 PM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 30 October 2013 18:41, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
Hi Ralph,
I have setup this script on client side to run after every 1 minute.
Every minute?  Xymon network checks are usually every 5 minutes.  Do you
need it that often?

On server hosts.cfg i changed the line as below:
You don't need any changes to hosts.cfg.  Those settings only tell
xymonnet to poll the server, and you don't want that.  You don't want the
Xymon server creating the "apache" status.  Instead, you need the client to
do it, which should happen just by running the script.

But I am not getting the apache graph in trends. Could you tell what am
I doing wrong?
Check your ghost report.  Also try manually running the script from
within a "xymoncmd" shell and see if you get any errors.

How are you running the script?  From a cron job, or as an "ext" script?

J

list Jeremy Laidman · Fri, 1 Nov 2013 10:06:46 +1100 ·
quoted from Deepak Deore
On 31 October 2013 18:10, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
One problem coming is the graphs are coming 2 times under trends. However
they are getting updated, I tried : -

1. Remove apache.rrd, waited for some time and checked after the rrd is
generated, still 2 graphs for each stats i.e. apache utilizaition, aapche
workers, apache cpu utilization, apache requests/ Second.
You shouldn't need to delete the rrd file.
quoted from Deepak Deore

 2. Removed "|apache:apache|apache1|apache2|apache3" from hosts.cfg which
shows only one graph of apache utilizaition.
Is the first bar (ie "|") supposed to be a comma?  Like so:

",apache:apache|apache1|apache2|apache3"

I'm assuming this is in your TRENDS definiton for the host.

I don't know what the default would be (when you don't specify), but I
would have guessed it would be to only include the [apache] graph
definition.  To list more than one graph, you add
",apache:apache|apache1|apache2|apache3" as you described.  So by removing
that, I would expect the trends page to only show the one graph: [apache].
 (And do so without having to delete the apache.rrd file.)

You might want to change your TRENDS definition in hosts.cfg to include one
fewer graphs, instead of removing the definition altogether, something like:

",apache:apache|apache1"

Then reload the trends page and see if you only get two apache graphs.

J
list Deepak Deore · Fri, 1 Nov 2013 17:07:36 +0530 ·
Oops, my mistake, bar should be comma here, After these changes, i can see
no duplicate graphs.
Thanks for the reply.
quoted from Jeremy Laidman


On Fri, Nov 1, 2013 at 4:36 AM, Jeremy Laidman <user-71895fb2e44c@xymon.invalid>wrote:
On 31 October 2013 18:10, deepak deore <user-7b03b2a1ee70@xymon.invalid> wrote:
One problem coming is the graphs are coming 2 times under trends. However
they are getting updated, I tried : -

1. Remove apache.rrd, waited for some time and checked after the rrd is
generated, still 2 graphs for each stats i.e. apache utilizaition, aapche
workers, apache cpu utilization, apache requests/ Second.
You shouldn't need to delete the rrd file.

 2. Removed "|apache:apache|apache1|apache2|apache3" from hosts.cfg
which shows only one graph of apache utilizaition.
Is the first bar (ie "|") supposed to be a comma?  Like so:

",apache:apache|apache1|apache2|apache3"

I'm assuming this is in your TRENDS definiton for the host.

I don't know what the default would be (when you don't specify), but I
would have guessed it would be to only include the [apache] graph
definition.  To list more than one graph, you add
",apache:apache|apache1|apache2|apache3" as you described.  So by removing
that, I would expect the trends page to only show the one graph: [apache].
 (And do so without having to delete the apache.rrd file.)

You might want to change your TRENDS definition in hosts.cfg to include
one fewer graphs, instead of removing the definition altogether, something
like:

",apache:apache|apache1"

Then reload the trends page and see if you only get two apache graphs.

J