j d Z ddlZddlZddlZddlmZmZ ddlmZm Z ddl
mZ dZ ej
d Z G d d
e ZdS )a
This module contains SSA specific config parser:
- has defaults
- adds default values for ones missing in config file
- allows duplicates, the latest value is loaded
- performs value normalization during loading items:
- to int
- to float
- to bool
- 'correlation' is case-insensitive and allowed to be
on, off, 1, 0, yes, no, true, false
- loads default configuration in case of missing config file
N)ConfigParserNoSectionError)CallableList )config_filessa_confssa_configuration_parserc
e Zd ZdZ fdZedefd Zedefd Zedefd Z de
ded edefd
Ze
ddfded
ededee fdZd ZddZdeddfdZddZd Zd Z xZS )SSAConfigParserz2
SSA specific configparser implementation
c
dddddddddd }d d
ddd
ddddd | _ | | _ t |d d S )N
g @ Tg? ) domains_numberurls_numberrequest_numberrequests_durationtimecorrelationcorrelation_coefficientignore_listsummary_notification_enabledz!Size of TOP list for slow domainszSize of TOP list for slow urlsz[The threshold value of slow requests number in the period of time to mark URL as a slow onez2The threshold value of request duration in secondsz:Period of time in hours required to analyze these requestsz.Flag to enable or disable correlation (On/Off)z.The threshold value of correlation coefficientzEList of URLs or domains that should not be included in a daily reportzBFlag to enable or disable sending daily reports by e-mail (On/Off)F)strict) _commentscopyssa_defaultssuper__init__)selfdefaults __class__s O/opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/configuration/parser.pyr zSSAConfigParser.__init__( s !$'*,0
B;{!UPK'Wb,p
%MMOO
%00000 returnc dS )N)r r r r r! s r$ int_optionszSSAConfigParser.int_optionsB s HHr% c dS )N)r r r( r) s r$
float_optionszSSAConfigParser.float_optionsF s ==r% c dS )N)r r r( r) s r$ bool_optionszSSAConfigParser.bool_optionsJ s <