Documentation used : url Monitoring-Notification-Via-Telegram
OS : CentOS Linux 8
Icinga2 version : 2.12.1-1
Installation source / method :
dnf install -y https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm
dnf install icinga2
This is a testbed machine, and I am only monitoring one host (my laptop) at the moment, I am a first time Icinga user and want to check all functionalities required in my case on this testbed machine before replicating anything onto production.
At the moment, the monitoring part works well, the email notifications are getting triggered, I am receiving them on my Gmail. What is not working is the ‘Telegram’ notification, I followed the instructions given in the link above. I verified the Chat and Token ID from the terminal and those test notification are coming in, but through the application, it’s not getting triggered.
I also tried the python script ‘icinga2telegram’ option by following the link url Icinga2Telegram but even that did not work. Email notification continue to come in both cases, but not the Telegram. I’ve now reverted back to how it was earlier.
@dnsmichi Attaching configuration of my basic setup.
…/conf.d/users.conf
object User "teleadmin" {
import "generic-user"
display_name = "Telegram Admin"
enable_notifications = true
vars.telegram_chat_id = "-00000000000000"
}
…/conf.d/templates.conf
template Notification "telegram-host-notification" {
command = "telegram-host-notification"
period = "24x7"
}
…/conf.d/notifications.conf
apply Notification "telegram-notify" to Host {
import "telegram-host-notification"
assign where host.address
users = host.vars.notification.telegram.users
}
…/conf.d/hosts.conf
object Host "CA" {
address = "192.168.1.10"
display_name = "CALLISTO"
check_command = "ssh"
vars.opsys = "CentOS"
vars.notification["mail"] = {
groups = [ "icingaadmins" ]
users = [ "icingaadmin" ]
}
vars.notification["telegram"] = {
users = [ "teleadmin" ]
}
}
…/icinga2/constants.conf
const TelegramBotToken = "${11111111111111111111111111111AAAAAAAAAAAAAAAAAAAA}$"
Thanks, Best