ApacheStats 0.8.2 (multiple RRD, Low hdd, Script Server)
Moderators: Developers, Moderators
Fix problem on RRD 1.3.5 cacti Version 0.8.7b
Hi steve457 this files fix the problem graph D and graph F on cacti Version 0.8.7b and RRD 1.3.5.
- Attachments
-
- cacti_graph_template_webserver_-_apachestats08_-_d_-_bytes_hit_-_same_data_source_as_hits_s_and_kbits_s.xml
- (20.54 KiB) Downloaded 723 times
-
- cacti_graph_template_webserver_-_apachestats08_-_f_-_thread_details_-_same_data_source_as_thread_details.xml
- (21.45 KiB) Downloaded 1034 times
thanks to kalos,
the D-graph of my Apache-Stats modul is fixed now.
But I got still an error with the F-graph - could you give me an advice how to fix this issue?
the D-graph of my Apache-Stats modul is fixed now.
But I got still an error with the F-graph - could you give me an advice how to fix this issue?
/usr/share/cacti/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Localhost - Apache Stats - F - Thread Details (%)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit=100 \
--lower-limit=0 \
--vertical-label="percent" \
--slope-mode \
--font TITLE:12: \
--font AXIS:8: \
--font LEGEND:10: \
--font UNIT:8: \
DEF:a="/usr/share/cacti/rra/localhost_apache_idle_workers_54.rrd":apache_busy_workers:AVERAGE \
DEF:b="/usr/share/cacti/rra/localhost_apache_idle_workers_54.rrd":apache_busy_workers:MAX \
DEF:c="/usr/share/cacti/rra/localhost_apache_idle_workers_54.rrd":apache_idle_workers:AVERAGE \
DEF:d="/usr/share/cacti/rra/localhost_apache_idle_workers_54.rrd":apache_idle_workers:MAX \
CDEF:cdefa=a,UN,0,a,100000,GT,0,a,IF,IF \
CDEF:cdefc=b,UN,0,b,100000,GT,0,b,IF,IF \
CDEF:cdefe=cdefa,cdefb,+ \
CDEF:cdefg=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefj=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefba=cdefc,0,EQ,0,cdefb,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefbd=cdefc,0,EQ,0,cdefb,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefca=a,0,0,LIMIT \
\
\
\
\
\
\
AREA:cdefg#FF0000FF:"Busy" \
GPRINT:cdefg:LAST:" Current\:%8.0lf" \
GPRINT:cdefg:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefj:MAX:"Maximum\:%8.0lf\n" \
AREA:cdefba#4444FFFF:"Idle":STACK \
GPRINT:cdefba:LAST:" Current\:%8.0lf" \
GPRINT:cdefba:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefbd:MAX:"Maximum\:%8.0lf\n" \
GPRINT:cdefe:LAST:"Total Number of threads\:%8.0lf" \
GPRINT:cdefe:LAST:"Total Number of threads\:%8.0lf" \
GPRINT:cdefe:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefe:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefe:MAX:"Maximum\:%8.0lf\n" \
GPRINT:cdefe:MAX:"Maximum\:%8.0lf\n" \
RRDTool Says:
ERROR: invalid rpn expression in: cdefa,cdefb,+
Re: I'm getting this error
I fixed it by switching to curl (you need php curl module installed/enabled)aboyz wrote:[root@reporting scripts]# php ss_apache_stats.php 192.168.1.208
PHP Warning: file_get_contents(http://192.168.1.208/server-status?auto): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required
in /home/cacti/scripts/ss_apache_stats.php on line 72
thread_W:0 threadS:0 threadR:0 threadW:0 threadK:0 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0
Code: Select all
$url = "http://$host/server-status?auto";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
//$result = file_get_contents("$url");
-
- Posts: 8
- Joined: Wed Jul 09, 2008 5:20 pm
- Location: En cage à la S.P.A
I get this:
I'm wondering if it has something to do with cdefb being referenced without it actually being defined? Will play some more...
Code: Select all
CDEF:cdefa=a,UN,0,a,100000,GT,0,a,IF,IF \
CDEF:cdefc=b,UN,0,b,100000,GT,0,b,IF,IF \
CDEF:cdefe=cdefa,cdefb,+ \
CDEF:cdefg=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefh=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefj=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefba=cdefc,0,EQ,0,cdefb,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefbb=cdefc,0,EQ,0,cdefb,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefbd=cdefc,0,EQ,0,cdefb,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefca=a,0,0,LIMIT \
\
\
\
\
\
\
AREA:cdefg#FF0000FF:"Busy" \
GPRINT:cdefh:LAST:" Current\:%8.0lf" \
GPRINT:cdefg:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefj:MAX:"Maximum\:%8.0lf\n" \
AREA:cdefba#4444FFFF:"Idle":STACK \
GPRINT:cdefbb:LAST:" Current\:%8.0lf" \
GPRINT:cdefba:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefbd:MAX:"Maximum\:%8.0lf\n" \
GPRINT:cdefe:LAST:"Total Number of threads\:%8.0lf" \
GPRINT:cdefe:LAST:"Total Number of threads\:%8.0lf" \
GPRINT:cdefe:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefe:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefe:MAX:"Maximum\:%8.0lf\n" \
GPRINT:cdefe:MAX:"Maximum\:%8.0lf\n" \
RRDTool Says:
ERROR: invalid rpn expression in: cdefa,cdefb,+
Hi,
I've got some problemes with the script. I get no data. The cacti log shows me
if I execute the script ss_apache_stats.php via cmd I recieve correct output.
I'm using cacti 0.8.7d
Thanks for any suggestions
I've got some problemes with the script. I get no data. The cacti log shows me
Code: Select all
02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname cpuload'
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[673] WARNING: Result from SERVER not valid. Partial Result: U
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[673] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname cpuload, output: U
02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: '/opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname hits'
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[672] WARNING: Result from SERVER not valid. Partial Result: U
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[672] SERVER: /opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php ss_apache_stats hostname hits, output: U
02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname threads'
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[677] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname threads, output: thread_W:0 threadS:0 threadR:0 threadW:0 threadK:0 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0 thread_O:0
02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname kbytes'
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[676] WARNING: Result from SERVER not valid. Partial Result: U
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[676] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname kbytes, output: U
02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: '/opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname hits'
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[675] WARNING: Result from SERVER not valid. Partial Result: U
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[675] SERVER: /opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php ss_apache_stats hostname hits, output: U
02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname kbytes'
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[674] WARNING: Result from SERVER not valid. Partial Result: U
02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[674] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname kbytes, output: U
Code: Select all
[cacti@linux14 scripts]# php ss_apache_stats.php l14 hits
apache_total_hits:8159
Thanks for any suggestions
-
- Cacti User
- Posts: 151
- Joined: Mon Feb 05, 2007 3:57 am
- Location: Munich, Germany
> CDEF:cdefa=a,UN,0,a,100000,GT,0,a,IF,IF \
> CDEF:cdefc=b,UN,0,b,100000,GT,0,b,IF,IF \
> CDEF:cdefe=cdefa,cdefb,+ \
> CDEF:cdefg=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
> CDEF:cdefj=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
According to the output it should be
cdefa,cdefc,+
as cdefb does not exist.
> CDEF:cdefc=b,UN,0,b,100000,GT,0,b,IF,IF \
> CDEF:cdefe=cdefa,cdefb,+ \
> CDEF:cdefg=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
> CDEF:cdefj=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
According to the output it should be
cdefa,cdefc,+
as cdefb does not exist.
spindy wrote:Hi,
I've got some problemes with the script. I get no data. The cacti log shows me
if I execute the script ss_apache_stats.php via cmd I recieve correct output.Code: Select all
02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname cpuload' 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[673] WARNING: Result from SERVER not valid. Partial Result: U 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[673] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname cpuload, output: U 02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: '/opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname hits' 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[672] WARNING: Result from SERVER not valid. Partial Result: U 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[672] SERVER: /opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php ss_apache_stats hostname hits, output: U 02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname threads' 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[677] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname threads, output: thread_W:0 threadS:0 threadR:0 threadW:0 threadK:0 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0 thread_O:0 02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname kbytes' 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[676] WARNING: Result from SERVER not valid. Partial Result: U 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[676] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname kbytes, output: U 02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: '/opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname hits' 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[675] WARNING: Result from SERVER not valid. Partial Result: U 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[675] SERVER: /opt/lampp/htdocs/cacti/scripts/ss_apache_stats.php ss_apache_stats hostname hits, output: U 02/24/2009 03:55:43 PM - PHPSVR: Poller[0] DEBUG: INC: 'path_cacti/scripts/ss_apache_stats.php' FUNC: 'ss_apache_stats' PARMS: 'hostname kbytes' 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[674] WARNING: Result from SERVER not valid. Partial Result: U 02/24/2009 03:55:43 PM - CMDPHP: Poller[0] Host[13] DS[674] SERVER: path_cacti/scripts/ss_apache_stats.php ss_apache_stats hostname kbytes, output: U
I'm using cacti 0.8.7dCode: Select all
[cacti@linux14 scripts]# php ss_apache_stats.php l14 hits apache_total_hits:8159
Thanks for any suggestions
how did u manage import the xml file into your cacti?I tried to import but nothing happen....
i'm using cacti 0.8.7d...pls help!!!
Thanks for your suggestion, but I still can't get the graphs D and F to work.
Graph D debug:
Graph F debug:
Graph D debug:
Code: Select all
RRDTool Command:
LD_LIBRARY_PATH=/usr/lib64 /usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-108000 \
--end=-300 \
--title="prioserve.net - Apache Stats - D - Bytes / Hit" \
--base=1024 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="bytes per hit" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/corbel.ttf \
--font AXIS:7:/usr/share/fonts/consola.ttf \
--font LEGEND:7.5:/usr/share/fonts/consola.ttf \
--font UNIT:7:/usr/share/fonts/consola.ttf \
DEF:a="/home/priostats/domains/stats.prioserve.net/public_html/cacti-0.8.7d/rra/prioserve_net_apache_total_kbytes_1398.rrd":apache_total_kbytes:AVERAGE \
DEF:b="/home/priostats/domains/stats.prioserve.net/public_html/cacti-0.8.7d/rra/prioserve_net_apache_total_hits_1397.rrd":apache_total_hits:AVERAGE \
CDEF:cdefa=a,UN,0,a,100000,GT,0,a,IF,IF \
CDEF:cdefc=c,UN,0,c,100000,GT,0,c,IF,IF \
CDEF:cdefe=cdefc,0,EQ,0,cdefa,1024,*,cdefc,/,IF,0,1000000,LIMIT \
CDEF:cdefbc=a,0,0,LIMIT \
CDEF:cdefbg=b,0,0,LIMIT \
\
\
\
\
AREA:cdefe#4123A1FF:"Bytes / Hit" \
AREA:cdefe#4123A1FF:"Bytes / Hit" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:LAST:"Current\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf %s\n" \
LINE2:cdefbc#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:cdefbg#00FF00FF:"Hits" \
GPRINT:b:LAST:" Current\:%8.2lf %s" \
GPRINT:b:AVERAGE:"Average\:%8.2lf %s" \
GPRINT:b:MAX:"Maximum\:%8.2lf %s\n"
RRDTool Says:
ERROR: invalid rpn expression in: c,UN,0,c,100000,GT,0,c,IF,IF
Code: Select all
RRDTool Command:
LD_LIBRARY_PATH=/usr/lib64 /usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-108000 \
--end=-300 \
--title="prioserve.net - Apache Stats - F - Thread Details (%)" \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--upper-limit=100 \
--lower-limit=0 \
--vertical-label="percent" \
--slope-mode \
--font TITLE:12:/usr/share/fonts/corbel.ttf \
--font AXIS:7:/usr/share/fonts/consola.ttf \
--font LEGEND:7.5:/usr/share/fonts/consola.ttf \
--font UNIT:7:/usr/share/fonts/consola.ttf \
DEF:a="/home/priostats/domains/stats.prioserve.net/public_html/cacti-0.8.7d/rra/prioserve_net_apache_busy_workers_1399.rrd":apache_busy_workers:AVERAGE \
DEF:b="/home/priostats/domains/stats.prioserve.net/public_html/cacti-0.8.7d/rra/prioserve_net_apache_busy_workers_1399.rrd":apache_idle_workers:AVERAGE \
CDEF:cdefa=a,UN,0,a,100000,GT,0,a,IF,IF \
CDEF:cdefc=c,UN,0,c,100000,GT,0,c,IF,IF \
CDEF:cdefe=cdefa,cdefc,+ \
CDEF:cdefg=cdefe,0,EQ,0,cdefa,100,*,cdefe,/,IF,0,110,LIMIT \
CDEF:cdefi=cdefc,0,EQ,0,cdefa,100,*,cdefc,/,IF,0,110,LIMIT \
CDEF:cdefba=cdefe,0,EQ,0,cdefc,100,*,cdefe,/,IF,0,110,LIMIT \
CDEF:cdefca=a,0,0,LIMIT \
\
\
\
\
\
\
AREA:cdefg#FF0000FF:"Busy" \
GPRINT:cdefg:LAST:" Current\:%8.0lf" \
GPRINT:cdefi:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefg:MAX:"Maximum\:%8.0lf\n" \
AREA:cdefba#4444FFFF:"Idle":STACK \
GPRINT:cdefba:LAST:" Current\:%8.0lf" \
GPRINT:cdefba:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefba:MAX:"Maximum\:%8.0lf\n" \
GPRINT:cdefe:LAST:"Total Number of threads\:%8.0lf" \
GPRINT:cdefe:LAST:"Total Number of threads\:%8.0lf" \
GPRINT:cdefe:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefe:AVERAGE:"Average\:%8.0lf" \
GPRINT:cdefe:MAX:"Maximum\:%8.0lf\n" \
GPRINT:cdefe:MAX:"Maximum\:%8.0lf\n" \
RRDTool Says:
ERROR: invalid rpn expression in: c,UN,0,c,100000,GT,0,c,IF,IF
-
- Posts: 5
- Joined: Tue Apr 08, 2008 3:12 pm
I've still had no success with graphs D or F
However, I did fix one small problem in ss_apache_stats.php that was preventing graph E from collecting thread stats from certain Apache versions:
Look for the two lines "BusyWorkers": and "IdleWorkers": around line 99 and make the following changes:
Add
case "BusyServers":
above
case "BusyWorkers":
Add
case "IdleServers":
above
case "IdleWorkers":
However, I did fix one small problem in ss_apache_stats.php that was preventing graph E from collecting thread stats from certain Apache versions:
Look for the two lines "BusyWorkers": and "IdleWorkers": around line 99 and make the following changes:
Add
case "BusyServers":
above
case "BusyWorkers":
Add
case "IdleServers":
above
case "IdleWorkers":
Who is online
Users browsing this forum: No registered users and 10 guests