ApacheStats 0.6 (PHP Script Server Version)

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

Moderators: Developers, Moderators

cviebrock
Posts: 3
Joined: Wed Dec 06, 2006 11:09 pm

Post by cviebrock »

A few issues:

1. I installed the new version of ss_apache_stats.php because my "Hits/s" graph stopped working a few days ago. The new version seems to have fixed that, and those are graphing again.

However, the "Bytes/request" graph is reporting zero now. I'm not sure what information I can provide to help debug this.

2. "Thread Details" and "Thread Details %" have never worked. I think this may be related to the following entry in the cacti log, which appears every time the poller runs:

12/18/2006 11:00:02 PM - CMDPHP: Poller[0] Host[6] DS[144] WARNING: Result from SERVER not valid. Partial Result:

Host 6 is the local machine (where apache is running) and data source 144 is the apache statistics template for localhost (<path_rra>/coruscant_apache_idle_workers_144.rrd). Again, I don't know what else to say to help debug this.
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

Is anyone willing to post their "<host>/server-status?auto" page?
cviebrock
Posts: 3
Joined: Wed Dec 06, 2006 11:09 pm

Post by cviebrock »

mahuani wrote:Is anyone willing to post their "<host>/server-status?auto" page?
Happily:

Code: Select all

Total Accesses: 6283
Total kBytes: 71090
CPULoad: .000315536
Uptime: 44369
ReqPerSec: .141608
BytesPerSec: 1640.7
BytesPerReq: 11586.2
BusyServers: 1
IdleServers: 4
Scoreboard: _W___...............
(and lots of more dots after that ... 4091 in total)
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Is it possible to implement this poller, without losing graph data from the perl version?
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Write a simple script_server script to read the contents into an array using the following sorta not finished code:

Code: Select all

