ApacheStats 0.6 (PHP Script Server Version)

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

Moderators: Developers, Moderators

Panther_1
Posts: 28
Joined: Tue May 08, 2007 8:29 am
Location: NRW, Germany
Contact:

Post by Panther_1 »

So now it works better for me but I thing there is still something brocken.



1. Why is the script not using the ReqPerSec, BytesPerSec, BytesPerReq
which it could get from the server-status?auto


lynx -dump http://127.0.0.1/server-status?auto
Total Accesses: 2251
Total kBytes: 30271
CPULoad: .330624
Uptime: 7752
ReqPerSec: .290377
BytesPerSec: 3998.65
BytesPerReq: 13770.5
BusyWorkers: 5
IdleWorkers: 5
Scoreboard: _K_KKWK_.__........................................................
...............................................................................
...............................................................................
...............................

2. The XMl file seems to be broken. The hits / s don't have an data_source.
Panther_1
Posts: 28
Joined: Tue May 08, 2007 8:29 am
Location: NRW, Germany
Contact:

Post by Panther_1 »

Apache Statistics - Thread Details has also no data sources so it can't work
Panther_1
Posts: 28
Joined: Tue May 08, 2007 8:29 am
Location: NRW, Germany
Contact:

Post by Panther_1 »

hy,

so I have modifed the ss_apache_stats.php that it does output all variables:

To get it working you must put somthing like this in your apache config:

Code: Select all

<IfModule mod_status.c>
    #
    # Allow server status reports generated by mod_status,
    # with the URL of http://servername/server-status
    # Change the ".example.com" to match your domain to enable.
    #
    ExtendedStatus On
    <Location /server-status>
        SetHandler server-status
        Order deny,allow
        Deny from all
        Allow from 127.0.0.1
    </Location>
</IfModule>
[code]

The modiefied php file is attached.
Now somebody maust make new xml files. I'm new with cacti so I must first read the documentation. I will try it in the next day's. But it would be nice if somebody is faster.



Attachments
ss_apache_stats.php.zip
(1.63 KiB) Downloaded 1166 times
Daniel15
Posts: 7
Joined: Fri Sep 15, 2006 9:52 pm
Location: Melbourne, Australia

Post by Daniel15 »

Hi guys,
I'm using the one Cacti installation and ApacheStats to graph three different Apache installations on three different hosts, but the graphs aren't working as intended. Here's what I'm experiencing:
Host 1: CPU Load and Hits/s graphs are blank, all others work.
Host 2: CPU Load and Hits/s work, all others are blank.
Host 3: None work.

All three hosts are set up the exact same way. The Apache config is set up as so:
<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from 66.79.167.131
</Location>
ExtendedStatus on
The script works fine if I run it via CLI. Any ideas?

Edit: I could not get this one working, so I deleted it and replaced it with the one in the [XML] successor to apachestats 0.4 topic (this one seems to work perfectly)
shail_2007
Posts: 4
Joined: Wed Jul 18, 2007 10:26 am

How to get ss_apache_stats.php working

Post by shail_2007 »

Hi all,
I am new to cacti and linux, can you please help me on this one.
Ii have imported the xml files and ss_apache_stats.php copied to <path_cacti>/scripts/. php is compiled with curl.
The script works fine on command line

root@aquarium:/var/www/htdocs/cacti/scripts# /usr/bin/php -q ss_apache_stats.php 192.168.1.125
apache_total_hits:456 apache_total_kbytes:1662 apache_cpuload:.0173231 apache_busy_workers:2 apache_idle_workers:6 thread_W:6 threadS:0 threadR:0 threadW:1 threadK:1 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0 thread_O:248

I have other hosts being monitored by SNMP and can you please tell me how to configure cacti, to get it graphing apache.

Please tell me what steps i am missing.

Thanks
Shail
shail_2007
Posts: 4
Joined: Wed Jul 18, 2007 10:26 am

Re: How to get ss_apache_stats.php working

Post by shail_2007 »

HI All,
How do i add a device without specifying the snmp information for ss_apache_stats.php working.

many thanks
shail
akos.maroy
Posts: 9
Joined: Tue Jul 14, 2009 2:47 am

how to install this script?

Post by akos.maroy »

can someone point me a to a few steps on how to install this thing?

where to put what file, what to set in the Cacti UI

would be very helpful...
disH
Posts: 33
Joined: Thu May 22, 2008 2:09 am

perl Issues?

Post by disH »

Can someone help me shed light on my graphs suddenly could stop working?
I'm out of idea's why cacti says there is no ouput



cacti result:

Code: Select all

