Giter VIP home page Giter VIP logo

scouter-plugin-server-alert-telegram's Introduction

scouter-plugin-server-alert-telegram

Scouter server plugin to send a alert via telegram

  • 본 프로젝트는 스카우터 서버 플러그인으로써 서버에서 발생한 Alert 메시지를 Telegram으로 전송하는 역할을 한다.
  • 현재 지원되는 Alert의 종류는 다음과 같다.
    • Agent의 CPU (warning / fatal)
    • Agent의 Memory (warning / fatal)
    • Agent의 Disk (warning / fatal)
    • 신규 Agent 연결
    • Agent의 연결 해제
    • Agent의 재접속
    • 응답시간의 임계치 초과
    • GC Time의 임계치 초과
    • Thread 갯수의 임계치 초과

Properties (스카우터 서버 설치 경로 하위의 conf/scouter.conf)

  • ext_plugin_telegram_send_alert : Telegram 메시지 발송 여부 (true / false) - 기본 값은 false

  • ext_plugin_telegram_debug : 로깅 여부 - 기본 값은 false

  • ext_plugin_telegram_level : 수신 레벨(0 : INFO, 1 : WARN, 2 : ERROR, 3 : FATAL) - 기본 값은 0

  • ext_plugin_telegram_bot_token : Telegram Bot Token

  • ext_plugin_telegram_chat_id : chat_id(Integer) 또는 채널 이름(String)

  • ext_plugin_elapsed_time_threshold : 응답시간의 임계치 (ms) - 기본 값은 0으로, 0일때 응답시간의 임계치 초과 여부를 확인하지 않는다.

  • ext_plugin_gc_time_threshold : GC Time의 임계치 (ms) - 기본 값은 0으로, 0일때 GC Time의 임계치 초과 여부를 확인하지 않는다.

  • ext_plugin_thread_count_threshold : Thread Count의 임계치 - 기본 값은 0으로, 0일때 Thread Count의 임계치 초과 여부를 확인하지 않는다.

  • ext_plugin_ignore_name_patterns : Alert 메시지 발송에서 제외할 NAME 패턴 목록 (',' 구분자 사용, * (wildcard) 사용 가능)

  • ext_plugin_ignore_title_patterns : Alert 메시지 발송에서 제외할 TITLE 패턴 목록 (',' 구분자 사용, * (wildcard) 사용 가능)

  • ext_plugin_ignore_message_patterns : Alert 메시지 발송에서 제외할 MESSAGE 패턴 목록 (',' 구분자 사용, * (wildcard) 사용 가능)

  • ext_plugin_ignore_continuous_dup_alert : 연속된 동일 Alert을 1시간 동안 제외 - 기본 값은 false

  • Example

# External Interface (Telegram)
ext_plugin_telegram_send_alert=true
ext_plugin_telegram_debug=true
ext_plugin_telegram_level=0
ext_plugin_telegram_bot_token=185780011:AAGVaPyWCoZ8y1mHZEK1jFmbLwpcjlsJoJY
ext_plugin_telegram_chat_id=@ScouterDemoChannel

ext_plugin_elapsed_time_threshold=5000
ext_plugin_gc_time_threshold=5000
ext_plugin_thread_count_threshold=300

ext_plugin_ignore_name_patterns=myTomcat1
ext_plugin_ignore_title_patterns=Elapsed,CONNECTION,activat*
ext_plugin_ignore_message_patterns=*(/v1/common/user/testuser)*
ext_plugin_ignore_continuous_dup_alert=true

Dependencies

  • Project
    • scouter.common
    • scouter.server
  • Library
    • commons-codec-1.9.jar
    • commons-logging-1.2.jar
    • gson-2.6.2.jar
    • httpclient-4.5.2.jar
    • httpcore-4.4.4.jar

Build & Deploy

  • Build

    • 프로젝트 내의 build.xml을 실행한다.
  • Deploy

    • 빌드 후 프로젝트 하위에 out 디렉토리가 생기며, 디펜던시 라이브러리와 함께 scouter-plugin-server-alert-telegram.jar 파일을 복사하여 스카우터 서버 설치 경로 하위의 lib/ 폴더에 저장한다.

Requirement

  • Telegram 서버가 TLSv1을 지원하지 않으므로, Scouter Server를 Java 8 이상으로 구동시켜야 합니다.

Appendix

Telegram 데모 채널
Telegram Bot 생성
  • Telegram App에서 BotFather를 검색합니다.
  • BotFather를 통해 수행할 수 있는 명령어는 다음과 같습니다.
  • /newbot을 입력하여 새로운 봇을 생성합니다.
Telegram chat_id 조회
  • Telegram App에서 생성된 Bot을 검색합니다.
  • 시작을 누릅니다.
  • chat id 값을 이용하여 대화창으로 메시지를 전송할 수 있습니다. (공개 채널의 경우 @{channelName}으로 메시지 전송 가능)

scouter-plugin-server-alert-telegram's People

Contributors

nices96 avatar 007g1 avatar gunlee01 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.