You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[PAGER ADDRESS CHAT-ID INSTEAD OF TELEGRAM GROUP-ID](#pager-address-chat-id-instead-of-telegram-group-id)
16
+
-[TROUBLESHOOTING](#troubleshooting)
17
+
-[CONTRIBUTION](#contribution)
15
18
-[LICENSE](#license)
16
19
17
20
<!-- /TOC -->
18
21
19
-
## LATEST UPDATE
20
-
The Telegram token (API key) and the chat/group ID are no longer stored in a separate XML file and instead are passed directly by Check_MK as parameters. This offers the possibility to create several notification groups and to use the script universally.
21
-
22
22
## EXAMPLE
23
23
Notifications are usually sent via a Telegram group. Here is an example of how a Telegram notification is structured.
24
24
@@ -87,11 +87,46 @@ omd stop
87
87
omd start
88
88
```
89
89
90
+
## PRIVACY ANONYMIZATION / MASQUERADING
91
+
The current version of this script allows you to optionally enable IP anonymization. This gives you the option to comply with your own privacy policy or the recommendations of data protection authorities in certain countries if they prohibit the transmission of the full IP address. This masks IPv4 and IPv6 IP addresses before they are transmitted in a message to the Telegram service.
92
+
93
+
The activation of the privacy settings is realized directly in the Notification Rules in Check_MK by NOTIFY_PARAMETER_3, here the value "privacy" has to be entered:
There are certainly different requirements for privacy and masquerading of IP addresses. In the script, the IPv4 IP address is split into the 4 octets, the IPv6 address into the 8 columns. This allows to control __very individually__ which parts of the addresses are sent via Telegram and which are not. Both, placeholders and manipulations are basically possible here.
98
+
99
+
The adjustment is done exclusively in the following two lines of the script.
100
+
```
101
+
# Adjust the output to your privacy needs here (Details in the readme.md)
## PAGER ADDRESS (CHAT-ID) INSTEAD OF TELEGRAM GROUP-ID
111
+
A different approach is to use the 'Pager address' field in Check_MK's user properties. This gets exported as $NOTIFY_CONTACTPAGER variable to the script and as such all that's needed is:
112
+
```
113
+
if [ -z ${NOTIFY_CONTACTPAGER} ]; then
114
+
echo "No pager address provided to be used as Chat-ID. Exiting" >&2
115
+
exit 2
116
+
else
117
+
CHAT_ID="${NOTIFY_CONTACTPAGER}"
118
+
fi
119
+
```
120
+
121
+
## TROUBLESHOOTING
90
122
For more details and troubleshooting with parameters please check:
91
123
92
124
[Check_MK Manual > Notifications > Chapter: 11.3. A simple example](https://docs.checkmk.com/latest/en/notifications.html#H1:Real)
0 commit comments