前回 [2013-07-17-1] から間が空いてしまいましたが、GrowthForecast をインストールしました。
インストールするだけなら、これだけで OK です。
% mkdir ~/growthforecast
% cd ~/growthforecast
% echo "requires 'GrowthForecast';" > cpanfile
% sudo apt-get build-dep rrdtool
% plenv exec carton install
起動方法はこんな感じ。http://example.com:5125 とかにアクセスすると確認出来ると思います。
% cd ~/growthforecast
% carton exec -- perl growthforecast.pl --data-dir . &
--data-dir
オプションを指定しないと ~/growthforecast/local/lib/perl5/auto/share/dist/GrowthForecast/data/
以下に sqlite 関連のファイルが作られます。~/growthforecast/local
は削除することもあるでしょうから、指定した方が良いと思います。
Chef のレシピはこれ。Install packages depending RRDTool
のあたりが汚いですが、仕方がないですかね。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
requires 'GrowthForecast'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
directory '/home/masutaka/growthforecast' do | |
owner 'masutaka' | |
group 'masutaka' | |
mode 0755 | |
action :create | |
end | |
cookbook_file '/home/masutaka/growthforecast/cpanfile' do | |
owner 'masutaka' | |
group 'masutaka' | |
mode 0644 | |
end | |
bash 'Install packages depending RRDTool' do | |
code <<-EOC | |
apt-get -y build-dep rrdtool | |
EOC | |
creates '/home/masutaka/growthforecast/local/bin/growthforecast.pl' | |
end | |
bash 'GrowthForcast install' do | |
user 'masutaka' | |
group 'masutaka' | |
code <<-EOC | |
export PATH=$HOME/.plenv/bin:$PATH | |
eval "$(plenv init -)" | |
cd $HOME/growthforecast | |
plenv exec carton install | |
EOC | |
creates '/home/masutaka/growthforecast/local/bin/growthforecast.pl' | |
end |
今回初めて知りました。。
https://t.co/SafIzljmwB の訂正: apt-get build-dep <package>って、<package>をbuildするのに必要なパッケージをインストールするだけで、<package>はインストールしないのか〜!
— マスタカ (@masutaka) August 14, 2013
次回は GrowthForecast と fluentd の連携を試してみます。
参考にしたサイト
GrowthForecastをインストールする|Act as Professional - hiroki.jp