Telegram Bulk Notifications

CMK version: Checkmk Raw Edition 2.2.0p17
OS version: Ubuntu Server 20.04 LTS

Error message: no bulk notifications Telegram

Output of “cmk --debug -vvn hostname”:

Hello,

the last few weeks, I’ve been trying to figure out, how to set up a usable alerting concept within my company. We want to monitor several systems hosted by ourself or directly at the customers office.

I got Telegram notifications to work pretty easily, and I set up individual Telegram for each customer, where CheckMK sends notifications to the several Chat IDs.

One huge problem at this time: everytime a customer site goes down, telegram tries to send several messages and due to the API of Telegram, it is limited to 30 messages within 1 second, otherwise it will return error code 429.

Problem would be solved for me, if it was possible to bulk those notifications. Every plugin I tried does not work.

Anyone ready to share their Telegram Bulk notification script? Would extremly helppful!

Hi.
You can look at a notification script how to handle bulks. Fist is to set bulk mode identifier in script header:

#!/usr/bin/env python3
# My bulk notification
# Bulk: yes

The second part is to handle bulks. The alarm infomation will send to the script not longer via env. It get the data by reading stdin. So you need to something like that:

def read_bulk_contexts():
    parameters = {}
    contexts = []
    in_params = True

    # First comes a section with global variables
    for line in sys.stdin:
        line = line.strip()

I hope this help.

Rg, Christian

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed. Contact an admin if you think this should be re-opened.