Advertisement
Guest User

Salt nagios install 2

a guest
Oct 9th, 2014
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. [root@nyopstools2 salt]# salt --version
  2. salt 2014.1.10 (Hydrogen)
  3. [root@nyopstools2 salt]# salt 'nybmon1' state.highstate
  4. nybmon1:
  5. ----------
  6. ID: nagios
  7. Function: pkg.installed
  8. Result: True
  9. Comment: All specified packages are already installed.
  10. Changes:
  11. ----------
  12. ID: install-nagios
  13. Function: cmd.run
  14. Name: /usr/sbin/usermod -G nagios apache
  15. cd /usr/local/src
  16. wget -c http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
  17. wget -c http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
  18. tar -xzf nagios-4.0.8.tar.gz
  19. cd nagios-4.0.8
  20. ./configure --with-command-group=nagios
  21. make all
  22. make install
  23. make install-config
  24. make install-commandmode
  25. mkdir /etc/httpd/certs/
  26. mkdir /etc/httpd/conf/extra
  27.  
  28. Result: False
  29. Comment: The following requisites were not found:
  30. require:
  31. sls: nagios
  32. Changes:
  33. ----------
  34. ID: /etc/httpd/conf/httpd.conf
  35. Function: file.managed
  36. Result: False
  37. Comment: One or more requisite failed
  38. Changes:
  39. ----------
  40. ID: /etc/httpd/conf/mime.types
  41. Function: file.managed
  42. Result: False
  43. Comment: One or more requisite failed
  44. Changes:
  45. ----------
  46. ID: /etc/httpd/conf/extra/httpd-ssl.conf
  47. Function: file.managed
  48. Result: False
  49. Comment: One or more requisite failed
  50. Changes:
  51. ----------
  52. ID: /etc/httpd/certs/Thawte.txt
  53. Function: file.managed
  54. Result: False
  55. Comment: One or more requisite failed
  56. Changes:
  57. ----------
  58. ID: /etc/httpd/certs/nymon1.ops.about.com.cert
  59. Function: file.managed
  60. Result: False
  61. Comment: One or more requisite failed
  62. Changes:
  63. ----------
  64. ID: /etc/httpd/certs/nymon1.ops.about.com.key
  65. Function: file.managed
  66. Result: False
  67. Comment: One or more requisite failed
  68. Changes:
  69.  
  70. Summary
  71. ------------
  72. Succeeded: 1
  73. Failed: 7
  74. ------------
  75. Total: 8
  76. [root@nyopstools2 salt]# cat nagios_monitor.sls
  77. include:
  78. - nagios
  79.  
  80. install-nagios:
  81. cmd.run:
  82. - name: |
  83. /usr/sbin/usermod -G nagios apache
  84. cd /usr/local/src
  85. wget -c http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.0.8.tar.gz
  86. wget -c http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
  87. tar -xzf nagios-4.0.8.tar.gz
  88. cd nagios-4.0.8
  89. ./configure --with-command-group=nagios
  90. make all
  91. make install
  92. make install-config
  93. make install-commandmode
  94. mkdir /etc/httpd/certs/
  95. mkdir /etc/httpd/conf/extra
  96. - cwd: /usr/local/src
  97. - shell: /bin/bash
  98. - timeout: 300
  99. - unless: test -x /usr/local/nagios/bin/nagios
  100. - require:
  101. - sls: nagios
  102. - require_in:
  103. - file: /etc/httpd/conf/httpd.conf
  104. - file: /etc/httpd/conf/mime.types
  105. - file: /etc/httpd/conf/extra/httpd-ssl.conf
  106. - file: /etc/httpd/certs/Thawte.txt
  107. - file: /etc/httpd/certs/nymon1.ops.about.com.cert
  108. - file: /etc/httpd/certs/nymon1.ops.about.com.key
  109.  
  110. /etc/httpd/conf/httpd.conf:
  111. file.managed:
  112. - source: salt://apache/httpd.conf
  113.  
  114. /etc/httpd/conf/mime.types:
  115. file.managed:
  116. - source: salt://apache/mime.types
  117.  
  118. /etc/httpd/conf/extra/httpd-ssl.conf:
  119. file.managed:
  120. - source: salt://apache/httpd-ssl.conf
  121.  
  122. /etc/httpd/certs/Thawte.txt:
  123. file.managed:
  124. - source: salt://apache/Thawte.txt
  125.  
  126. /etc/httpd/certs/nymon1.ops.about.com.cert:
  127. file.managed:
  128. - source: salt://apache/nymon1.ops.about.com.cert
  129.  
  130. /etc/httpd/certs/nymon1.ops.about.com.key:
  131. file.managed:
  132. - source: salt://apache/nymon1.ops.about.com.key
  133.  
  134. [root@nyopstools2 salt]# cat nagios.sls
  135. nagios:
  136. pkg.installed:
  137. - pkgs:
  138. - httpd
  139. - php
  140. - gd
  141. - gd-devel
  142. - mod_ssl
  143. - mod_authz_ldap
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement