¿ù°£ Àα⠰Խù°

°Ô½Ã¹° 111°Ç
   
nagios + telegram
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2017-07-17 (¿ù) 15:42 Á¶È¸ : 224086
±ÛÁÖ¼Ò :
                             

# 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


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.