Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- echo '[sensu]
- name=sensu
- baseurl=http://repositories.sensuapp.org/yum/$basearch/
- gpgcheck=0
- enabled=1' | sudo tee /etc/yum.repos.d/sensu.repo
- # Raises max number of open files in OS for rabbitmq
- echo -e "*\t\tsoft\tnofile\t\t65536" >> /etc/security/limits.conf
- echo -e "*\t\thard\tnofile\t\t65536" >> /etc/security/limits.conf
- rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
- wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
- yum install -y sensu redis rabbitmq-server-3.6.1-1.noarch.rpm
- systemctl enable rabbitmq-server
- systemctl enable redis
- systemctl enable sensu-server
- systemctl enable sensu-api
- systemctl enable sensu-client
- systemctl start rabbitmq-server
- systemctl start redis
- # Rabbit Config - change password
- rabbitmqctl add_vhost /sensu
- rabbitmqctl add_user sensu thepassword
- rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"
- # Test using:
- # redis-cli ping
- # Sensu Config for RabbitMQ
- echo '{
- "rabbitmq": {
- "host": "localhost",
- "port": 5672,
- "vhost": "/sensu",
- "user": "sensu",
- "password": "thepassword"
- }
- }' > /etc/sensu/conf.d/rabbitmq.json
- # Sensu Config for Redis
- echo '{
- "redis": {
- "host": "localhost",
- "port": 6379
- }
- }' > /etc/sensu/conf.d/redis.json
- # Sensu Config for sensu-api
- echo '{
- "api": {
- "host": "localhost",
- "bind": "127.0.0.1",
- "port": 4567
- }
- }' > /etc/sensu/conf.d/api.json
- # Sensu config for sensu-client
- echo '{
- "client": {
- "name": "localhost",
- "address": "127.0.0.1",
- "subscriptions": [
- "disk"
- ]
- }
- }' > /etc/sensu/conf.d/client.json
- # Sensu config for the default handler
- echo '{
- "handlers": {
- "default": {
- "type": "pipe",
- "command": "cat"
- }
- }
- }' > /etc/sensu/conf.d/default_handler.json
- # Sensu config for "disk" check
- echo '{
- "checks": {
- "disk": {
- "command": "check-disk-usage.rb -w 85 -c 95",
- "interval": 10,
- "subscribers": [
- "test"
- ]
- }
- }
- }' > /etc/sensu/conf.d/check_disk.json
- rm -f /etc/sensu/config.json.example # Remove Fluff
- rm -f /etc/sensu/conf.f/README.md # Remove Fluff
- chown -R sensu:sensu /etc/sensu
- yum -y install uchiwa
- systemctl enable uchiwa
- echo '{
- "sensu": [
- {
- "name": "TeleHouseSuite1",
- "host": "localhost",
- "port": 4567,
- "timeout": 10
- }
- ],
- "uchiwa": {
- "host": "0.0.0.0",
- "port": 3000,
- "refresh": 10
- }
- }' > /etc/sensu/uchiwa.json
- firewall-cmd --add-port=3000/tcp --permanent
- firewall-cmd --reload
- systemctl start uchiwa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement