GrowthForecast - Lightning fast Graphing / Visualization
ç 究室ã§åãµã¼ãã¨é¨å±ã®æ¸©åº¦ãã°ã©ãåãã¦ï¼å¤ãç°å¸¸ãªãã¡ã¼ã«ã§éç¥ããã¿ãããªã¿ã¹ã¯ãéã£ã¦ããï¼
ãã¨ãã¨åãµã¼ãã®çµ±è¨å¤ãMuninã§ã°ã©ãåãã¦ããããã©ï¼VMware VSphereãå
¥ã£ã¦ãç©çãµã¼ãã®æ¸©åº¦ã¨ãããããªãã©ã°ã¤ã³ãªããï¼èªåã§æ¸ããªãã¨ãããªãæãã«ãªã£ããï¼Muninã®è¨å®ã¨ã調ã¹ãã®ã ããæãã«ãªã£ã¦ããããï¼æè¿ã³ã¼ãçºãã¦ãGrowthForecastã使ã£ã¦ã°ã©ãåãããã¨æã£ãï¼
lm-sensorsãVsphereã®APIå©ãã¦æ¸©åº¦ãåå¾ãï¼GrowthForecastã®APIã«POSTããæãã®ã¹ã¯ãªãããä½æãã¦ï¼åãã¼ãããcronã§å®æå®è¡ããã°ã§ãããï¼
OSã¯Ubuntu 12.04ï¼ curlãã¤ã³ã¹ãã¼ã«ãã¦ããï¼
å®è¡ã¦ã¼ã¶ä½æ
ã¾ãã¯ï¼æä½éã®å®è¡æ¨©éã ãããããå®è¡ã¦ã¼ã¶ growthforecastãä½æããï¼
$ sudo groupadd growthforecast $ sudo useradd -g growthforecast -d /home/growthforecast -s /sbin/nologin -m growthforecast
GrowthForecastã¤ã³ã¹ãã¼ã«
$ sudo apt-get build-dep rrdtool $ sudo -u growthforecast curl -kL http://install.perlbrew.pl | sudo -u growthforecast bash $ sudo -u growthforecast /home/growthforecast/perl5/perlbrew/bin/perlbrew --notest install perl-5.14.3 $ sudo -u growthforecast /home/growthforecast/perl5/perlbrew/bin/perlbrew switch perl-5.14.3 $ curl -L http://cpanmin.us/ | perl - App::cpanminus $ cpanm -n GrowthForecast $ exit
daemontoolsã§ç£è¦
Ggrowthforecast.plã¯Webãµã¼ãã¨Workerãåããã»ã¹ã¨ãã¦èµ·åãããï¼ãã®ã¸ãã¯è¯ãæãã«ç£è¦ãã¦ããããããã®ã§ï¼è¦ªããã»ã¹ã ãdaemontoolsã§ç£è¦ããï¼ Proclet という supervisor モジュール書いてリリースした - blog.nomadscafe.jp
daemontoolsã§èµ·åããã¹ã¯ãªãããä½æ
$ cd /home/growthforecast $ sudo -u growthforecast curl https://gist.github.com/y-uuki/4957550#file-growthforecast-run-sh > run.sh $ sudo -u growthforecast curl https://gist.github.com/y-uuki/4957550#file-growthforecast-log-run-sh > log.run.sh $ sudo -u growthforecast chmod +x run.sh log.run.sh
ä»åã¯ä»¥ä¸ã®ãããªã¹ã¯ãªãããä½æããï¼
$ sudo mkdir -p /etc/service/growthforecast $ sudo chown growthforecast:growthforecast /etc/service/growthforecast $ sudo -u growthforecast ln -s /home/growthforecast/run.sh /etc/service/growthforecast/run $ sudo -u growthforecast mkdir -p /etc/service/growthforecast/log/main $ sudo -u growthforecast ln -s /home/growthforecast/log.run.sh /etc/service/growthforecast/log/run $ sudo apt-get install daemontools daemontools-run svtools $ sudo reboot $ sudo svc -u /etc/service/growthforecast
ãã¼ã¢ã³ã®èµ·åã»åæ¢
$ sudo svc -u /etc/service/growthforecast # UP $ sudo svc -d /etc/service/growthforecast # DOWN
logãã¿ã
$ tail -F /etc/service/growthforecast/log/main/current
log/main/currentãä½æããã¦ããªããã¤log/superviseãåå¨ããªãå ´åï¼svscanãlogãã£ã¬ã¯ããªãæ¤åºãã¦ããªãã®ã§åèµ·åããã°ããï¼
ææ³
GrowthForecastã¯CPANã¢ã¸ã¥ã¼ã«ã«ãªã£ã¦ããã®ã§ï¼å°å
¥ãç°¡åï¼
daemontoolsãã¾ã¨ãã«ä½¿ã£ããã¨ãªãã£ããã©ï¼ä¾¿å©ããï¼
温度åå¾ãã¦GrowthForecastã«æããã¹ã¯ãªããã¯ã¾ãä»åº¦ï¼