Send apache /server-status page to server via client.
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 ?
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
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.
On Tue, Oct 29, 2013 at 5:46 PM, Mike Burger <mburger at bubbanfriends.org>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
On 29 October 2013 19:48, deepak deore <deepakdeore2004 at gmail.com> 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
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 =====
On Tue, Oct 29, 2013 at 7:49 PM, Jeremy Laidman <jlaidman at rebel-it.com.au>wrote:
On 29 October 2013 19:48, deepak deore <deepakdeore2004 at gmail.com> 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/nullYou 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
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
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?
On Wed, Oct 30, 2013 at 7:37 AM, Ralph Mitchell <ralphmitchell at gmail.com>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>$XYMON $XYMSRV "data $MACHINE.apache $STATE"
exit 0 ===== cut - here =====
On Tue, Oct 29, 2013 at 7:49 PM, Jeremy Laidman <jlaidman at rebel-it.com.au>wrote:
On 29 October 2013 19:48, deepak deore <deepakdeore2004 at gmail.com> 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/nullYou 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
Xymon mailing list Xymon at xymon.com http://lists.xymon.com/mailman/listinfo/xymon
On 30 October 2013 18:41, deepak deore <deepakdeore2004 at gmail.com> 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
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 : -
- 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.
- Removed "|apache:apache|apache1|apache2|apache3" from hosts.cfg which shows only one graph of apache utilizaition.
- 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 <jlaidman at rebel-it.com.au>wrote:
On 30 October 2013 18:41, deepak deore <deepakdeore2004 at gmail.com> 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
clientlaunch.cfg entry: -
[apache] ENVFILE $XYMONCLIENTHOME/etc/xymonclient.cfg CMD $XYMONCLIENTHOME/ext/apache.sh LOGFILE $XYMONCLIENTLOGS/xymonclient.log INTERVAL 1m
On Thu, Oct 31, 2013 at 12:40 PM, deepak deore <deepakdeore2004 at gmail.com>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 : -
- 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.
- Removed "|apache:apache|apache1|apache2|apache3" from hosts.cfg which shows only one graph of apache utilizaition.
- 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 <jlaidman at rebel-it.com.au>wrote:
On 30 October 2013 18:41, deepak deore <deepakdeore2004 at gmail.com> 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
participants (4)
-
deepakdeore2004@gmail.com
-
jlaidman@rebel-it.com.au
-
mburger@bubbanfriends.org
-
ralphmitchell@gmail.com