GithubHelp home page GithubHelp logo

amhooker's Introduction

Amhooker

Wehook application for Alert Manager.

Features:

  • Support send message for Telegram chat or thread/topic

Expose APIs

/webhook/telegram?topic_id=1?template_name=

Configuration

Firstly, create amhooker config.yaml with format:

Param Type Description Example
timeZone string Set time zone "Asia/Singapore"
timeOutputFormat string Set time output format, provide a datetime as desired datetime "01/01/2004 11:11:11"
splitMessageBytes number Message size, if exceed this size, split origin message to small message 4000
telegram.enabled boolean Set true to enable sending alert to telegram true
telegram.botToken string Telegram bot token "1234567890:WERDFAjdksf832SD324DAER"

Example amhooker.yaml:

timeZone: "Asia/Singapore"
timeOutputFormat: "31/01/2004 12:12:12"
splitMessageBytes: 4000
telegram: 
  enabled: true 
  botToken: "1234567890:WERDFAjdksf832SD324DAER"

Usage

Binary

Download the binary file and run command amhooker and pass following arguments or setup environment:

amhooker [flags]

Flags:
      --config_file string   AMHooker manager config file (*require) (env AMHOOKER_CONFIG_FILE)
      --debug string         Type of debug mode: INFO | DEBUG | NONE . (env AMHOOKER_DEBUG_MODE) (default "INFO")
  -h, --help                 help for amhooker
      --port int             Running application port. (env AMHOOKER_PORT) (default 8866)

Example for setup command arguments approach with amhooker config file existed at "/etc/amhooker/amhooker.yaml":

# Add execute permission
chmod mod +x amhooker

# Start amhooker
amhooker --alert_config_path=/etc/amhooker/amhooker.yaml --debug=DEBUG --port=8181

Example for setup environment approach:

# Export environment variables
export AMHOOKER_CONFIG_FILE=/etc/amhooker/amhooker.yaml
export AMHOOKER_PORT=8181
export AMHOOKER_DEBUG_MODE=DEBUG

# Add execute permission
chmod mod +x amhooker

# Start amhooker
amhooker

Docker

docker run --rm -v <amhooker_config_file>:<container_amhooker_config_file> -e AMHOOKER_CONFIG_FILE=<container_amhooker_config_file> orezfu/amhooker:<tag>
# docker run --rm -v /etc/amhooker/amhooker.yaml:/amhooker.yaml -e AMHOOKER_CONFIG_FILE=/amhooker.yaml orezfu/amhooker:v0.1.0

Kubernetes Helm Chart

(Continue)

Some issues:

  • SortedPairs is not working

amhooker's People

Contributors

phuhv3-439090 avatar orez-fu avatar

Stargazers

 avatar  avatar

Watchers

 avatar

amhooker's Issues

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.