INT 21h

Hi, I am Vladimir Smagin, SysAdmin. Telegram Email GPG / Микроблог

Zabbix: notifications to Telegram

№ 9548 В разделе "Администрирование" от November 15th, 2018,

To receive and forward messages to Telegram you need to install my Telegram-post-bot or use docker image. After this you can create script /usr/lib/zabbix/alertscripts/telegram.sh with this content:

#!/bin/bash
source /etc/profile

json_escape () {
    printf '%s' "$1" | python -c 'import json,sys; print(json.dumps(sys.stdin.read()).strip("\""))'
}

chat_id="-763495760089" # your channel id
post_title=$(json_escape "$1")
post_body=$(json_escape "$2")

echo "{\"chatID\":\"${chat_id}\",\"message\":\"${post_title}\n\n${post_body}\"}" | nc -U /run/telegram-GrapeBlessedBot.sock

You can get your account, group or channel id easily using @get_id_bot.

Now you ready to add new Media type (Administration -> Media types)

Add new media to your account

That’s all folks!

Нет комментариев »

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Микроблог перейти

# 2018-11-26 09:15:41

Обнаружил в kubedb код google analytics UA-62096468-20, слежка включена по умолчанию.

# 2018-11-24 23:30:12

Несложно смог контейнеризовать nginx unit с предзагрузкой конфигурации перед стартом контейнера blindage.org/?p=9575


© Vladimir Smagin, 2005-2018. Копирование материалов без разрешения запрещено. GPG 0x29AE91B1A37721C3
Яндекс.Метрика

Fortune cookie: At twenty-six, Kate, though not promiscuous, had slept with most of the decent men in public life. -- Renata Adler