Sensuã使ã£ã¦ã¯ã©ã¦ãç°å¢ã®ç£è¦ãå¹çããè¡ãã
AWSãªã©æ§ã ãªç°å¢ã§ãµã¼ãã管çãã¦ããã¨ããã¹ã¦åä¸ã®ç£è¦ãã¼ã«ã使ãã®ããªããªãé£ãããªã£ã¦ãã¾ãããããªãã¨ããããç§ãå®æçã«ãããããªç£è¦ãã¼ã«ã試ãã¦ãã¾ãã
http://nanapi.co.jp/blog/2013/09/11/monitor_nanapi_servers/
nagiosã¨ã¯ã©ã¦ãã®ç¸æ§ãæªãï¼
ç£è¦ããã«ã¯æ§ã ãªãã¼ã«ãããã¾ããããã®ä¸ã§ãç¹ã«æåãªãã¼ã«ã¯nagiosã§ããããå¤ããã使ããã¦ãããã¼ã«ã§ããã©ã°ã¤ã³ãæ°å¤ãããæ§ã ãªç£è¦ãè¡ããã¨ãã§ãã¾ãã
ã¯ã©ã¤ã¢ã³ãå´ã«nrpeãã¤ã³ã¹ãã¼ã«ãããã¨ã§ãåãã¹ãã®è©³ç´°ã®ç¶æ ã¾ã§ç£è¦ãããã¨ãã§ãã¾ããããã¾ãæ´»ç¨ããã°ããªãç´°ããç£è¦ã¾ã§ã§ãã¾ãã
ããããAWSã®ãããªã¯ã©ã¦ãç°å¢ã§ä½¿ãã«ã¯é常ã«ä½¿ãã¥ããã§ããã¨ããã®ããnagiosã¯ãµã¼ãå´ã«ã©ã®ãã¹ããç£è¦ããã®ãã¨ããæ å ±ãæããªããã°ããã¾ããããã®ãããEC2ã®ããã«åèµ·åãããã¨ã«ãããã¹ãåãå¤ãã£ãããã¤ã³ã¹ã¿ã³ã¹ã追å ãããããã¨ããå¤æ´ãå¿ è¦ã§ãã
ããã«ãnagiosã®è¨å®ãã¡ã¤ã«ã£ã¦ãããé¢åãããªãã§ããï¼ããé·ãæéããã£ã¦ãã¾ãããããã£ã¡ã ãææ³ã¨ã©ã¼åºãã¾ããè¨å®ããã¡ããã¡ãã«ãªãã¾ãããè¨è¿°æ¹æ³ãç¬ç¹ã§ãããã¾ã好ãã«ãªãã¾ããã
è¨å®ãã¡ã¤ã«ããJSONã§è¨è¿°ããã®ã§æ¯è¼çããããããã§ãã
Sensuã®ã¤ã³ã¹ãã¼ã«
ã¾ãã©ãã ãSensuãã¤ã±ã¦ããã£ã¦è©±ã¯å ¬å¼ã®ãã¼ã¸ã«ããããããã¦ããã®ã§èªãã§ã¿ã¦ãã ããã以ä¸ã®ã¹ã©ã¤ããããããããã§ãã
ã¨ããããã§ãã¤ã³ã¹ãã¼ã«ãã¾ããSensuèªä½ã®ã¤ã³ã¹ãã¼ã«ã¯Chefãçµç±ãããã¨ãæ¨å¥¨ããã¦ããã®ã§ããã¡ãã®å ¬å¼ã§æä¾ããã¦ããcookbookã使ãã¨è¯ãã¨æãã¾ãã
GitHub - sensu/sensu-chef: Sensu Chef cookbook.
ãªãSSLãããã§è¥å¹²ãããã®ã§ãREADMEãã¡ããã¨èªãã§ãã ãããã
Sensuã®ã»ããã¢ãã
Sensuã¯nagiosã¨éããSensuServerå´ã§ã¯ç£è¦ãããã¹ãã®ãªã¹ããä¿æãã¦ãã¾ãããç£è¦ããå´ã§Clientãç«ã¡ä¸ãããã¨ã§ãServerå´ã«èªåã®åå¨ãéç¥ãã¦èªåçã«ç£è¦å¯¾è±¡ã«è¿½å ããã¾ããnewrelicã使ã£ããã¨ãã人ã¯ããããã¤ã¡ã¼ã¸ãã¦ããããã°ããããããã¨æãã¾ãã
ãµã¼ãå´ã§ã¯ä»¥ä¸ã®è¨å®ãå ¥ãã¦ããã¾ãã
/etc/sensu/config.json
{ "rabbitmq": { "host": "localhost", "port": 5672, "vhost": "/sensu", "user": "sensu", "password": "password" }, "redis": { "host": "localhost", "port": 6379 }, "api": { "host": "localhost", "bind": "0.0.0.0", "port": 4567 }, "dashboard": { "bind": "0.0.0.0", "port": 8080, "user": "admin", "password": "secret" } }
/etc/sensu/conf.d/check-cron.json
{ "checks": { "cron_check": { "handlers": ["default"], "command": "/etc/sensu/plugins/check-procs.rb -p cron -C 1 ", "interval": 60, "subscribers": ["all"] } } }
Clientå´ã§ã¯ä»¥ä¸ã®ããã«ãã¦è¨å®ãå ¥ãã¾ãã
/etc/sensu/config.json
{ "rabbitmq": { "host": "192.168.1.1", "port": 5672, "vhost": "/sensu", "user": "sensu", "password": "password" } }
/etc/sensu/conf.d/client.json
{ "client": { "name": "servername", "address": "192.168.1.10", "subscriptions": [ "all" ] } }
ãã®ããã«ãã¦è¨å®ãã¾ããç£è¦ããé ç®èªä½ã¯ãServerå´ã§è¨å®ãã¦Clientå´ã¯ã©ã®ç£è¦ã°ã«ã¼ãã«åå ããã®ããããããè¨å®ããã¢ã¼ããã¯ãã£ã«ãªã£ã¦ãã¾ãããã®ãããç£è¦ããé ç®ã®ãã¹ã¿ã¯Serverå´ã§ç®¡çã§ããã®ã§ç£è¦é ç®ã®å¤æ´ãªã©ãç°¡åã«è¡ããã¨ãã§ãã¾ãã
ãã ããããããã®ç£è¦ã«ã¤ããã³ãã³ãã¯åclientå´ã«ã¤ã³ã¹ãã¼ã«ããå¿ è¦ãããã®ã§æ³¨æãã¦ãã ãããç£è¦ã®ã³ãã³ãã¯ãã®ãªãã¸ããªã§æ§ã ãªãã®ãéçºããã¦ãã¾ãã
GitHub - sensu/sensu-community-plugins: Sensu community plugins for checks, handlers, & mutators.
ryuzeeããã®ããã°ã§ããã詳ãã説æããã¦ãã¾ããï¼
SensuのCommunity Pluginの一覧(日本語版) | Ryuzee.com
æ¨æºã§APIãæä¾ããã¦ãã
Sensuã®è¯ãæã¯ãAPIã§ãã¹ã¦ã®æä½ãã§ãããã¨ã§ããnagiosãªã©ã¯Webãã確èªãããã¨ãåæã¨ããã¦ãããããä»ã®ã·ã¹ãã ãscriptãªã©ã¨ã®é£æºãé¢åãªãã¨ã§ãããããã¥ã¡ã³ãã¯ãã¡ãã«ããã¦ããã¾ãã
http://sensuapp.org/docs/0.11/api
ãã®ãããSensuãåºæ¬ããã±ã¼ã¸ã«Webã®ããã³ãã¨ã³ããç¨æããã¦ãã¾ããããã¾ã§APIãæ´»ç¨ãããã¼ã«ãªã®ã§èªåãªãã«éçºãããã¨ãã§ãã¾ããã¾ããSensuAPIãã°ãã¼ãã«å ¬éãã¦ãèªè¨¼ãããããã¨ãã§ããã®ã§æ§ã ãªã¯ã©ã¤ã¢ã³ããéçºãããã¨ãã§ãã¾ãã
ãããªãã¨ããããiOSéçºã®åå¼·ãå ¼ãã¦ç§ãSensuClientã®iOSã¢ããªãä½ã£ã¦ãã¾ãããã¶ã¤ã³ã¯ãªãã¨ãããªãã¨ããºã¤ã§ãããããç¨åº¦åãã¦ããã®ã§ãã¨ã¯ãã°æ½°ãã¦ç³è«ã¨ãããã¨ãã§ããï¼éãããªã»ã»ã»ï¼
nanapiã§ãé 次å°å ¥
ã¨ããããã§ããªãããããããªé°å²æ°ãæãã¦ããã®ã§ãããã¯ã·ã§ã³ç°å¢ã«ãé 次å°å ¥ãã¦ããããã¨æãã¾ããï¼æã«ãªãªã¼ã¹äºå®ã®æ°ãµã¼ãã¹ã§æ´»ç¨äºå®ã§ãã
ã¾ããããã¯ã·ã§ã³ç°å¢ã§åä½ããããããããªåé¡ãçºçããã¨æãã®ã§ãããç¨åº¦ç¥è¦ããã¾ã£ãã¨ããã§ããã°ã«ã§ãã¾ã¨ãã¦ã¿ããã¨æã£ã¦ãã¾ãã