Skip to content

process

Process Manager for Filebeat processes and sub-processes.

To import...

from dynamite_nsm.services.filebeat import process as filebeat_process

CallFilebeatProcessError

__init__(self, message) special

Thrown when filebeat process encounters an error state

Parameters:

Name Type Description Default
message

A more specific error message

required

Returns:

Type Description

None

Source code in dynamite_nsm/services/filebeat/process.py
def __init__(self, message):
    """Thrown when filebeat process encounters an error state
    Args:
        message: A more specific error message
    Returns:
        None
    """
    msg = "An error occurred while calling filebeat process: {}".format(message)
    super(CallFilebeatProcessError, self).__init__(msg)

ProcessManager

__init__(self, stdout=True, verbose=False, pretty_print_status=False) special

Manage Filebeat Process

Parameters:

Name Type Description Default
stdout Optional[bool]

Print output to console

True
verbose Optional[bool]

Include detailed debug messages

False
pretty_print_status Optional[bool]

If enabled, status will be printed in a tabulated style

False

Returns:

Type Description

None

Source code in dynamite_nsm/services/filebeat/process.py
def __init__(self, stdout: Optional[bool] = True, verbose: Optional[bool] = False,
             pretty_print_status: Optional[bool] = False):
    """Manage Filebeat Process
    Args:
        stdout: Print output to console
        verbose: Include detailed debug messages
        pretty_print_status: If enabled, status will be printed in a tabulated style
    Returns:
        None
    """
    process.BaseProcessManager.__init__(self, 'filebeat.service', 'filebeat.process', log_path=None, stdout=stdout,
                                        verbose=verbose, pretty_print_status=pretty_print_status)

    if not profile.ProcessProfiler().is_installed():
        self.logger.error("Filebeat is not installed. Install it with 'dynamite filebeat install -h'")
        raise CallFilebeatProcessError('Filebeat is not installed.')