Advertisement
Guest User

SensuCentos7SetupIssue

a guest
Apr 7th, 2016
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. echo '[sensu]
  2. name=sensu
  3. baseurl=http://repositories.sensuapp.org/yum/$basearch/
  4. gpgcheck=0
  5. enabled=1' | sudo tee /etc/yum.repos.d/sensu.repo
  6. # Raises max number of open files in OS for rabbitmq
  7. echo -e "*\t\tsoft\tnofile\t\t65536" >> /etc/security/limits.conf
  8. echo -e "*\t\thard\tnofile\t\t65536" >> /etc/security/limits.conf
  9. rpm --import https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
  10. wget https://www.rabbitmq.com/releases/rabbitmq-server/v3.6.1/rabbitmq-server-3.6.1-1.noarch.rpm
  11. yum install -y sensu redis rabbitmq-server-3.6.1-1.noarch.rpm
  12. systemctl enable rabbitmq-server
  13. systemctl enable redis
  14. systemctl enable sensu-server
  15. systemctl enable sensu-api
  16. systemctl enable sensu-client
  17. systemctl start rabbitmq-server
  18. systemctl start redis
  19. # Rabbit Config - change password
  20. rabbitmqctl add_vhost /sensu
  21. rabbitmqctl add_user sensu thepassword
  22. rabbitmqctl set_permissions -p /sensu sensu ".*" ".*" ".*"
  23. # Test using:
  24. # redis-cli ping
  25.  
  26. # Sensu Config for RabbitMQ
  27. echo '{
  28. "rabbitmq": {
  29. "host": "localhost",
  30. "port": 5672,
  31. "vhost": "/sensu",
  32. "user": "sensu",
  33. "password": "thepassword"
  34. }
  35. }' > /etc/sensu/conf.d/rabbitmq.json
  36.  
  37. # Sensu Config for Redis
  38. echo '{
  39. "redis": {
  40. "host": "localhost",
  41. "port": 6379
  42. }
  43. }' > /etc/sensu/conf.d/redis.json
  44.  
  45. # Sensu Config for sensu-api
  46. echo '{
  47. "api": {
  48. "host": "localhost",
  49. "bind": "127.0.0.1",
  50. "port": 4567
  51. }
  52. }' > /etc/sensu/conf.d/api.json
  53.  
  54. # Sensu config for sensu-client
  55. echo '{
  56. "client": {
  57. "name": "localhost",
  58. "address": "127.0.0.1",
  59. "subscriptions": [
  60. "disk"
  61. ]
  62. }
  63. }' > /etc/sensu/conf.d/client.json
  64.  
  65. # Sensu config for the default handler
  66. echo '{
  67. "handlers": {
  68. "default": {
  69. "type": "pipe",
  70. "command": "cat"
  71. }
  72. }
  73. }' > /etc/sensu/conf.d/default_handler.json
  74.  
  75. # Sensu config for "disk" check
  76. echo '{
  77. "checks": {
  78. "disk": {
  79. "command": "check-disk-usage.rb -w 85 -c 95",
  80. "interval": 10,
  81. "subscribers": [
  82. "test"
  83. ]
  84. }
  85. }
  86. }' > /etc/sensu/conf.d/check_disk.json
  87.  
  88. rm -f /etc/sensu/config.json.example # Remove Fluff
  89. rm -f /etc/sensu/conf.f/README.md # Remove Fluff
  90. chown -R sensu:sensu /etc/sensu
  91.  
  92. yum -y install uchiwa
  93. systemctl enable uchiwa
  94.  
  95.  
  96. echo '{
  97. "sensu": [
  98. {
  99. "name": "TeleHouseSuite1",
  100. "host": "localhost",
  101. "port": 4567,
  102. "timeout": 10
  103. }
  104. ],
  105. "uchiwa": {
  106. "host": "0.0.0.0",
  107. "port": 3000,
  108. "refresh": 10
  109. }
  110. }' > /etc/sensu/uchiwa.json
  111. firewall-cmd --add-port=3000/tcp --permanent
  112. firewall-cmd --reload
  113. systemctl start uchiwa
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement