The auto keyword makes the output from apache simpler and more "machine readable".
See: http://webauthv3.stanford.edu/manual/mo ... tatus.html for more information about mod_status and the auto keyword.
Code is also shown here:
Code: Select all
#!/usr/bin/perl
# Script to get the requests per second and the requests currently being
# processed from an Apache webserver.
#
# Requires the following statement in Apache:
# ExtendedStatus on
# <Location /server-status>
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from xxx.xxx.xxx.xxx
# </Location>
#
# Idea stolen from: http://www.cacti.net/downloads/scripts/apachehits.pl.txt
#
# Written by Buckbeak
#
$output = `/usr/local/bin/bash -c '/usr/local/bin/wget --quiet -O - \"http:\/\/$ARGV[0]\/server-status\?auto"'`;
$output =~ /Total Accesses:\ (.*)/ && print "TotalAccesses:".$1." ";
$output =~ /Total kBytes:\ (.*)/ && print "TotalkBytes:".$1." ";
$output =~ /CPULoad:\ (.*)/ && print "CPULoad:".$1." ";
$output =~ /Uptime:\ (.*)/ && print "Uptime:".$1." ";
$output =~ /ReqPerSec:\ (.*)/ && print "ReqPerSec:".$1." ";
$output =~ /BytesPerSec:\ (.*)/ && print "BytesPerSec:".$1." ";
$output =~ /BytesPerReq:\ (.*)/ && print "BytesPerReq:".$1." ";
$output =~ /BusyServers:\ (.*)/ && print "BusyServers:".$1." ";
$output =~ /IdleServers:\ (.*)/ && print "IdleServers:".$1." ";
print "\n";