# cat contacts.cfg
......................
define contact{
contact_name telegram
alias neubd
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-service-by-telegram
host_notification_commands notify-host-by-telegram
}
......................
define contactgroup{
contactgroup_name admins
alias Nagios Administrators
members telegram
}
# cat
......................
# commands to send host/service notifications
define command {
command_name notify-host-by-telegram
command_line /usr/local/bin/nagios_telegram.py --token 3021XXXXX:AAXXXXk2YZCCXXXXX22E34g_603CrPot-M8 --object_type host --contact "$USER2$" --notificationtype "$NOTIFICATIONTYPE$" --hoststate "$HOSTSTATE$" --hostname "$HOSTNAME$" --hostaddress "$HOSTADDRESS$" --output "$HOSTOUTPUT$"
}
define command {
command_name notify-service-by-telegram
command_line /usr/local/bin/nagios_telegram.py --token 3021XXXXX:AAXXXXk2YZCCXXXXX22E34g_603CrPot-M8 --object_type service --contact "$USER2$" --notificationtype "$NOTIFICATIONTYPE$" --servicestate "$SERVICESTATE$" --hostname "$HOSTNAME$" --servicedesc "$SERVICEDESC$" --output "$SERVICEOUTPUT$"
}
example)
max_check_attempts 2 # 문제시 재시도 체크 횟수 / 2회
check_interval 1 # 체크주기 / 1분
retry_interval 1 # 문제시 재시도 주기
check_period 24x7 # 24시간 7일 -> 365일 내내 체크
check_freshness 1 #
contact_groups admins
notification_interval 60 # 알람전송 주기 / 60분
notification_period 24x7 # 24시간 7일 -> 365일 모니터링 / 알람 허용시간 조정가능
notifications_enabled 1 # 알람허용 유무 / 1은 허용 -
register 1 # 템플릿이면 0