checks.tf 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. locals {
  2. splunk_hot = var.environment == "test" ? "10000" : "50000"
  3. interconnect-0 = var.environment == "test" ? ["169.254.230.197", "169.254.142.233", "169.254.221.229", "169.254.145.141"] : ["169.254.152.217", "169.254.88.105", "169.254.253.45", "169.254.91.129"]
  4. interconnect-1 = var.environment == "test" ? ["169.254.186.189", "169.254.119.73", "169.254.20.161", "169.254.128.189"] : ["169.254.247.157", "169.254.246.157", "169.254.22.21", "169.254.38.13"]
  5. }
  6. resource "sensu_check" "check_disk_base" {
  7. name = "check_disk_base"
  8. command = "check_disk -c 250 -p /var -C -c 500 -p /var/log -C -c 1000 -p /var/log/audit -C -c 2000 -p /opt -C -c 500 -p /boot -C -c 1000 -p /"
  9. namespace = "default"
  10. subscriptions = [ "linux", ]
  11. handlers = [ "victorops", ]
  12. cron = "* * * * *"
  13. publish = "true"
  14. runtime_assets = [ "sensu-plugins-monitoring", ]
  15. }
  16. resource "sensu_check" "check_disk_indexer" {
  17. name = "check_disk_indexer"
  18. command = "check_disk -c ${local.splunk_hot} -p /opt/splunkdata/hot -C -c 5000 -p /opt/splunk"
  19. namespace = "default"
  20. subscriptions = [ "check_disk_indexer", ]
  21. handlers = [ "victorops", ]
  22. cron = "* * * * *"
  23. publish = "true"
  24. runtime_assets = [ "sensu-plugins-monitoring", ]
  25. }
  26. resource "sensu_check" "check_disk_syslog" {
  27. name = "check_disk_syslog"
  28. command = "check_disk -c 7000 -p /opt/syslog-ng"
  29. namespace = "default"
  30. subscriptions = [ "check_disk_syslog", ]
  31. handlers = [ "victorops", ]
  32. cron = "* * * * *"
  33. publish = "true"
  34. runtime_assets = [ "sensu-plugins-monitoring", ]
  35. }
  36. resource "sensu_check" "check_ping_interconnect-0" {
  37. for_each = toset(local.interconnect-0)
  38. name = "ping_interconnect-0-${index(local.interconnect-0, each.value) +1}"
  39. command = "check_ping -H ${each.value} -w 100,80% -c 100,80% -4"
  40. namespace = "default"
  41. subscriptions = [ "interconnect-0", ]
  42. handlers = [ "victorops", ]
  43. cron = "* * * * *"
  44. publish = "true"
  45. runtime_assets = [ "sensu-plugins-monitoring", ]
  46. }
  47. resource "sensu_check" "check_ping_interconnect-1" {
  48. for_each = toset(local.interconnect-1)
  49. name = "ping_interconnect-1-${index(local.interconnect-1, each.value) +1}"
  50. command = "check_ping -H ${each.value} -w 100,80% -c 100,80% -4"
  51. namespace = "default"
  52. subscriptions = [ "interconnect-1", ]
  53. handlers = [ "victorops", ]
  54. cron = "* * * * *"
  55. publish = "true"
  56. runtime_assets = [ "sensu-plugins-monitoring", ]
  57. }
  58. resource "sensu_check" "check_phantom_ports" {
  59. name = "phantom_ports"
  60. command = "check-ports.rb -h 0.0.0.0 -p 443"
  61. namespace = "default"
  62. subscriptions = [ "phantom_ports", ]
  63. handlers = [ "victorops", ]
  64. cron = "* * * * *"
  65. publish = "true"
  66. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  67. }
  68. #only needed in PROD
  69. resource "sensu_check" "check_portal_http" {
  70. count = var.environment == "test" ? 0 : 1
  71. name = "portal_http"
  72. command = "metrics-curl.rb -u https://portal.xdr.accenturefederalcyber.com"
  73. namespace = "default"
  74. subscriptions = [ "portal", ]
  75. handlers = [ "victorops", ]
  76. cron = "* * * * *"
  77. publish = "true"
  78. runtime_assets = [ "sensu-plugins-http", "sensu-ruby-runtime", ]
  79. }
  80. resource "sensu_check" "check_salt_master_ports" {
  81. name = "salt_master_ports"
  82. command = "check-ports.rb -h 0.0.0.0 -p 4505,4506"
  83. namespace = "default"
  84. subscriptions = [ "salt_master_ports", ]
  85. handlers = [ "victorops", ]
  86. cron = "* * * * *"
  87. publish = "true"
  88. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  89. }
  90. resource "sensu_check" "check_splunk_cm_ports" {
  91. name = "splunk_cm_ports"
  92. command = "check-ports.rb -h 0.0.0.0 -p 8089"
  93. namespace = "default"
  94. subscriptions = [ "splunk_cm_ports", ]
  95. handlers = [ "victorops", ]
  96. cron = "* * * * *"
  97. publish = "true"
  98. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  99. }
  100. resource "sensu_check" "check_splunk_ds_ports" {
  101. name = "splunk_ds_ports"
  102. command = "check-ports.rb -h 0.0.0.0 -p 8089"
  103. namespace = "default"
  104. subscriptions = [ "splunk_ds_ports", ]
  105. handlers = [ "victorops", ]
  106. cron = "* * * * *"
  107. publish = "true"
  108. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  109. }
  110. resource "sensu_check" "check_splunk_hf_ports" {
  111. name = "splunk_hf_ports"
  112. command = "check-ports.rb -h 0.0.0.0 -p 8089,8000"
  113. namespace = "default"
  114. subscriptions = [ "splunk_hf_ports", ]
  115. handlers = [ "victorops", ]
  116. cron = "* * * * *"
  117. publish = "true"
  118. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  119. }
  120. resource "sensu_check" "check_splunk_indexer_ports_moose" {
  121. name = "splunk_indexer_ports_moose"
  122. command = "check-ports.rb -h 0.0.0.0 -p 8089,9998,9887,8088"
  123. namespace = "default"
  124. subscriptions = [ "splunk_indexer_ports_moose", ]
  125. handlers = [ "victorops", ]
  126. cron = "* * * * *"
  127. publish = "true"
  128. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  129. }
  130. resource "sensu_check" "check_splunk_indexer_ports" {
  131. name = "splunk_indexer_ports"
  132. command = "check-ports.rb -h 0.0.0.0 -p 8089,9998,9887"
  133. namespace = "default"
  134. subscriptions = [ "splunk_indexer_ports", ]
  135. handlers = [ "victorops", ]
  136. cron = "* * * * *"
  137. publish = "true"
  138. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  139. }
  140. resource "sensu_check" "check_splunk_sh_ports" {
  141. name = "splunk_sh_ports"
  142. command = "check-ports.rb -h 0.0.0.0 -p 8089,8000"
  143. namespace = "default"
  144. subscriptions = [ "splunk_sh_ports", ]
  145. handlers = [ "victorops", ]
  146. cron = "* * * * *"
  147. publish = "true"
  148. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  149. }
  150. resource "sensu_check" "check_splunk_uf_ports" {
  151. name = "splunk_uf_ports"
  152. command = "check-ports.rb -h 0.0.0.0 -p 8089"
  153. namespace = "default"
  154. subscriptions = [ "splunk", ]
  155. handlers = [ "victorops", ]
  156. cron = "* * * * *"
  157. publish = "true"
  158. runtime_assets = [ "sensu-plugins-network-checks", "sensu-ruby-runtime", ]
  159. }
  160. resource "sensu_check" "check_syslog-ng_service" {
  161. name = "syslog-ng_service"
  162. command = "check-process.rb -p syslog-ng"
  163. namespace = "default"
  164. subscriptions = [ "syslog-ng_service", ]
  165. handlers = [ "victorops", ]
  166. cron = "* * * * *"
  167. publish = "true"
  168. runtime_assets = [ "sensu-plugins-process-checks", "sensu-ruby-runtime", ]
  169. }