Skip to content

Instantly share code, notes, and snippets.

@nekoya
Last active October 31, 2015 16:44
Show Gist options
  • Select an option

  • Save nekoya/3737254 to your computer and use it in GitHub Desktop.

Select an option

Save nekoya/3737254 to your computer and use it in GitHub Desktop.
wiki/cloudforecast

cloudforecast

setup

source

  • git://github.com/kazeburo/cloudforecast.git

system Perl + local::lib + cpanmで入れる

  • local::libを--bootstrap=/path/to/cloudforecast/extlibで入れる
perl -I/path/to/cloudforecast/extlib/lib/perl5 -Mlocal::lib=/path/to/cloudforecast/extlib
  • cpanmで依存ライブラリを入れる。結構かかる
curl -L http://cpanmin.us/ | perl - App::cpanminus
cd /path/to/cloudforecast
cpanm Module::Install
perl Makefile.PL
cpanm --installdeps .
sudo yum install rrdtool-perl net-snmp-perl
  • Gearmanをyumで入れているとコケるので注意

  • Gearman1.1が必要だが、EPELは1.09と古い

  • cloudforecast.yamlで指定するdata_dirが存在しないと死ぬ

巡回デーモンとWebサーバに分かれているので、それぞれ起動する。本番運用する時はdaemontoolsを使う。

# 巡回デーモン。5分ごとにリソースデータの取得を行います
$ ./cloudforecast_radar -c cloudforecast.yaml -l server_list.yaml
# Webサーバ
$ ./cloudforecast_web -p 5000 -c cloudforecast.yaml -l server_list.yaml

perlbrew環境で入れる(未完)

RRDTool

http://www.mrtg.org/rrdtool/download.en.html

  • configureでコケる
sudo yum install cario-devel.x86_64 pango-devel.x86_64
configure --prefix=/opt/rrdtool && make && make install

Perlライブラリをperlbrew環境の下に入れる

SNMP

sudo yum install net-snmp

setup

cpanm --installdeps .
sudo yum install net-snmp net-snmp-devel.x86_64
cpanm SNMP

TIPS

https監視

sudo yum install openssl-devel.x86_64
cpanm Crypt::SSLeay
  • sudo yum install perl-Net-SSLeayも必要かも

httpsで動かす

SSLはnginxに任せて、proxy_passでcf_webにアクセスさせる。cf_webは以下の起動オプションを指定する。

--front-proxy='127.0.0.1'

nginxの設定には以下を入れておく。

proxy_set_header X-Forwarded-HTTPS on;

Apacheの場合は、

RequestHeader set X-Forwarded-HTTPS on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment