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

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

Moderators: Developers, Moderators

Post Reply
User avatar
RCK
Cacti User
Posts: 54
Joined: Fri Jan 26, 2007 12:38 pm

Post by RCK »

ss_apache_stats.php only returns
- apache_total_hits
- apache_total_kbytes
- apache_cpuload
- apache_busy_workers
- apache_idle_workers
- thread_*

I don't know why the original authors did not use the apache2 "BytesPerSec" value. Maybe because it's one instant value ?, and does not reflect the traffic over the last 5 minuts.
Attachments
@fmangeant, for info :p
@fmangeant, for info :p
ApacheStats.png (26.47 KiB) Viewed 15261 times
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)
Weedy
Posts: 23
Joined: Thu Jan 26, 2006 7:07 pm

Post by Weedy »

well it does something.
Attachments
interface stats
interface stats
graph_5_5.png (34.71 KiB) Viewed 15253 times
BytesPerSec (with bugs)
BytesPerSec (with bugs)
graph_15_5.png (20.92 KiB) Viewed 15253 times
User avatar
RCK
Cacti User
Posts: 54
Joined: Fri Jan 26, 2007 12:38 pm

Post by RCK »

Interesting !
Could you post current apachestats template kbit/s vs your BytesPerSec version ? If it's more accurate we have to upgrade the template :)
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)
Weedy
Posts: 23
Joined: Thu Jan 26, 2006 7:07 pm

Post by Weedy »

it seems to have broken the "bytes per hit hit" but looks like we are overhauling apache stats anyways. mostly i just changed the rrd to GAUGE and stopped cacti from messing with the numbers. But I dont know how to fix the text line (current avg max).

in cacti/scripts/ss_apache_stats.php change:

Code: Select all

                        break;
                        case "BytesPerSec":
                                if (($section == "kbytes") or ($section == "all"))
Attachments
apcahe_total_kbytes.xml
i think this is right.
(3.55 KiB) Downloaded 616 times
User avatar
RCK
Cacti User
Posts: 54
Joined: Fri Jan 26, 2007 12:38 pm

Post by RCK »

I have setup one test to graph this new entry.
I will change total_kbit with bytes/sec in the default template if it's better :)
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)
Weedy
Posts: 23
Joined: Thu Jan 26, 2006 7:07 pm

Post by Weedy »

ok theres a hole in my method, "Averages giving the number of requests per second, the number of bytes served per second and the average number of bytes per request" so we cant use it. Now the question is why were the numbers so wrong before.
aboyz
Cacti User
Posts: 56
Joined: Fri Jan 18, 2008 7:09 pm

no data.

Post by aboyz »

Hi,

I'm not getting any DATA.

How do I debug this anyone know??
aboyz
Cacti User
Posts: 56
Joined: Fri Jan 18, 2008 7:09 pm

I'm getting this error

Post by aboyz »

[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
renski
Posts: 1
Joined: Thu Mar 13, 2008 7:19 am

Post by renski »

I've got apachestats up and running, but mod security is blocking the server-status requests by ss_apache_stats.php. If I access the server-status page using a regular browser it works fine, but the cacti script is being denied.

I'm using the mod security rules that are supplied with the application itself. I could comment out a few of the rules, however there seem to be quite a few of them causing problems, anyone got a modsecurity rule to fix this?

php ss_apache_stats.php 127.0.0.1

Warning: file_get_contents(http://127.0.0.1/server-status?auto): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in /home/www/cacti-admin/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 thread_O:0newbox:/home/www/cact
Chaosratt
Posts: 34
Joined: Sun Oct 28, 2007 3:31 am
Location: St. Pete, FL
Contact:

Post by Chaosratt »

Similar issue here:

Code: Select all

xaos@pandora:~/public_html/cacti/scripts> php ss_apache_stats.php localhost
apache_busy_workers:1 apache_idle_workers:9 thread_W:9 threadS:0 threadR:0 threadW:1 threadK:0 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0 thread_O:140PHP Warning:  Unknown: open(/var/lib/php5/sess_8euqc64c95ilspn38ckfnlmclfovuq3h, O_RDWR) failed: Permission denied (13) in Unknown on line 0
PHP Warning:  Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php5) in Unknown on line 0
Obviously a permission error, but I'm unsure of how to proceed.
Chaosratt
Posts: 34
Joined: Sun Oct 28, 2007 3:31 am
Location: St. Pete, FL
Contact:

Post by Chaosratt »

*bumpage*
Note that this problem does not occur when the script is run as root, only when the script is run as the same user as cacti.

Code: Select all

pandora:/home/xaos/public_html/cacti/scripts # php ss_apache_stats.php 192.168.1.10 threads
thread_W:6 threadS:0 threadR:0 threadW:1 threadK:0 threadD:0 threadC:1 threadL:0 threadG:0 threadI:0 thread_O:142
SexyBoy
Posts: 7
Joined: Fri Mar 28, 2008 11:31 am
Contact:

Do I need to install any apache module?

Post by SexyBoy »

Hi.

I installed successfully the ApacheStats 0.8 on cacti 0.8.7b
But my all graphs are emthy.
Do I need to setup any module on apache?

Manny THX
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

You must enable "server-status"
Reinhard
SexyBoy
Posts: 7
Joined: Fri Mar 28, 2008 11:31 am
Contact:

Post by SexyBoy »

Thx.

It is working!
victormilk2002
Posts: 8
Joined: Sun Mar 16, 2008 9:20 pm

how to enable the server status of apache

Post by victormilk2002 »

As I also came across the same problem, could you teach me how to enable the server status of apache? Thanks
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests