Skip to content

profile

Profile Zeek processes to ensure they are running and installed properly.

To import...

from dynamite_nsm.services.zeek import profile as zeek_profile

ProcessProfiler

__init__(self) special

Get information about the Zeek service

Source code in dynamite_nsm/services/zeek/profile.py
def __init__(self):
    """
    Get information about the Zeek service
    """
    self.env_dict = utilities.get_environment_file_dict()
    self.zeek_home = self.env_dict.get('ZEEK_HOME')
    self.zeek_scripts = self.env_dict.get('ZEEK_SCRIPTS')

    profile.BaseProcessProfiler.__init__(self,
                                         install_directory=self.zeek_home,
                                         config_directory=self.zeek_scripts,
                                         required_install_files=['bin', 'etc', 'lib'],
                                         required_config_files=['site'])

is_running(self)

Determine of Zeek is running

Returns:

Type Description
bool

True, if running

Source code in dynamite_nsm/services/zeek/profile.py
def is_running(self) -> bool:
    """
    Determine of Zeek is running
    Returns:
        True, if running
    """
    if self.zeek_home:
        try:
            return zeek_process.ProcessManager().status()['running']
        except KeyError:
            return zeek_process.ProcessManager().status()['RUNNING']
    return False