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

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

Moderators: Developers, Moderators

Post Reply
kilos
Posts: 2
Joined: Mon Jan 05, 2009 5:47 am

Fix problem on RRD 1.3.5 cacti Version 0.8.7b

Post by kilos »

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 705 times
cacti_graph_template_webserver_-_apachestats08_-_f_-_thread_details_-_same_data_source_as_thread_details.xml
(21.45 KiB) Downloaded 1007 times
odi84
Posts: 1
Joined: Sat Jan 17, 2009 2:54 pm

Post by odi84 »

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?
/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,+
reallove
Posts: 16
Joined: Mon Jan 01, 2007 4:58 am

Post by reallove »

Hello,
I have exactly the same problem .
rrdtool-1.2.29 , cacti 0.8.7b .
User avatar
solefald
Posts: 38
Joined: Fri Jun 11, 2004 1:35 pm

Re: I'm getting this error

Post by solefald »

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
I fixed it by switching to curl (you need php curl module installed/enabled)

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");
fering
Posts: 14
Joined: Sun Nov 23, 2008 5:52 am

Post by fering »

any fix to the problem with graph F ?
Loup Artic
Posts: 8
Joined: Wed Jul 09, 2008 5:20 pm
Location: En cage à la S.P.A

Post by Loup Artic »

skwasha
Posts: 4
Joined: Tue Mar 02, 2004 2:02 pm

Post by skwasha »

I get this:

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,+
I'm wondering if it has something to do with cdefb being referenced without it actually being defined? Will play some more...
spindy
Posts: 2
Joined: Wed Feb 04, 2009 2:33 am

Post by spindy »

Hi,


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
if I execute the script ss_apache_stats.php via cmd I recieve correct output.

Code: Select all

[cacti@linux14 scripts]# php ss_apache_stats.php l14 hits
apache_total_hits:8159
I'm using cacti 0.8.7d


Thanks for any suggestions
Helmut Schneider
Cacti User
Posts: 151
Joined: Mon Feb 05, 2007 3:57 am
Location: Munich, Germany

Post by Helmut Schneider »

> 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.
Styles
Posts: 1
Joined: Tue Mar 24, 2009 1:09 pm

Post by Styles »

Anybody get this to work with 8.7d?

Thanks,
Styles
ahtshun83
Cacti User
Posts: 95
Joined: Wed Feb 25, 2009 12:23 am

Post by ahtshun83 »

spindy wrote:Hi,


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
if I execute the script ss_apache_stats.php via cmd I recieve correct output.

Code: Select all

[cacti@linux14 scripts]# php ss_apache_stats.php l14 hits
apache_total_hits:8159
I'm using cacti 0.8.7d


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!!!
Evg33
Posts: 1
Joined: Fri Mar 13, 2009 9:36 am

Post by Evg33 »

fering,Loup Artic,odi84:

1. delete D and F templates from TEMPLATES/Graph Templates
2. import fixes from kilos
3. add new templates in Host Templates [edit: WebServer - Apache]
4. set new templates on graphs.
niorg
Posts: 1
Joined: Fri Apr 17, 2009 3:31 am

Post by niorg »

Thanks for your suggestion, but I still can't get the graphs D and F to work.

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
Graph F 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 - 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
islandsound
Posts: 5
Joined: Tue Apr 08, 2008 3:12 pm

Post by islandsound »

I was having the same issues with the graphs. Keep trying kilos's replacements. I had to do some manual removal and adding though the interface but it finally worked out.

- remove all the apache templates
- import the originals
- delete d and f
- import the fixed d and f
helzerr
Cacti User
Posts: 54
Joined: Sun Feb 01, 2004 3:10 am
Location: Orlando, FL
Contact:

Post by helzerr »

I've still had no success with graphs D or F :cry:

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":
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests