Skip to content

Commit f763b8b

Browse files
committed
update
1 parent e5628ba commit f763b8b

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Telegram has long been one of my real-time communication media. It is obvious to
2424

2525
## COMPATIBILITY
2626
- Check_MK RAW version 1.6.0_p18
27-
- Check_MK RAW version 2.0.0_p4
27+
- Check_MK RAW version 2.0.0_p8
2828
- Should also work with other versions of Check_MK
2929

3030
## EXAMPLE
@@ -157,7 +157,8 @@ For more details and troubleshooting with parameters please check:
157157
[[Feature-Request] Multiple Alert Profiles](https://github.com/filipnet/checkmk-telegram-notify/issues/3)
158158

159159
## CONTRIBUTION
160-
Thank you for the excellent contributions and additional information @ThomasKaiser, which I have integrated into the README.
160+
* Thank you for the excellent code optimization contributions and additional information @ThomasKaiser.
161+
* Best regards to @intelligent-bytes in Bangkok, Thailand and many thanks for adding emojies to the module.
161162

162163
## LICENSE
163164
checkmk-telegram-notify and all individual scripts are under the BSD 3-Clause license unless explicitly noted otherwise. Please refer to the LICENSE

check_mk_telegram-notify.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Push Notification with Emojis (using Telegram)
2+
# Push Notification (using Telegram)
33
#
44
# Script Name : check_mk_telegram-notify.sh
55
# Description : Send Check_MK notifications by Telegram
@@ -59,29 +59,30 @@ else
5959
fi
6060

6161
# Set an appropriate emoji for the current state
62+
# Feel free to change the emoji to your own taste. This is done by customizing the UTF8 code. Examples here: https://apps.timwhitlock.info/emoji/tables/unicode
6263
if [[ ${NOTIFY_WHAT} == "SERVICE" ]]; then
6364
STATE="${NOTIFY_SERVICESHORTSTATE}"
6465
else
6566
STATE="${NOTIFY_HOSTSHORTSTATE}"
6667
fi
6768
case "${STATE}" in
6869
OK|UP)
69-
EMOJI=""
70+
EMOJI=$'\xE2\x9C\x85' # white heavy check mark
7071
;;
7172
WARN)
72-
EMOJI=""
73+
EMOJI=$'\xE2\x9A\xA0' # warning sign
7374
;;
7475
CRIT|DOWN)
75-
EMOJI="🔥 "
76+
EMOJI=$'\xF0\x9F\x86\x98' # squared sos
7677
;;
7778
UNKN)
78-
EMOJI=""
79+
EMOJI=$'\xF0\x9F\x94\x84' # anticlockwise downwards and upwards open circle arrows
7980
;;
8081
esac
8182

8283
# Create a MESSAGE variable to send to your Telegram bot
8384
MESSAGE="${NOTIFY_HOSTNAME} (${NOTIFY_HOSTALIAS})%0A"
84-
MESSAGE+="${EMOJI}${NOTIFY_WHAT} ${NOTIFY_NOTIFICATIONTYPE}%0A%0A"
85+
MESSAGE+="${EMOJI} ${NOTIFY_WHAT} ${NOTIFY_NOTIFICATIONTYPE}%0A%0A"
8586
if [[ ${NOTIFY_WHAT} == "SERVICE" ]]; then
8687
MESSAGE+="${NOTIFY_SERVICEDESC}%0A"
8788
MESSAGE+="State changed from ${NOTIFY_PREVIOUSSERVICEHARDSHORTSTATE} to ${NOTIFY_SERVICESHORTSTATE}%0A"

0 commit comments

Comments
 (0)