Giter Site home page Giter Site logo

exporter.opensearch-notify.telegram's Introduction

Dashboard OpenSearch + Notify Telegram

Yêu cầu

  1. Setup stack Prometheus + Grafana trên server LAB Monitor
  2. Setup OpenSearch Exporter + Node Exporter trên hệ thống LAB siem (soc_lab_wazuh_ao1)
  3. Setup AlertManager notify Telegram: Hardware + healthcheck Opensearch

Mô hình

Mo hinh

Cách cài đặt tích hợp

1. Setup Prometheus + Grafana + Node Exporter

  • Download, unzip và cài đặt:

    Prometheus here

    Grafana here

    Node-Exporter here

  • Cấu hình và khởi động dịch vụ:

    Prometheus as a service (Lưu ý tạo file log và phân quyền trước khi start service). Di chuyển folder prometheus vừa unzip bước trên vào /usr/local/bin. Chuyển file prometheus.yml ra folder mới để tiện config /etc/prometheus/prometheus.yml. Đồng thời thêm các alert rules vào cùng folder đó.

    Sau khi khởi chạy node-exporter và prometheus thì vào web Grafana add data source prometheus. Sau đó import ID dashboard node-exporter 11074 để check hardware server.

2. Setup OpenSearch Exporter (soc_lab_wazuh_ao1)

  • Tạo folder exporter rồi tạo file docker-compose.yml để chạy exporter gồm 2 service opensearch-exporternode-exporter.

3. Setup AlertManager notify Telegram

  • Telegram Bot

    Tạo bot mới trên Telegram bằng BotFather (tự search các tạo). Add bot vào group sau đó chat lần đầu để lấy chat id check trên https://api.telegram.org/bot(token)/getUpdates.

    Tạo folder cho service telegram_bot gồm 2 phần:

  • AlertManager

    Download và unzip: AlertManager here

    AlertManager as a service (Lưu ý tạo file log và phân quyền trước khi start service). Di chuyển folder alertmanager vừa unzip bước trên vào /usr/local/bin. Chuyển file alertmanager.yml ra folder mới để tiện config /etc/alertmanager/alertmanager.yml (lưu ý trong url webhook_configs sửa chat id đã lấy được từ bước tạo telegram bot).

  • Sau khi khởi động xong 2 dịch vụ trên chúng ta sẽ lên web Grafana rồi import template để hiển thị Dashboard OpenSearch

Kết quả

  • Dashboard Opensearch

Dashboard Opensearch

  • Nofify Telegram

Bot Telegram Notify

  • Các thông số cảnh báo về Telegram:

    Node-exporter:

    • RAM
    • CPU
    • Disk Space (Write, Read)
    • Network (IN, OUT)

    OpenSearch-exporter:

    • Missing node
    • Missing data node
    • Heap Too High
    • Cluster YELLOW, RED
    • Unassigned Shards
    • Pending Tasks (*)
    • JVM Heap Use High
    • Process CPU High

Cải thiện và nâng cấp

  • Khắc phục định dạng alert bot trả kết quả:

    Một số chỗ còn chưa rõ ràng do template rules alert chưa chuẩn

    Tối ưu lại description và summary

  • Tích hợp thêm Blackbox exporter để cải thiện các thông báo trùng lặp trong rules Opensearch exporter

exporter.opensearch-notify.telegram's People

Contributors

lamtruong-devops avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.