[Orca-users] No web server stats with procallator on Redhat EL30

Charles R. Dennett dennett at rochester.rr.com
Fri Aug 19 19:21:12 PDT 2005


Kocic, Dejan wrote:
> Hi,
> 
> After getting Orca to work with procallator I noticed that is not
> plotting webserver stats. I compiled orca with  ./configure
> --prefix=/usr/local/orca
> --with-ncsa-log=/usr/local/apache2/logs/access_log
> --with-html-dir=/local/htdocs/admin/orca and the webserver is Apache
> 2.0.54. Would anyone know where to look for to enable web stats
> plotting? I didn't notice that procallator.pl is doing Web server stats
> gathering. 
> 
> Regards,
> Dejan Kocic

Procallator does not have any code in to collect web server stats.  When
I installed orca/procallator on my Linux system a couple of years ago I
asked the same question.  Another user supplied me with some code to add
to procallator to do just that.  It is specific to Apache and it needs
the option to show the server status via a web page at
http://your.server.name/server-status.  (Appologies to whoever suppled
me with the code.  I neglected to save your name so I cannot credit you
appropriately.)

Since just tonight I upgraded orca/procallator to support my Linux 2.6
kernel, I had to add this code back to procallator and the cfg file orca
uses.  Here is is:

Somewhere near the beginning of procallator add this code and put in the
URL for your server in place of mine:

# Local Mod
use LWP::Simple;
$SERVER_STATUS_URL="http://www.dennett.org/server-status?auto";
$APACHE2=1;

Now, look for the following line near the end of procallator:

# Get filesystem occupation


Then add the following code just before it:

   #
   # Web server status
   #
   $content = get( $SERVER_STATUS_URL );

   if( $APACHE2 == 0 ){
       ($busy_servers) = ($content =~ /BusyServers: (\d*)/gi);
       ($idle_servers) = ($content =~ /IdleServers: (\d*)/gi);
       ($req_per_sec)   = ($content =~ /ReqPerSec: ([\.\d]*)/gi);
       ($bytes_per_sec) = ($content =~ /BytesPerSec: ([\.\d]*)/gi);
       ($bytes_per_req) = ($content =~ /BytesPerReq: ([\.\d]*)/gi);
   }
   else {
       ($busy_servers)  = ($content =~ /BusyWorkers: (\d*)/gi);
       ($idle_servers)  = ($content =~ /IdleWorkers: (\d*)/gi);
       ($req_per_sec)   = ($content =~ /ReqPerSec: ([\.\d]*)/gi);
       ($bytes_per_sec) = ($content =~ /BytesPerSec: ([\.\d]*)/gi);
       ($bytes_per_req) = ($content =~ /BytesPerReq: ([\.\d]*)/gi);
   }
   put_output( "http_srv_busy", $busy_servers,
               "http_srv_idle", $idle_servers,
               "http_req/s",    $req_per_sec,
               "http_bytes/s",  $bytes_per_sec,
               "http_bytes/req",$bytes_per_req
   );

# End of local mod


OK, that allows procallator to collect the data.  How add the following
to procallator.cfg to allow orca to construct the graphs:

#
# these next three plots for a web server supplied by an orca-dev user.
#
plot {
title                   %g Web Server Busy and Idle servers
source                  procallator
data                    http_srv_busy
data                    http_srv_idle
plot_min                0
line_type               area
line_type               stack
legend                  HTTP busy
legend                  HTTP idle
color                   0000ff
color                   00ff00
y_legend                Number httpd processes
}


plot {
title                   %g Web Server Bytes per sec and per request
source                  procallator
data                    http_bytes/s
data                    http_bytes/req
line_type               line2
line_type               line2
plot_min                0
legend                  Bytes/s
legend                  Bytes/req
y_legend                Bytes/s   Bytes/req
}

plot {
title                   %g Web Server requests per second
source                  procallator
data                    http_req/s
line_type               line2
plot_min                0
legend                  Req/s
}

That should do it.

Feel free to take a look at my orca stats at
http://www.dennett.org/orca/procallator  Because of the big change for
the collection of Linux 2.6 kernel data, I started all my graphs over
with the data I started collecting tonight and removed the past two
years worth of data (but I still have the datafiles from procallator
archived.)

Hope this helps.

Charlie Dennett



More information about the Orca-users mailing list