function apache_dude($host) {
/* sortof like a wget, but easier.  It load's into an array */
$apache_stats = file("http://$host/server-status?auto");

/* process the array */
if (sizeof($apache_stats)) {
   foreach($apache_stats as $stat) {
      $stat_array = explode(":", $stat);

      switch (trim($stat_array[0])) {
         case "Total Accesses"
            $total_accesses = $stat_array[1];
            brea;
         case "CPULoad":
            $cpuload = $stat_array[1];
            break;
         ...
      }

   /* return the formatted information */
   return $blah . ":" $blah . " " . $blah . ":" $blah;
}else{
   return $not_good . ":" . $not_good ...;
}
Good luck

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
MathieuMa
Posts: 2
Joined: Mon Jan 22, 2007 1:37 pm
Location: Paris

Graph issue

Post by MathieuMa »

Hi,

First, thanks for the great data source + graph :)
I have my poller set to 1 minute, so my issue may come from there : I've set the step to 60, and the heartbeat to 120 (which should both be correct if I understood everything).
The issue is that the graphs are not continous - as on the following images.
Anyone got a hint ?

NB : Other graphs seems normal.
Attachments
Non-continuous Apache graph (last 6 hours)
Non-continuous Apache graph (last 6 hours)
apache-graph.png (149.33 KiB) Viewed 14595 times
User avatar
mahuani
Cacti User
Posts: 72
Joined: Tue Nov 01, 2005 2:10 pm
Location: Lafayette, LA
Contact:

Post by mahuani »

That should be correct. My poller runs every 30 seconds and I have a 30 step and 60 heartbeat.

Just to make sure did you change the heartbeat for all the Data Source Items? All 16 of them?
MathieuMa
Posts: 2
Joined: Mon Jan 22, 2007 1:37 pm
Location: Paris

Post by MathieuMa »

Just checked in case, and everything seemed OK.
MrJacK
Posts: 1
Joined: Tue Feb 06, 2007 7:40 am
Location: France

Post by MrJacK »

Hi all,

I can't get this script working.
My graphs stay blank, and i have no errors messages in my logs.
I have try to run the script in a shell, i get the expected results.

What's wrong ?
Is there a requirement for Apache version ? I'm using 1.3 and 2.0.x version

Thanks in advance.
soulshepard
Posts: 9
Joined: Fri Feb 09, 2007 8:20 am

Post by soulshepard »

my apache does not supply the cpu load ;(

i do have the extended status on and all other graphs seem to graph and besides the little bug that the graph template supplies u with a lot of duplicate rrd's (not nice when u try to add a lot of apache server;( ) all seems to work fine.

it this a apache version thing?
jezdikm
Posts: 7
Joined: Wed Apr 04, 2007 5:16 am

Troubles with Apache template

Post by jezdikm »

Hi all,
first of all THANK YOU for this amazing script !!!

I just want to mention my troubles with installation.

My steps:
*/ I downloaded ss_apache_stats
*/ I imported template
*/ I ran ss_apache_stats.php from CLI (command line) and I got correct result

No problem with these.

Unfortunately graphs were not displayed. I had a look into cacti.log and there were lines like:
04/04/2007 10:30:02 AM - PHPSVR: Poller[0] WARNING: Function does not exist
04/04/2007 10:30:02 AM - CMDPHP: Poller[0] Host[4] DS[75] WARNING: Result from SERVER not valid. Partial Result:
04/04/2007 10:30:02 AM - CMDPHP: Poller[0] Host[4] DS[74] WARNING: Result from SERVER not valid. Partial Result: WARNING: Function do
04/04/2007 10:30:02 AM - PHPSVR: Poller[0] WARNING: Function does not exist
04/04/2007 10:30:02 AM - PHPSVR: Poller[0] WARNING: Function does not exist
04/04/2007 10:30:02 AM - CMDPHP: Poller[0] Host[4] DS[73] WARNING: Result from SERVER not valid. Partial Result: Warning: include_onc
04/04/2007 10:30:02 AM - PHPSVR: Poller[0] WARNING: Function does not exist
04/04/2007 10:30:02 AM - CMDPHP: Poller[0] Host[4] DS[72] WARNING: Result from SERVER not valid. Partial Result:


After some time I found that the problem is in FILE PERMISSION! There was missing READ access for group and others. After change all works fine.

Hope this could help someone.

Thanks again for nice script,
Milan
kanada
Cacti User
Posts: 137
Joined: Sun Aug 28, 2005 12:51 pm

Post by kanada »

Hello all ;)

wired things, after installation all looks fine but all graphs are blank with 'nan' records.
In system i have:

cacti0.8.6i works on cmd.php, apache2, php5..
I think system permissions are ok, couse on cacti debig mode see resoults.

Code: Select all

04/18/2007 04:49:59 PM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /var/www/html/catest/rra/7606_apache_idle_workers_74.rrd --template apache_total_hits:apache_total_kbytes:apache_cpuload:apache_busy_workers:apache_idle_workers:thread_W:threadS:threadR:threadW:threadK:threadD:threadC:threadL:threadG:threadI:thread_O 1176907798:1866:11250:.686896:1:11:11:0:0:1:0:0:0:0:0:0:244
OK u:0.00 s:0.00 r:0.25
That same when i start screen on command line..
To be sure i set all php restrictions, safe_mode off, register_globalls on, without resoults, same nothing.
Cacti dont put into logs any errors, but graphs are blank..

Any help?

Greetz,
Alex.
flakpyro
Posts: 2
Joined: Tue Apr 24, 2007 10:04 am

Post by flakpyro »

Im also having this issue on CentOS 4.4 Apache 2.0.52, when i run it in a terminal it works fine but in cacti my graphs are empty. Any ideas?
shail
Posts: 1
Joined: Wed May 02, 2007 8:02 am

ApacheStats 0.6 install

Post by shail »

Hi,
I am a linux newbi I have apache running on a remote server and cacti on my local machine.
What should i enable to get ApacheStats 0.6 working and graphing it into the cacti.

Any suggestions.

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

Post by Panther_1 »

flakpyro wrote:Im also having this issue on CentOS 4.4 Apache 2.0.52, when i run it in a terminal it works fine but in cacti my graphs are empty. Any ideas?
Here on debian the same thin. cli runs fine but graphs are empty and the rrd files contains only NaN.

php: 5.2.0-10
apache2: 2.2.3-4

Output cli:

apache_busy_workers:7 apache_idle_workers:4 thread_W:4 threadS:0 threadR:0 threadW:1 threadK:6 threadD:0 threadC:0 threadL:0 threadG:0 threadI:0 thread_O:245

Output: status

ww-data@server02:~$ lynx -dump http://127.0.0.1/server-status?auto
BusyWorkers: 4
IdleWorkers: 6
Scoreboard: .K__W__KK__........................................................
...............................................................................
...............................................................................
...............................
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests