ApacheStats 0.8.2 (multiple RRD, Low hdd, Script Server)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
linebacker2
Posts: 28
Joined: Fri May 08, 2009 11:34 am

Apache Stats graphing issue?

Post by linebacker2 »

Hi,

I just did a new install of Cacti 0.8.7e on a fedora 10 installation with all patches. I have installed the plug-in Architecture 1.6 and followed instructions to successfully get Cacti up and running. My issue arises when I attempt to use Apache Stats Templates for Graphing. When I import the Graphs (I have already successfully fixed Graphs D and F) and add them to my devices I get odd behavior. I can successfully get up to two host using these graphs and graphing. When I attempt to add more devices these graphs get added but never graph. I get a mixture of "nan" or just "0" for output with no graphing.

Troubleshooting that I have done:
- assigned the correct permissions for the rra and log directory (chmod cactiuser:root)
- I have imported and attempted to use both apachestats version 0.8.1 and 0.8.2 templates
- deleted apache stats graphs, did a rrdclean, and deleted any remnants from the rra folder.
- disabled all plugins
- re-installed Cacti 0.8.7e including dropping of database and re-creating
- check that the correct ip for each device's snmp is pointing to the cacti server
- tested and check that server-status and all dependencies are enables for each device.
NOTE: thes same devices that I am trying to get apache stats to graph are being successfully grpahed by cacti's stndards graph templates?? So wierd??

Also I have successfully installed Cacti on a Windows system running Apache Stats 0.8.1 and these same devices are graphing successfully


Any Thought or ideas for what could be going on here?
linebacker2
Posts: 28
Joined: Fri May 08, 2009 11:34 am

Apache Stats graphing issue?

Post by linebacker2 »

