Skip to main content

A parser for the /server-status page of Apache

Project description

Parser for the /server-status page of an Apache server

server-status-parser is a simple Python package that parses the output of the /server-status page of an Apache server.

The package is not intended to parse the ?auto version of the page as it is already in a machine-readable format. server-status-parser is made to parse the normal version of the /server-status page and extract as much of the content as possible. This includes the workers table which under ?auto is not available.

Installation

pip install server-status-parser

Usage

from server_status_parser import extract_info_from_html

with open('server_status.html', 'r') as f:
    content = f.read()

parsed_content = extract_info_from_html(content)
print(parsed_content)

Example Page

If we have a page like the one shown below, we can parse it using the server-status-parser package. The output is shown underneath.

apache server status page example

Output from the Parser

{
    'heading': 'Apache Server Status for google.com (via 127.0.0.1)',
    'endpoint': 'google.com',
    'via_part': '127.0.0.1',
    'server_version': 'Apache/2.4.62 (Win64)',
    'server_mpm': 'WinNT\nApache Lounge VS17',
    'server_built': None,
    'aggregated_stats': {
        'current time': 'Monday, 24-Feb-2025 16:29:45 W. Europe Standard Time',
        'restart time': 'Monday, 24-Feb-2025 16:05:19 W. Europe Standard Time',
        'parent server config. generation': '1',
        'parent server mpm generation': '0',
        'server uptime': '24 minutes 25 seconds',
        'server load': '-1.00 -1.00 -1.00',
        'total accesses': '5',
        'total traffic': '6 KB',
        'total duration': '8',
        'requests/sec': '00341',
        'b/second': '4',
        'b/request': '1228',
        'ms/request': '1.6',
        'requests currently being processed': '1',
        'workers gracefully restarting': '0',
        'idle workers': '63'
    },
    'scoreboard': '___________________________________________W____________________',
    'workers_table': pd.DataFrame( Srv  PID   ...       VHost               Request 
                               0  0-0  11288  ...  localhost:9090  GET /server-status HTTP/1.1),
    'problems': []
}

Content that is Currently NOT PARSED

Some contents of the page are not currently parsed as we do not consider them important and hence worth investing time.

TLS Cache Section

This section appears near the end of the page and shows the status of the TLS cache.

tls cache section example

mod_fcgid

This section appears below the workers table when mod_fcgid is enabled.

mod_fcgid section example

GnuTLS

This section appears below the workers table when mod_gnutls is enabled.

gnu tls section example

Slot Table

This table appears above the scoreboard.

slot table example

Plaintext Workers Table

Very rarely we have found that the workers table is in plaintext format in stead of being properly formatted as an HTML table. This is not parsed.

plaintext workers table example

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

server_status_parser-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

server_status_parser-0.1.1-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file server_status_parser-0.1.1.tar.gz.

File metadata

  • Download URL: server_status_parser-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.6

File hashes

Hashes for server_status_parser-0.1.1.tar.gz
Algorithm Hash digest
SHA256 299fe7af93558129087aea63b82d50185825c21b96e6a20f6c3a6d389aed4abc
MD5 e0e0a4a8e47c77561e1112b72f44867d
BLAKE2b-256 fc57c2fe56dbb4a77c32a281179bfe167f1e13f102b3ab9314626494cca2bf4d

See more details on using hashes here.

File details

Details for the file server_status_parser-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for server_status_parser-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 927c255263757e50f1f3e2a9074dd2e46b574cf8aebc33e390baef59234f9823
MD5 06ed3a6761d995187666e7c8e9d41c5b
BLAKE2b-256 208fb16f1b85722ff5129c86c489bd146a04517dffa797ccb54915a2b177eb32

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page