mentat.const module

Global constants and utilities for Mentat system.

mentat.const.CKEY_CORE_DATABASE = '__core__database'

Name of the configuration key for core database configurations.

mentat.const.CKEY_CORE_DATABASE_CONFIG = 'config'

Name of the configuration subkey key for config configuration in core database configurations.

mentat.const.CKEY_CORE_DATABASE_CONNECTION = 'connection'

Name of the configuration subkey key for connection configuration in core database configurations.

mentat.const.CKEY_CORE_DATABASE_EVENTSTORAGE = 'eventstorage'

Name of the configuration subkey key for eventservice configuration in core database configurations.

mentat.const.CKEY_CORE_DATABASE_SCHEMA = 'schema'

Name of the configuration subkey key for schema configuration in core database configurations.

mentat.const.CKEY_CORE_DATABASE_SQLSTORAGE = 'sqlstorage'

Name of the configuration subkey key for sqlservice configuration in core database configurations.

mentat.const.CKEY_CORE_INFORMANT = '__core__informant'

Name of the configuration key for core informant configurations.

mentat.const.CKEY_CORE_INFORMANT_REPORTSDIR = 'reports_dir'

Name of the configuration subkey key for reports dir configuration in core informant configurations.

mentat.const.CKEY_CORE_REPORTER = '__core__reporter'

Name of the configuration key for core reporter configurations.

mentat.const.CKEY_CORE_REPORTER_EVENTCLASSESDIR = 'event_classes_dir'

Name of the configuration subkey key for event classes dir configuration in core reporter configurations.

mentat.const.CKEY_CORE_REPORTER_FALLBACK = 'fallback'

Name of the configuration subkey key for fallback configuration in core reporter configurations.

mentat.const.CKEY_CORE_REPORTER_REPORTSDIR = 'reports_dir'

Name of the configuration subkey key for reports dir configuration in core reporter configurations.

mentat.const.CKEY_CORE_REPORTER_TEMPLATESDIR = 'templates_dir'

Name of the configuration subkey key for templates dir configuration in core reporter configurations.

mentat.const.CKEY_CORE_REPORTER_TEMPLATEVARS = 'template_vars'

Name of the configuration subkey key for template vars configuration in core reporter configurations.

mentat.const.CKEY_CORE_SERVICES = '__core__services'

Name of the configuration key for core services configurations.

mentat.const.CKEY_CORE_SERVICES_CACHE = 'cache'

Name of the configuration subkey key for cache configuration in core services configurations.

mentat.const.CKEY_CORE_SERVICES_DNS = 'dns'

Name of the configuration subkey key for DNS configuration in core services configurations.

mentat.const.CKEY_CORE_SERVICES_GEOIP = 'geoip'

Name of the configuration subkey key for GeoIP configuration in core services configurations.

mentat.const.CKEY_CORE_SERVICES_NERD = 'nerd'

Name of the configuration subkey key for NERD configuration in core services configurations.

mentat.const.CKEY_CORE_SERVICES_PDNS = 'pdns'

Name of the configuration subkey key for PassiveDNS configuration in core services configurations.

mentat.const.CKEY_CORE_SERVICES_WHOIS = 'whois'

Name of the configuration subkey key for whois configuration in core services configurations.

mentat.const.CKEY_CORE_STATISTICS = '__core__statistics'

Name of the configuration key for core statistics configurations.

mentat.const.CKEY_CORE_STATISTICS_REPORTSDIR = 'reports_dir'

Name of the configuration subkey key for reports dir configuration in core statistics configurations.

mentat.const.CKEY_CORE_STATISTICS_RRDSDIR = 'rrds_dir'

Name of the configuration subkey key for RRDs dir configuration in core statistics configurations.

mentat.const.DFLT_EVENT_LOG_STATISTICS = 'log_statistics'

Default name for the log_statistics event.

mentat.const.DFLT_EVENT_RELOAD = 'reload'

Default name for the reload event.

mentat.const.DFLT_EVENT_SAVE_RUNLOG = 'save_runlog'

Default name for the save_runlog event.

mentat.const.DFLT_EVENT_START = 'start'

Default name for the start event.

mentat.const.DFLT_INTERVAL_RELOAD = 300

Default time interval in seconds for reloading internal caches.

mentat.const.DFLT_INTERVAL_RUNLOG = 60

Default time interval in seconds for saving currrent processing runlog.

mentat.const.DFLT_INTERVAL_STATISTICS = 20

Default time interval in seconds for calculating processing statistics.

mentat.const.DFLT_QUEUE_IN_CHECK_INTERVAL = 3

Default interval in seconds for checking the input queue for new messages.

mentat.const.DFLT_QUEUE_IN_PERMS = 509

Default interval in seconds for checking the input queue for new messages.

mentat.const.DFLT_QUEUE_OUT_CHECK_INTERVAL = 10

Default interval in seconds for checking whether the output queue is full.

mentat.const.DFLT_QUEUE_SIZE_LIMIT = 5000

Default limit for number of messages in the queue.

mentat.const.RE_REPORT_FILE_TIMESTAMP = re.compile('^[^\\d]*([\\d]{8})')

Regular expression for parsing out the report timestamp from attachment file name.

mentat.const.construct_report_dirpath(basedirpath, filename, check=False)[source]

Construct target report directory path based on given base path and file name.

If filename contains timestamp information ([d]{8}), place that file into another subdirectory. This approach is a solution to report directory containing hundreds of thousands of files.

mentat.const.random_str(length=10, letters='abcdefghijklmnopqrstuvwxyz')[source]

Generate a random string of fixed length from given set of letters.

mentat.const.tr_(val)[source]

Method for marking translatable strings according to the documentation recipe at https://docs.python.org/3/library/gettext.html#deferred-translations.