Git Product home page Git Product logo

alertstelegram4sappo's Introduction

AlertsTelegram4SAPPO

Message-Driven Bean implementation class for TelegramAlertingJob in SAP PI/PO. Sends messages from standard JMS queue alertingVP to Telegram channel via bot.

Telegram bot & channel settings

  1. Create public channel with public link (@nickname)
  2. Create bot via @botfather
  3. Add bot to channel as admin

How to config job in SAP PO

  1. Operations->Jobs and open Java Scheduler

Java Scheduler

  1. On Java Scheduler screen go to tab Tasks and click the Add button

Tasks

  1. Select TelegramAlertingJob

image

  1. Enter Job Parametres

image

alertConsumer: name of a consumer that was set in SAP PO Alert Rule. This is used as a name for JMS queue in alertingVP.

maxAlertCount is max count of consumed alerts from JMS queue

apiToken: can be retrieved from BotFather;

chatId: id of telegram channel (described below in How to get id of private telegram channel)

  1. Do not forget to set back channel as private one unless you want everyone to see a mess in your system ^^
  2. Set timer parameters. Running job every 2 min would be enough and much more representative than emails.

image

  1. Finish the job configuration. As a result you will find a job on Tasks tab

image

How to get id of private telegram channel

As a result you will get JSON including real chat id:

{
    "ok": true,
    "result": {
        "chat": {
            "id": -100187777,
            "title": "SAP PO Critical Alerts",
            "type": "channel",
            "username": "nickname"
        },
        "date": 1667811418,
        "entities": [
            {
                "length": 4,
                "offset": 0,
                "type": "bold"
            }
        ],
        "message_id": 4,
        "sender_chat": {
            "id": -100187777,
            "title": "SAP PO Critical Alerts",
            "type": "channel",
            "username": "nickname"
        },
        "text": "test"
    }
}

alertstelegram4sappo's People

Contributors

sanberg avatar

Watchers

 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.