HttpdM - command httpd -M

Module for parsing the output of command httpd -M.

class insights.parsers.httpd_M.HttpdM(context, extra_bad_lines=None)[source]

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

Class for parsing httpd -M 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 -M looks like:

Loaded Modules:
 core_module (static)
 http_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
Syntax OK

Examples

>>> type(hm)
<class 'insights.parsers.httpd_M.HttpdM'>
>>> len(hm.loaded_modules)
5
>>> len(hm.static_modules)
2
>>> 'core_module' in hm.static_modules
True
>>> 'http_module' in hm.static_modules
True
>>> 'http_module' in hm
True
>>> 'http_module' in hm.shared_modules
False
>>> hm.httpd_command
'/usr/sbin/httpd'
Raise:
ParseException: When input content is empty or there is no parsed data.
data

All loaded modules are stored in this dictionary with the name as the key and the loaded mode (‘shared’ or ‘static’) as the value.

Type:dict
loaded_modules

List of the loaded modules.

Type:list
static_modules

List of the loaded static modules.

Type:list
shared_modules

List of the loaded shared modules.

Type:list
httpd_command

Return the full binary path of a running httpd or None when nothing is found. It’s to identify which httpd binaries the instance run with.

parse_content(content)[source]

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