fluent-plugin-notifier 㨠fluent-plugin-ikachan ã®è©±
ãªãªã¼ã¹ãã¦ã¯ãããã®ã®æå ã§ã¡ããã¨ä½¿ã£ã¦ããªãã£ããã©ã°ã¤ã³ãµãã¤ããããããã¡ããã¨ä½¿ãã¯ãããããã®ã¤ãã§(ï¼)ã«ã¡ããã¨ãã¹ããæ¸ãããREADMEãæ¸ãããããã®ã§ããã£ããã ããããã«ãæ¸ãã¦ããã
fluent-plugin-notifier
Fluentdã§æµéããã¡ãã»ã¼ã¸ãç¸æã«æ°å¤ç¯å²ãæå忤æ»(æ£è¦è¡¨ç¾)ã«ããç°å¸¸ãæ¤åºãã¢ã©ã¼ã(ã示ãã¡ãã»ã¼ã¸)ãåºãã¦ããããã¨ãããã©ã°ã¤ã³ã
tagomoris/fluent-plugin-notifier · GitHub
fluent-plugin-notifier | RubyGems.org | your community gem host
使ãããã¯ãã¶ãä¾ãè¦ãã°ãããâ¦â¦ããããªãããªã¼ããããªã
<match apache.log.**> type notifier <def> pattern apache_duration check numeric_upward warn_threshold 800000 crit_threshold 1000000 target_keys duration </def> <def> pattern status_500 check string_find warn_regexp 5\d\d crit_regexp 500 target_key_pattern ^status.*$ exclude_key_pattern ^status_ignore_.*$ # key name not to notify about... </def> </match>
'numeric_upward' ã¯é¾å¤(warn/critããããã«ã¤ãã¦æå®ãã)ãè¶
ãããã¢ã©ã¼ãã¡ãã»ã¼ã¸ãåºãã'numeric_downward'ã¯ãã®éã'string_find' ã¯æ£è¦è¡¨ç¾ã«ããããããæ¤æ»ãã¦ã¢ã©ã¼ããåºããæ¤æ»ã®å®ç¾©ã¯ä»»æåæ°æ¸ããã®ã§ match ç¯ã§ãã°ã£ã¨å¤ãã®ã¡ãã»ã¼ã¸ã対象ã«ãã¦ãã㦠def å
ã§ã® target_keys *1ã§ç¸æãçµããã¨ããããã«ãã¦ãããã¨æãã
ä¸ã®ä¾ã«ã¯åºãã¦ãªããã©ãé£ç¶ããåãã¢ã©ã¼ãã¡ãã»ã¼ã¸*2ã¯ä»»æã®ééã»åæ°ã§æå¶ããæ¹æ³ãæã£ã¦ãã¦ãããã©ã«ãã¯ä»¥ä¸ã®ããã«ãªã£ã¦ããã
- 1忝ã«5åã¾ã§éåº
- 5忝ã«5åã¾ã§éåº
- 以å¾ã¯30忝
ãã®éé(intervals)ã¨åæ°(repetitions)ã¯å ¨ä½ã§ã def æ¯ã§ãæå®ã§ããã®ã§ãç´°ããæå®ããã人ã«ã䏿ºã¯ãã¾ããªãããããªãããªã¼ããã£ãããã²æãã¦ã»ããã
fluent-plugin-ikachan
å
¨ä¸çã®Webãµã¼ãã¹éçºãä¾åãã¦ããã¨ããåã®IRCã¯ãã¡ããã¿ããªä½¿ã£ã¦ããã¨æãããIRCã®ä»»æã®ãã£ã³ãã«ã«ãã¡ãã¡ã®ã·ã¹ãã ããçºè¨ããã¹ãããã®ã¯æå¤ã«é¢åã§ããã®ããã®ã¢ã¸ã¥ã¼ã«ã¿ãããªã®ã¯åè¨èªã«ãããã ãã©ãããããã¡ãã¡çµã¿è¾¼ãã§ã¾ããã®ã¯ã§ããã°é¿ãããã
ãã®ããã«å½ç¶æã人éã®ããã«Yappoãããæ¸ãã ikachan ã¨ãããã¼ã«ããããè¦ã¯HTTPã§ç°¡åã«çºè¨ããã¹ãã§ãã IRC Proxy Server ã§ãããä»ãCPANã«ãããã¾ãã
ikachan - IRC message delivery by HTTP - metacpan.org
ã§ fluent-plugin-notifier ã§ã¢ã©ã¼ãã¡ãã»ã¼ã¸ãçæãããã©ãã«æãããã¨ããã¨å½ç¶IRCã«æãããã®ã§ ikachan çµç±ã«ãªãããã§ããããã®ãããªãã©ã°ã¤ã³ãä½ãã¾ãããâ¦â¦ã ãã¶åã«ã
tagomoris/fluent-plugin-ikachan · GitHub
fluent-plugin-ikachan | RubyGems.org | your community gem host
ikachanã®ãµã¼ãã対象ãã£ã³ãã«ãåºåãããã£ã¼ã«ãåã®ãªã¹ããããã³ã©ããã©ã¼ããããããã以ä¸ã®ããã«ä¸ãã¦ããã°ãç®çã®ãã£ã³ãã«ã« notice ã§ãã¹ããã¦ããã¾ãã
<match message.*> type ikachan host ikachan.local port 4979 channel watching out_keys target_host,num_value,message message %s(%s): %s </match>
ãã®ããã«ãã¦ããã° {'target_host' => 'hoge.local', 'num_value' => 100, 'message' => 'fluentd message\' message...'} ã¨ããã¡ãã»ã¼ã¸ãåãåã£ãã¨ãã以ä¸ã®ããã«IRCã«åºåãããããã§ããã
11:48 ikachan: hoge.local(100): fluentd message's message...
便å©ï¼
çµåãã¦å®ç¾ããFluentdã§ã®ç£è¦ã·ã¹ãã
ãã¨ãã°ä»¥ä¸ã®ããã«ãã¾ãã
- fluent-plugin-datacounter ã§HTTPã¹ãã¼ã¿ã¹ 5xx ã®æ°ããã³å
¨ãªã¯ã¨ã¹ãä¸ã®ãã¼ã»ã³ãã¼ã¸ãã«ã¦ã³ã
- å¾è¿°ããå¦çã®ä»ã« fluent-plugin-growthforecast ã§ã°ã©ãã«ãåºåãã¦ãã
- fluent-plugin-notifier ã§ 5xx_percentage ã®æ°å¤ãæ¤æ»ã10以ä¸ã§warnã30以ä¸ã§critã¨ãã
- notifier ã®åºåã fluent-plugin-ikachan ã§åãIRCã«ãã¹ã
ããããã ãã§ãããæãã«é »åº¦èª¿æ´ãè¡ããã¤ã¤ã5xxã¹ãã¼ã¿ã¹ã®éãè·³ãä¸ãã£ãå ´åã«ä»¥ä¸ã®ãããªã¡ãã»ã¼ã¸ãIRCã«ãã¹ããããããã§ããã
11:48 ikachan: HTTP Status warn [2012-07-20 11:48:04 +0900] serviceX_5xx_percentage: 10.0 (threshold 10.0) http://gf.devops.local/view_graph/accesslog/httpstatus/serviceX_5xx_percentage
æã ã¯IRCã«ãã¹ãããã¦ããGrowthForecastã®URLãã½ã¡ã£ã¨ã¯ãªãã¯ããã ãã§ãæç³»åã§ã®5xxã¹ãã¼ã¿ã¹ã³ã¼ãã®å²åã®æ¨ç§»ã確èªãããããå³åº§ã«å¯¾å¦ãã¹ããªã®ããã¢ããªã±ã¼ã·ã§ã³æ å½è ãã¤ã¤ãã¦ã¿ãã¹ããªã®ããã¨ããããæ¾ã£ã¦ããã¦ãããã®ãªã®ãããããã£ããã¨ãèãããã¨ãã§ããããã«ãªãã¨ããããã§ããï¼
ã¡ãªã¿ã«ä¸è¨ã¡ãã»ã¼ã¸ã¯ä»¥ä¸ã®ãã㪠fluent-plugin-ikachan ã®è¨å®ã§åºãã¦ã¾ããfluent-plugin-notifier ã¯ã¤ãã³ããæ¤åºããæ¥æã message_time ã¨ãããã£ã¼ã«ãã«å¯èªæååã§å
¥ããããããããåºåãã¦ããã°IRCã«åºã¦ããã¨ããããã§ãããæ¤åºé¾å¤ã threshold ã¨ãããã£ã¼ã«ãã«å
¥ã£ã¦ããããããã¡ãã¡è¨å®ã確èªããå¿
è¦ã¯ããã¾ããã
GrowthForecastã®ã°ã©ãURL㯠fluent-plugin-growthforecast ã®è¨å®ã¨åããã¦ããã°ããã§ãããã
<match notification.*> type ikachan host ikachan.devops.local channel foobar out_keys level,message_time,target_key,value,threshold,target_key message HTTP Status %s [%s] %s: %s (threshold %s) http://gf.devops.local/view_graph/accesslog/httpstatus/%s </match>
ã©ããããï¼ ã¹ããï¼ æ¹ãã¦è¦ã¦ã¿ãã¨ã½ãã½ãç´°ããã¨ã©ã¼çãè·³ãä¸ãã£ã¦ããµã¼ãã¹ããããã§ããï¼
â¦â¦ã¨æã£ããã ãã©ããªã¯ã¨ã¹ãæ°ã®å°ãªããµã¼ãã¹ã ã¨ç¹ã«å¤éã«Googlebotãªã©ã®è¥²æ¥ã«ãã4xxãè·³ãä¸ãã£ã¦æ¤åºãã¦ãã¾ããªã©ãã¡ãã£ã¨å¾®å¦ãªç¹ãè¦ãã¦ãªããã¨ããªãã§ããã©ãããã£ããªã¼ã