11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] DS[523] SCRIPT: perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1, output: U  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] DS[522] SCRIPT: perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1, output: U  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] DS[521] SCRIPT: perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1, output: U  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] DS[520] SCRIPT: perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1, output: U  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] DS[519] SCRIPT: perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1, output: U  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] DS[518] SCRIPT: perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1, output: U  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[78] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[76] DS[514] SCRIPT: perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1, output: U  
11/26/2009 10:25:03 AM - SPINE: Poller[0] Host[76] ERROR: Empty result [127.0.0.1]: 'perl /usr/share/cacti/site/scripts/ws_apachestats.pl 127.0.0.1'  
11/26/2009 10:25:02 AM - SPINE: Poller[0] Host[30] DS[648] SCRIPT: perl /usr/share/cacti/site/scripts/linux_memory.pl SwapFree:, output: U  
rrd's:

Code: Select all

-rw-rw-r-- 1 www-data www-data  611592 2009-11-26 10:30 myserv_svc_threads_cached_533.rrd
-rw-rw-r-- 1 www-data www-data 1627352 2009-11-23 15:05 myserv_svc_thread_w_518.rrd
-rw-rw-r-- 1 www-data www-data 1627352 2009-11-23 15:05 myserv_svc_thread_w_519.rrd
-rw-rw-r-- 1 www-data www-data 1627352 2009-11-23 15:05 myserv_svc_thread_w_520.rrd
-rw-rw-r-- 1 www-data www-data 1627352 2009-11-23 15:05 myserv_svc_thread_w_521.rrd
-rw-rw-r-- 1 www-data www-data 1627352 2009-11-23 15:05 myserv_svc_thread_w_522.rrd
-rw-rw-r-- 1 www-data www-data 1627352 2009-11-23 15:05 myserv_svc_thread_w_523.rrd
-rw-rw-r-- 1 www-data www-data 1627352 2009-11-25 19:50 myserv_svc_thread_w_524.rrd
command line result:

Code: Select all

www-data@myserv:/usr/share/cacti/site/scripts$ id
uid=33(www-data) gid=33(www-data) groups=33(www-data)

www-data@myserv:/usr/share/cacti/site/scripts$ ./linux_memory.pl SwapFree:
2936960

www-data@myserv:/usr/share/cacti/site/scripts$ ./ws_apachestats.pl 127.0.0.1
apache_total_hits:69678 apache_total_kbytes:364578 apache_busy_workers:3 apache_idle_workers:0 thread_O:253 threadC:0 threadD:0 threadG:0 threadI:0 threadK:2 threadL:0 threadR:0 threadS:0 threadW:1 thread_W:0 apache_cpuload:.0612246
[url=http://forums.cacti.net/viewtopic.php?t=4356]Template: Cisco CatOS[/url]
[url=http://forums.cacti.net/viewtopic.php?t=21785]Mactrack: Netscreen Fw[/url]
[b]_______________[/b]
[b]Cacti Version[/b] - 0.8.7e, [b]Plugin Architecture[/b] - 2.5, [b]Poller Type[/b] - Cact-Spine 0.8.7e
[b]Server Info[/b] - Ubuntu Server 8.10 (2.6.27-7-server), [b]Web Server[/b] - Apache/2.2.9 PHP/5.2.6-2ubuntu4.3 with Suhosin-Patch
[b]PHP[/b] - 5.2.6-2ubuntu4.3, [b]MySQL[/b] - 5.0.67-0ubuntu6-log, [b]RRDTool[/b] - 1.3.1, [b]SNMP[/b] - 5.4.1
[b]Plugins[/b] - Thresholds v0.4.1, Login Mod v1.0, Host Info v0.2
uno
Posts: 32
Joined: Mon Aug 27, 2007 7:22 am

Re: ApacheStats 0.6 (PHP Script Server Version)

Post by uno »

Hi.
I am using this script+template to graph an apache server status.
My problem is that all the "threads" graphs show 0 for all values. I can see in the cacti log that the script gets the correct values from Apache.

Server-status:

Code: Select all

Total Accesses: 22599
Total kBytes: 1847842
CPULoad: .000292752
Uptime: 75149
ReqPerSec: .300723
BytesPerSec: 25179.2
BytesPerReq: 83728.9
BusyWorkers: 2
IdleWorkers: 18
Scoreboard: ._____.__..._.K._._W.._.__....___..._.._..........
Cacti log:

Code: Select all

10/05/2010 02:30:17 PM - SPINE: Poller[0] Host[158] TH[1] DS[4232] SS[4] SERVER: /usr/local/cacti/scripts/ss_apache_stats.php ss_apache_stats hostname, output: apache_total_hits:22355 apache_total_kbytes:1825947 apache_cpuload:.000373747 apache_busy_workers:23 apache_idle_workers:18 thread_W:18 threadS:0 threadR:0 threadW:2 threadK:15 threadD:0 threadC:6 threadL:0 threadG:0 threadI:0 thread_O:215 
I did remove all data sources except one, and am using one data source for all graphs, but I don't think that should be a problem?
There were also some problems with graph templates missing graph item inputs (data sources), but that were on other graphs, which are working now.
uno
Posts: 32
Joined: Mon Aug 27, 2007 7:22 am

Re: ApacheStats 0.6 (PHP Script Server Version)

Post by uno »

After running it for some more time, I now see that the graphs show "nan" instead of 0. And this also applies to the cpu load graph.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest