# 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