Changes between Version 1 and Version 2 of NSM2021/Agenda/AlertsIcinga2Slack
- Timestamp:
- May 30, 2021, 7:37:36 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
NSM2021/Agenda/AlertsIcinga2Slack
v1 v2 3 3 === Prerequisite === 4 4 5 * SLACK API W EbHook URL created.5 * SLACK API WebHook URL created. 6 6 If you haven't created these, please consult [wiki:NSM2021/Agenda/SlackGuide here] 7 7 * Notification Users are created in Icinga Director … … 53 53 == Create Custom Variables == 54 54 55 Above scripts uses two custom variables called tokencode and chat_id, these are Telegram User specific data and we have to define themon Iciga Director before applying it on Notifications.55 Above scripts uses a custom variable called slackAPI, this is a Slack channel specific data and we have to define it on Iciga Director before applying it on Notifications. 56 56 57 Go to Icinga Director --> `Data Field Categories`58 57 59 [[Image(DataCat1.png, 500px, nolink)]] 58 Go to Icinga Director --> `Define Data Fields` 60 59 61 Add a Data Category as below. 60 Create new Data Field as follows: 62 61 63 [[Image(DataCat2.png, 500px, nolink)]] 62 * Slack WebHook URL 64 63 65 Then go to Icinga Director --> `Define Data Fields` 64 [[Image(slackAPI.png, 500px, nolink)]] 66 65 67 Create two new Data Fields as follows:68 66 69 * Token Code 70 71 [[Image(TokenCode.png, 500px, nolink)]] 72 73 * Chat ID 74 75 [[Image(ChatId.png, 500px, nolink)]] 76 77 == Telegram Notification Templates == 67 == Slack Notification Templates == 78 68 79 69 Create following templates with the given data. 80 70 81 * TelegramHost Notification Template71 * Slack Host Notification Template 82 72 83 [[Image( THT.png, 500px, nolink)]]73 [[Image(SHT.png, 500px, nolink)]] 84 74 85 * Include custom field s we created earlier. Goto the Fields tab of the template and enter chat_id and tockencode as mandatory fields75 * Include custom field we created earlier. Goto the Fields tab of the template and enter `slackAPI` as amandatory field. 86 76 87 [[Image(Field_ chatId.png, 500px, nolink)]]77 [[Image(Field_slackAPI.png, 500px, nolink)]] 88 78 89 [[Image(Field_tokencode.png, 500px, nolink)]]90 79 91 * TelegramService Notification Template80 * Slack Service Notification Template 92 81 93 [[Image( TST.png, 500px, nolink)]]82 [[Image(SST.png, 500px, nolink)]] 94 83 95 * Goto the Fields tab of the template and enter ` chat_id` and `tockencode` as mandatory fields based on previous guidelines.84 * Goto the Fields tab of the template and enter `slackAPI` as mandatory fields based on previous guidelines. 96 85 97 == Create Notifications to Telegram==86 == Create Notifications to Slack == 98 87 99 88 In this setup, we shall create two notifications setups for Hosts and Services respectively. When assigning notifications we should select a user rather than a user group to avoid multiple duplicates of notifications. 100 89 101 * Telegram-Host-Notification90 * Slack-Host-Notification 102 91 103 [[Image( THS.png, 600px, nolink)]]92 [[Image(SHN.png, 600px, nolink)]] 104 93 105 * Telegram-Service-Notification94 * Slack-Service-Notification 106 95 107 [[Image( TSN.png, 600px, nolink)]]96 [[Image(SSN.png, 600px, nolink)]] 108 97 109 98