Cacti apache stats graph not displaying any data

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

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

Cacti apache stats graph not displaying any data

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.
rock100773
Posts: 11
Joined: Mon Apr 04, 2011 4:01 pm

Re: Cacti apache stats graph not displaying any data

Post by rock100773 »

After some twistings, working with co-worker to the debug and testing, finally get cacti apache stats to work for both port 80 and 443.

The only thing that was change was some modification to this script by graphing apache stats for port 443 if port 80 fails.

I have attached the zip file that include the original Apache template and modified script
Please kindly post your comments.

Thanks
rock1000773
Cacti guru
Attachments
SS_Apache_Stats.zip
This zip file include 2 optional apache stats templates and the modified php script:

cacti_host_template_webserver_apache_5min.xml
cacti_host_template_webserver_apache_30sec.xml
ss_apache_stats.php
(25.98 KiB) Downloaded 427 times
hid3
Cacti User
Posts: 63
Joined: Sat Jun 14, 2008 1:59 am

Re: Cacti apache stats graph not displaying any data

Post by hid3 »

Any ideas how to graph both, 80 and 443 ports (non-SSL and SSL) on the same server if all ports provide correct data?

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

Re: Cacti apache stats graph not displaying any data

Post by rock100773 »

hid3 wrote:Any ideas how to graph both, 80 and 443 ports (non-SSL and SSL) on the same server if all ports provide correct data?

Thanks.
Hid3,

First you have to enable extendedstatus in your apache config file usually in /etc/httpd/conf/httpd.conf.
Also allow port 80 and port 443 on the same server. Once you setup entendedstatus on port 80 and 443, you can use the ss_apache_stats.php script to graph both port http://forums.cacti.net/viewtopic.php?f ... 02#p220102

you can test if both port are working by

$curl http://hostname

$curl https://hostname

Note: To setup apache stats on port 80 and 443 is another topics

Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests