GithubHelp home page GithubHelp logo

nagios-telegram-notification's Introduction

nagios-telegram-notification

Nagios host and service notifications via Telegram bot without installing any messy scripts.

Create a Telegram bot

Message @BotFather in your Telegram app. Write down your bots access token, which is something like '53355511:AaFnF2Xnt1-RjGMaQZ_412tvp-_e12312KQ'. When using the token, you add 'bot' in-front of the token to complete it, turning the access token into 'bot53355511:AaFnF2Xnt1-RjGMaQZ_412tvp-_e12312KQ'.

Next, type /setprivacy to @BotFather and set DISABLE for your bot.

Invite the bot to your Telegram group

Select 'Info' on your group name in your Telegram app and invite the bot. Make sure you are admin of the group or there may be issues.

Write something in the Telegram group

As yourself, write something in the group.

Fetch the chat_id of the Telegram group

Fetch events from your bot by running:

curl -Lk -i -X GET https://api.telegram.org/botACCESSTOKEN-GIVEN-FROM-BOTFATHER/getUpdates

Output will be something like:

"message":{"message_id":14,"from":{"id":300920731,"is_bot":false,"first_name":"Your","last_name":"Name","language_code":"en-US"},"chat":{"id":-123456789,"title":"My fancy Telegram group","type":"supergroup"},"date":1520901132,"text":"I like beer"}}]}

Copy and save "chat" id, which in above example is -123456789.

Copy custom notification commands

Copy the custom notifications commands from here: https://github.com/mglantz/nagios-telegram-notification/blob/master/command.cfg and replace the chat_id value with above and replace botREPLACEME with your full access token.

nagios-telegram-notification's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

nagios-telegram-notification's Issues

Showing an extra $ sign?

Thank you for your work, the script works well. I implemented it today on Centos7 with NagiosXI (latest) and core (latest).

Happens to only service alerts. Host looks good.

image

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.