HttpdV - command httpd -V

Module for parsing the output of command httpd -V. The bulk of the content is split on the colon and keys are kept as is. Lines beginning with ‘-D’ are kept in a dictionary keyed under ‘Server compiled with’; each compilation option is a key in this sub-dictionary. The value of the compilation options is the value after the equals sign, if one is present, or the value in brackets after the compilation option, or ‘True’ if only the compilation option is present.

class insights.parsers.httpd_V.HttpdV(context, extra_bad_lines=None)[source]

Bases: insights.core.LegacyItemAccess, insights.core.CommandParser

Class for parsing httpd -V command output.

The data is kept in the data property and can be accessed through the object itself thanks to the LegacyItemAccess parser class.

Typical output of command httpd -V looks like:

Server version: Apache/2.2.6 (Red Hat Enterprise Linux)
Server's Module Magic Number: 20120211:24
Compiled using: APR 1.4.8, APR-UTIL 1.5.2
Architecture:   64-bit
Server MPM:     Prefork
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"

Examples

>>> type(hv)
<class 'insights.parsers.httpd_V.HttpdV'>
>>> hv.mpm
'prefork'
>>> hv["Server's Module Magic Number"]
'20120211:24'
>>> hv['Server compiled with']['APR_HAS_SENDFILE']
True
>>> hv['Server compiled with']['APR_HAVE_IPV6']
'IPv4-mapped addresses enabled'
>>> hv['Server compiled with']['SERVER_CONFIG_FILE']
'conf/httpd.conf'
data

The bulk of the content is split on the colon and keys are kept as is. Lines beginning with ‘-D’ are kept in a dictionary keyed under ‘Server compiled with’; each compilation option is a key in this sub-dictionary. The value of the compilation options is the value after the equals sign, if one is present, or the value in brackets after the compilation option, or ‘True’ if only the compilation option is present.

Type

dict

Raises

SkipException -- When input content is empty or there is no parsed data.

property httpd_command

The full path of a running httpd. An Empty string when nothing is found. To identify which httpd binaries the instance run with.

Type

str

property mpm

The MPM mode of the running httpd. An Empty string when nothing is found.

Type

str

parse_content(content)[source]

This method must be implemented by classes based on this class.

property version

The version of the running httpd. An Empty string when nothing is found.

Type

str