This is what I am getting when trying to run the script manually against a one of the problem devices with Apache Server-status enabled (I have confirmed that I can access the device's server status page from a browser)

# /usr/bin/php -q ss_apache_stats.php 172.18.100.25

PHP Warning: file_get_contents(http://172.18.100.25/server-status?auto): failed to open stream: HTTP request failed! in /var/www/html/cacti/scripts/ss_apache_stats.php on line 79
thread_W:0 threadS:0 threadR:0 threadW:0 threadK:0 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0 thread_O:0

I ran this script with root.

This is the output of running against one of the two devices that is graphing:

/usr/bin/php -q ss_apache_stats.php 172.17.100.75
apache_total_hits:2197510 apache_total_kbytes:33215290 apache_busy_workers:3 apache_idle_workers:247 thread_W:247 threadS:0 threadR:0 threadW:2 threadK:1 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0 thread_O:1670
User avatar
RCK
Cacti User
Posts: 54
Joined: Fri Jan 26, 2007 12:38 pm

Post by RCK »

Well, you found the problem !
Your cacti install looks perfect, but the php script is not able to grab the value from the 172.18.100.25 webpage.

For me it's one configuration problem into your apache.

You can check if the apache installation is giving you the server-status webpage on your cacti server with text browser like:
w3m http://172.18.100.25/server-status?auto
lynx http://172.18.100.25/server-status?auto

If you can't see the webpage, it's the apache fault on 172.18.100.25
- check if the mod_status is loaded
- check if you activate it in config file

Code: Select all

<IfModule mod_status.c>
        ExtendedStatus On
        <Location /server-status>
                SetHandler server-status
                Order deny,allow
                Deny from all
                Allow from 127.0.0.1
                Allow from your_cacti_ip_here
        </Location>
</IfModule>
Cacti: 0.8.7g | Spine: 0.8.7g
Plugins: RRDclean - Weathermap - Thold - Realtime
My Template: ApacheStats 0.8.2 (multiple RRD, Low disk usage, Script Server)
linebacker2
Posts: 28
Joined: Fri May 08, 2009 11:34 am

Apache Stats graphing issue?

Post by linebacker2 »

I checked that mod_status is loaded and it is activate in config file.
Further I have Apachestats graphing from my windows cacti server. So it is gathering Apache stats data and graphing it. It just doesn't want to graph from my Linux Cacti host.

I have added the Linux Cacti host in my SNMP properties for host 172.18.100.25 Graphs show up with mainly 0's but never graph.

This is driving me crazy trying to figure out what could be the problem??
User avatar
RCK
Cacti User
Posts: 54
Joined: Fri Jan 26, 2007 12:38 pm

Post by RCK »

Cacti: 0.8.7g | Spine: 0.8.7g
Plugins: RRDclean - Weathermap - Thold - Realtime
My Template: ApacheStats 0.8.2 (multiple RRD, Low disk usage, Script Server)
linebacker2
Posts: 28
Joined: Fri May 08, 2009 11:34 am

Apache Stats graphing issue?

Post by linebacker2 »

Both are giving me the correct statics:

Total Accesses: 1634013
Total kBytes: 55545741
Uptime: 12190775
ReqPerSec: .134037
BytesPerSec: 4665.73
BytesPerReq: 34809.3
BusyWorkers: 3
IdleWorkers: 247
Scoreboard: ___________________________________________________________
linebacker2
Posts: 28
Joined: Fri May 08, 2009 11:34 am

pache Stats graphing issue?

Post by linebacker2 »

Any thoughts/Help on this?

Why can I only get one host to successfully graph using the Apache stats templates and then the rest not don't want to graph?

Why would I be getting "Partial Result: U" on the remaining host graphs for Apache Stats?
fenidik
Posts: 1
Joined: Wed Mar 17, 2010 5:20 am
Location: Moscow

Post by fenidik »

Hi, how i can graph host with apache on port is not equal 80 :)
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Post by hid3 »

Hello everyone.

I've upgraded the ApacheStats using instructions in the 1st post.

However, now "Bytes / Request" and "Thread Details (%)" don't work anymore! What's wrong?

Please help me ASAP since I'm loosing important statistics...
User avatar
pierrem
Posts: 2
Joined: Tue Oct 13, 2009 3:39 pm

apachestat hack for ssl with self signed certs

Post by pierrem »

Hi all,

This is a quick hack that permits server-status on SSL (443) with self signed certs. It might be handy for people looking to monitor https sites.

It is(very) inspired by the curl change proposed by solefald earlier in this post.

Code: Select all

	$url = "https://$host/server-status?auto";
	$ch = curl_init($url);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
	$result = curl_exec($ch);
	//$result = file_get_contents("$url");
Heiko
Cacti User
Posts: 77
Joined: Wed Apr 23, 2008 11:03 am

Post by Heiko »

Code: Select all

To check how many consolidation function your have, go to "Management" -> "Data Sources" -> "RRAs", then edit the 4 archives and see how many lines are selected. You only need the "AVERAGE" line here. 
does this have any negative outcome to my already existing graphs or functions?


EDIT:

And will apache-stats report data for the whole apache or just for the vhost?
I have a couple of named vhosts and would like to have stats for the whole machine.

And what does mean the "m" when I view the hits, it says 400m hits, cant be 400.000 Hits i guess.

greetings

.h
User avatar
dust2k
Cacti User
Posts: 101
Joined: Sun Dec 04, 2005 3:14 am

Post by dust2k »

Heiko wrote: And will apache-stats report data for the whole apache or just for the vhost?
I have a couple of named vhosts and would like to have stats for the whole machine.

And what does mean the "m" when I view the hits, it says 400m hits, cant be 400.000 Hits i guess.

greetings

.h
your answer : This setting applies to the entire server, and cannot be enabled or disabled on a virtualhost-by-virtualhost basis. The collection of extended status information can slow down the server.

ref:http://httpd.apache.org/docs/2.0/mod/mod_status.html
scraly
Posts: 2
Joined: Thu Apr 07, 2011 1:32 am

Re: ApacheStats 0.8.2 (multiple RRD, Low hdd, Script Server)

Post by scraly »

Hi,

I'm new in this forum, so sorry if my query have already have asked.

I am searching a good apache graph with hits by second in real time but with this example:

Is it possible to have an apache graph with :
- total number of HTTP request
- number of HTTP request < 1 sec
- number of HTTP request > 15 sec (for example)
?

Thanks
rock100773
Posts: 11
Joined: Mon Apr 04, 2011 4:01 pm

Re: ApacheStats 0.8.2 (multiple RRD, Low hdd, Script Server)

Post by rock100773 »

Hello,

Am running:
cacti version 0.8.7g
OS: CentOS release 5.2
PHP: PHP 5.1.6
--------
Am having issue with apache stats template!!
I was able to configure ApacheStats 0.6 (PHP Script Server Version) to use port 80 (http://hostname/server-status?auto)
Also am trying to use the same template for port 443 (https://hostname/server-status?auto)
The problem am facing is that, each time I tried to use "data template" and "data input method" are made for port 443, it fail to graph.
When i turn on the debug mode, everything came back ok
-----

This is the cacti php server script:
<path_cacti>/scripts/ss_https_apache_stats.php ss_apache_stats <hostname>

This is the error am receiving from log file:
"CMDPHP: Poller[0] ERROR: ApacheStats08 - Host parameter missing, can not continue"
-----------------
Example of the RRDTool from debug mode:

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title='hostname port 443 - Apache Statistics - Bytes / Request' \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='bytes / hit' \
--slope-mode \
--font TITLE:9: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/web/cacti/rra/hostname_port_443_apache_total_hits_21582.rrd":apache_total_kbytes:AVERAGE \
DEF:b="/web/cacti/rra/hostname_port_443_apache_total_hits_21582.rrd":apache_total_hits:AVERAGE \
CDEF:cdefa=a,UN,0,a,100000,GT,0,a,IF,IF \
CDEF:cdefb=b,UN,0,b,100000,GT,0,b,IF,IF \
CDEF:cdefc=cdefb,0,EQ,0,cdefa,1024,*,cdefb,/,IF,0,1000000,LIMIT \
CDEF:cdefg=a,0,0,LIMIT \
CDEF:cdefba=b,0,0,LIMIT \
\
\
AREA:cdefc#4123A1FF:"Bytes / Request" \
GPRINT:cdefc:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefc:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefc:MAX:"Maximum\:%8.2lf %s\n" \
LINE2:cdefg#FF0000FF:"kBytes" \
GPRINT:a:LAST:" Current\:%8.2lf %s" \
GPRINT:a:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:a:MAX:"Maximum\:%8.2lf %s\n" \
LINE2:cdefba#00FF00FF:"Hits" \
GPRINT:b:LAST:" Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n" \
COMMENT:" Represents the number of bytes per hit\n" \
COMMENT:" based on ApacheStats v0.4 - Rolf Poser\n"
--------------------------------

As anyone use cacti apache stats for port 443 together with port 80 on same cacti ? Since there is no apache stats template for port 443, have search the internet could find any.

Any suggestion or comments will be appreciated.

Thanks
cacti user.


Report this post
ocoralan
Posts: 21
Joined: Mon Apr 25, 2011 7:38 pm

Re: ApacheStats 0.8.2 (multiple RRD, Low hdd, Script Server)

Post by ocoralan »

Does it support cacti0.8.7g + PA 2.8 on windows xp?

After I installed, there is no data on the graph, and I had enabled the server-status in the httpd.conf。

Code: Select all

LoadModule status_module modules/mod_status.so
I open the Apache error log file, it says:

Code: Select all

[Wed May 25 07:19:14 2011] [error] [client 127.0.0.1] File does not exist: C:/AppServ/www/server-status
I noticed that there is such line in the "ss_apache_stats.php" file.

Code: Select all

$url = "http://$host/server-status?auto";
I donn't know how to make it work on Windows, anybody can help me?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests