You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
5.2KB

  1. icinga2:
  2. master_host: salt
  3. port: 5665
  4. config:
  5. templates:
  6. generic-host:
  7. type: Host
  8. conf:
  9. max_check_attempts: 3
  10. check_interval: 1m
  11. retry_interval: 30s
  12. check_command: hostalive
  13. generic-service:
  14. type: Service
  15. conf:
  16. max_check_attempts: 5
  17. check_interval: 1m
  18. retry_interval: 30s
  19. generic-user:
  20. type: User
  21. generic-template-all:
  22. type: Notification
  23. conf:
  24. types:
  25. - Problem
  26. - Acknowledgenment
  27. - Recovery
  28. - Custom
  29. - FlappingStart
  30. - FlappingEnd
  31. - DowntimeStart
  32. - DowntimeEnd
  33. - DowntimeRemoved
  34. period: "24x7"
  35. mail-host-notification:
  36. type: Notification
  37. conf:
  38. import: generic-template-all
  39. command: mail-host-notification
  40. states:
  41. - Up
  42. - Down
  43. mail-service-notification:
  44. type: Notification
  45. conf:
  46. import: generic-template-all
  47. command: mail-service-notification
  48. states:
  49. - OK
  50. - Warning
  51. - Critical
  52. - Unknown
  53. hosts:
  54. NodeName:
  55. type: Host
  56. conf:
  57. import: generic-host
  58. address: 127.0.0.1
  59. vars:
  60. os: Linux
  61. disk_wfree: 15%
  62. ssh_port: 22
  63. notification.slack: "true"
  64. http_vhosts:
  65. Icinga web 2:
  66. http_uri: /icingaweb2
  67. http_port: 443
  68. http_ssl: "true"
  69. disks:
  70. disk:
  71. groups:
  72. linux-servers:
  73. type: HostGroup
  74. conf:
  75. display_name: "Linux Servers"
  76. assign:
  77. - host.vars.os == "Linux"
  78. windows-servers:
  79. type: HostGroup
  80. conf:
  81. display_name: "Windows Servers"
  82. assign:
  83. - host.vars.os == "Windows"
  84. ping:
  85. type: ServiceGroup
  86. conf:
  87. display_name: "Ping Service"
  88. assign:
  89. - match("ping*", service.name)
  90. http:
  91. type: ServiceGroup
  92. conf:
  93. display_name: "HTTP Service"
  94. assign:
  95. - match("http*", service.check_command)
  96. disk:
  97. type: ServiceGroup
  98. conf:
  99. display_name: "Disk Checks"
  100. assign:
  101. - match("disk*", service.check_command)
  102. downtimes:
  103. backup-downtime:
  104. type: ScheduledDowntime
  105. to: Service
  106. conf:
  107. author: icingaadmin
  108. comment: Scheduled downtime for backup
  109. ranges:
  110. monday: service.vars.backup_downtime
  111. tuesday: service.vars.backup_downtime
  112. wednesday: service.vars.backup_downtime
  113. thursday: service.vars.backup_downtime
  114. friday: service.vars.backup_downtime
  115. saturday: service.vars.backup_downtime
  116. sunday: service.vars.backup_downtime
  117. assign:
  118. - service.vars.backup_downtime != ""
  119. notifications:
  120. mail-icingaadmin-host:
  121. type: Notification
  122. to: Host
  123. conf:
  124. import: mail-host-notification
  125. user_groups: host.vars.notification.mail.groups
  126. users: host.vars.notification.mail.users
  127. assign:
  128. - host.vars.notification.mail
  129. mail-icingaadmin-service:
  130. type: Notification
  131. to: Service
  132. conf:
  133. import: mail-service-notification
  134. user_groups: host.vars.notification.mail.groups
  135. users: host.vars.notification.mail.users
  136. assign:
  137. - host.vars.notification.mail
  138. services:
  139. icinga:
  140. type: Service
  141. conf:
  142. import: generic-service
  143. check_command: icinga
  144. assign:
  145. - host.name == NodeName
  146. procs:
  147. type: Service
  148. conf:
  149. import: generic-service
  150. check_command: procs
  151. assign:
  152. - host.name == NodeName
  153. swap:
  154. type: Service
  155. conf:
  156. import: generic-service
  157. check_command: swap
  158. assign:
  159. - host.name == NodeName
  160. users:
  161. type: Service
  162. conf:
  163. import: generic-service
  164. check_command: users
  165. assign:
  166. - host.name == NodeName
  167. ping4:
  168. type: Service
  169. conf:
  170. import: generic-service
  171. check_command: ping4
  172. assign:
  173. - host.address
  174. ssh:
  175. type: Service
  176. conf:
  177. import: generic-service
  178. check_command: ssh
  179. assign:
  180. - (host.address || host.address6) && host.vars.os == "Linux"
  181. load:
  182. type: Service
  183. conf:
  184. import: generic-service
  185. check_command: load
  186. vars:
  187. backup_downtime: "02:00-03:00"
  188. assign:
  189. - host.name == NodeName
  190. http_vhosts:
  191. type: Service
  192. for: (http_vhost => config in host.vars.http_vhosts)
  193. conf:
  194. import: generic-service
  195. check_command: http
  196. disks:
  197. type: Service
  198. for: (disk => config in host.vars.disks)
  199. conf:
  200. import: generic-service
  201. check_command: disk