Sensu
構成
- CentOS 7.3.1611 (minimal)
- Redis 3.2.3 (epel)
- RabbitMQ server 3.3.5 (epel)
- Sensu 0.26.5
- Uchiwa 0.22.0
インストール
Redis
yum -y install epel-release && yum -y install redis && systemctl start $_ && systemctl enable $_
RabbitMQ
yum -y install rabbitmq-server && systemctl start $_ && systemctl enable $_
rabbitmqctl add_vhost /sensu
rabbitmqctl add_user sensu sensu
rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"
管理画面
rabbitmq-plugins enable rabbitmq_management
systemctl restart rabbitmq-server
Sensu / Uchiwa
cat << "_EOF_" > /etc/yum.repos.d/sensu.repo
[sensu]
name=sensu
baseurl=http://sensu.global.ssl.fastly.net/yum/$basearch/
gpgcheck=0
enabled=1
_EOF_
yum -y install sensu uchiwa
プラグイン
yum install gcc-c++
sensu-install -P disk-checks,cpu-checks,io-checks,hardware,postfix
sensu-install -P snmp,http,mysql,redis,rabbitmq
sensu-plugins-http で gcc-c++ パッケージが必要。
設定
cp /etc/sensu/config.json{.example,}
sed -i '/"host"/ s/localhost/127.0.0.1/' /etc/sensu/config.json
sed -i.org 's/Site 1/Sensu Server/;s/api1.example.com/127.0.0.1/' /etc/sensu/uchiwa.json
sed -i '8,17d' /etc/sensu/uchiwa.json
localhost
の指定だとうまく動作しない。
起動と自動起動設定
systemctl start sensu-{client,server,api} uchiwa && systemctl enable $_