PERL
37
apachehits pl
Guest on 25th January 2023 01:59:24 AM
#!/usr/bin/perl
# Script to get the requests per second and the requests currently being processed from
# an Apache webserver.
# In order for this to work, you will need to have server stats enabled in Apache.
# To enable the builtin apache server-status, you will need to enable mod_status
# and have something like the following in your httpd.conf file.
# ExtendedStatus on
# <Location /server-status>
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from localhost
# </Location>
$output = `/bin/bash -c 'wget --quiet -O - \"http:\/\/localhost\/server-status"'`;
$output =~ /(.*) requests\/sec/;
$output =~ /(.*) requests currently being processed/;