Skip to content

Commit

Permalink
Check_MK version 2.0.0 documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
filipnet committed May 17, 2021
1 parent 22b545a commit a162529
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,31 @@
<img src="images/logo.png" alt="Telegram notification example" width="300" align="right" hspace="30" vspace="20"/>
Telegram has long been one of my real-time communication media. It is obvious to output monitoring messages for server and network components as alarm messages. There are several scripts for this on the internet, but most of them are written in Python, many of them have problems with Python3 and its libraries. Instead of spending hours and hours with Python, I decided to use a scripting language I know and write a Linux Bash script for it.

The following Script is for Check_MK, I have used it exclusively with the RAW version 1.6.0_p18.

<!-- TOC -->

- [Check_MK Telegram notification](#check_mk-telegram-notification)
- [COMPATIBILITY](#compatibility)
- [EXAMPLE](#example)
- [REQUIREMENTS](#requirements)
- [INSTALLATION](#installation)
- [CHECK_MK CONFIGURATION](#check_mk-configuration)
- [PRIVACY ANONYMIZATION / MASQUERADING](#privacy-anonymization--masquerading)
- [CHECK_MK VERSION 2.0.0 AND ABOVE](#check_mk-version-200-and-above)
- [CHECK_MK VERSION 1.6.0](#check_mk-version-160)
- [ACTIVATE CHANGES](#activate-changes)
- [PRIVACY ANONYMIZATION / MASQUERADING](#privacy-anonymization--masquerading)
- [PAGER ADDRESS CHAT-ID INSTEAD OF TELEGRAM GROUP-ID](#pager-address-chat-id-instead-of-telegram-group-id)
- [TROUBLESHOOTING](#troubleshooting)
- [CONTRIBUTION](#contribution)
- [LICENSE](#license)

<!-- /TOC -->

## COMPATIBILITY
- Check_MK RAW version 1.6.0_p18
- Check_MK RAW version 2.0.0_p4
- Should also work with other versions of Check_MK

## EXAMPLE
Notifications are usually sent via a Telegram group. Here is an example of how a Telegram notification is structured.

Expand Down Expand Up @@ -56,6 +64,24 @@ chmod +x check_mk_telegram-notify.sh
```

## CHECK_MK CONFIGURATION
### CHECK_MK VERSION 2.0.0 AND ABOVE
Now you can create your own alarm rules in Check_MK.

```Setup → Events → Notifications```

First create a clone of your existing mail notification rule

<img src="images/global_notification_rules_create_clone_v2.png" alt="Create clone" width="600"/>

* Change the description (e.g. Notify all contacts of a host/service via Telegram)
* The notification method is "Push Notification (by Telegram)"
* Select option "Call with the following parameters:"
* As the first parameter we set the Telegram token ID (without bot-prefix)
* The second parameter is the Telegram Chat-ID or Telegram Group-ID

<img src="images/create_new_notification_rule_for_telegram_v2.png" alt="Adjust settings" width="600"/>

### CHECK_MK VERSION 1.6.0
Now you can create your own alarm rules in Check_MK.

```WATO → Notifications → New Rule → Notification Method → Push Notification (using Telegram)```
Expand All @@ -76,18 +102,23 @@ If everything was ok, you will see your new Notification Rule afterwards

<img src="images/notification_configuration_change.png" alt="Final result" width="600"/>

### ACTIVATE CHANGES
To activate it you have to press "1 Change" and "Activate affected"

<img src="images/activate_affected.png" alt="Activate changes and commit" width="100"/>

Since Check_MK 2.0.0 it is calles "Active on selected sites"

<img src="images/activate_on_selected_sites.png" alt="Active on selected sites" width="150"/>

To ensure that the parameters are also transferred in the event of an alert, it is strongly recommended that the Check_MK instance is restarted.
```
su - mysite
omd stop
omd start
```

## PRIVACY ANONYMIZATION / MASQUERADING
### PRIVACY ANONYMIZATION / MASQUERADING
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.

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:
Expand Down
Binary file added images/activate_on_selected_sites.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit a162529

Please sign in to comment.