en

Введение

EASystem создана чтобы улучшить интегрированную систему алертинга для ElasticSearch.

Зависимости

certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
cryptography==38.0.1
elastic-apm==6.12.0
elasticsearch==7.17.0
idna==3.4
pycparser==2.21
PyYAML==6.0
requests==2.28.1
schedule==1.1.0
urllib3==1.26.12
pydantic==1.10.2

Note

Пакетный менеджер pip имеет возможность читать файлы с описанием зависимостей и устанавливать их с помощью команды pip install *r requirements.txt

Настройка Python

Note

Рекомендуется использовать виртуальное окружение Python

VENV

Конфигурационный файл

#file (id.log), elk, sqlite3
modules:
  main:
    database.type: sqlite3
    database.fill: false
    database.fill_query_range: 24 #in hours
    interval: 60 #in seconds, minimum 30 seconds
    query_range: 10 #in hours, minimum 1 hour
    include_projects: [ '*' ]
    exclude_projects: [ ]

  find_restarts:
    enabled: true
    time: "300000" #in milliseconds. (system.uptime.duration.ms)
    include_projects: [ '*' ]
    exclude_projects: [ ]

  certificate_expire_date:
    enabled: true
    every: 1 #day(s)
    at: "10:00" #time

encryption:
  include_projects: [ '*' ]
  exclude_projects: [ ]
  telegram: true

debug_mode:
  enabled: true
  silent: false
  #telegram_channel_id:
  #telegram_token:

info_message:
  at_startup: true
  schedule: false
  schedule_timer: 60 #in minutes
  #telegram_channel_id:
  #telegram_token

#Debug, info, warning, error, critical.
logging:
  level: warning
  to_files: true
  to_console: false

logs.directory:
  linux: "/var/log/EASystem/"
  win32: "E:\\EASystem\\logs\\"

config.directory:
  linux: "/usr/share/EASystem/configs/"
  win32: "E:\\EASystem\\configs\\"

passwd.directory:
  linux: "/usr/share/EASystem/passwd/"
  win32: "E:\\EASystem\\passwd\\"

output.elasticsearch:
  hosts: [ "https://localhost:9200" ]
  verify_certs: false
  #certificate: "E:\\EASystem\\elasticsearch-ca.pem"
  certificate: "/usr/share/EASystem/elasticsearch-ca.pem"
  username: ""
  password: ""

output.elasticsearch.apm:
  enabled: false
  service_name: "EASystem"
  server_url: "http://localhost:8200"
  secret_token: ""
  environment: "prd"

connectors:
  e-mail:
    enabled: true
    # Overrides all recipients in any cases.
    redirect:
      enabled: false
      silent: false
      to: [ 'contracted1@contoso.com' ]

  telegram:
    enabled: true
    #default_channel_id:
    #default_token:
    #projects_channel_id:
      #project1:
    #projects_token:
      #project1:

modifiers:
  metrics:
    system.core: [ ]
    system.cpu: [ 'total.norm.pct': 'CPU Usage', 'system.pct': 'CPU pst' ]
    system.diskio: [ ]
    system.entropy: [ ]
    system.filesystem: [ 'used.pct': 'Disk Usage','free': 'Disk free space' ]
    system.fsstat: [ ]
    system.load: [ ]
    system.memory: [ 'actual.used.pct': 'RAM Usage','swap.free': 'Swap free', 'actual.free': 'Actual Free RAM' ]
    system.network: [ ]
    system.network_summary: [ ]
    system.process: [ ]
    system.process.summary: [ ]
    system.raid: [ ]
    system.service: [ ]
    system.socket: [ ]
    system.socket.summary: [ ]
    system.uptime: [ ]
    system.users: [ ]
    prometheus.metrics: [ 'node_filesystem_avail_bytes': 'Disk Usage (in bytes)' ]

  alerts:
    #kibana-alert-history-[accepted_projects]
    projects: [ "default", "project1", "project2" ]
    #Accepted Tags for shown as topic
    tags: ["tag1", "tag2"]

  mail_recipients:
      tag1:
          to: [ 'contracted1@contoso.com' ]
      tag2:
          to: [ 'contracted1@contoso.com', 'contracted2@contoso.com' ]
mail_recipients:
    project1:
        enabled: true
        to: [ 'contracted1@contoso.com', 'contracted2@contoso.com' ]

    project2:
        enabled: true
        to: [ 'contracted1@contoso.com', 'contracted2@contoso.com' ]

1. Modules

2. Encryption

3. Debug mode

4. Info message

5. Logging

6. Directory

7. Output

8. Connectors

9. Modifiers

10. Mail recipients

Модули

Основной

Поиск рестартов

Проверка срока истечения SSL сертификата

Первый запуск

Системы получения оповещений

Электронная почта

Мессенджеры

Telegram

Шифрование чувствительных данных

Модификаторы

Custom

Service

Дополнительно

Elasticsearch APM

Режим отладки

Информационное сообщение

Глоссарий