hardware.rules 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. groups:
  2. - name: NodeExporter
  3. rules:
  4. - alert: HostOutOfMemory
  5. expr: 'node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10'
  6. for: 2m
  7. labels:
  8. severity: warning
  9. type: ops
  10. annotations:
  11. summary: Host out of memory (instance {{ $labels.instance }})
  12. description: "Node memory is filling up (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  13. - alert: HostMemoryUnderMemoryPressure
  14. expr: 'rate(node_vmstat_pgmajfault[1m]) > 1000'
  15. for: 2m
  16. labels:
  17. severity: warning
  18. type: ops
  19. annotations:
  20. summary: Host memory under memory pressure (instance {{ $labels.instance }})
  21. description: "The node is under heavy memory pressure. High rate of major page faults\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  22. - alert: HostUnusualNetworkThroughputIn
  23. expr: 'sum by (instance) (rate(node_network_receive_bytes_total[2m])) / 1024 / 1024 > 100'
  24. for: 5m
  25. labels:
  26. severity: warning
  27. type: ops
  28. annotations:
  29. summary: Host unusual network throughput in (instance {{ $labels.instance }})
  30. description: "Host network interfaces are probably receiving too much data (> 100 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  31. - alert: HostUnusualNetworkThroughputOut
  32. expr: 'sum by (instance) (rate(node_network_transmit_bytes_total[2m])) / 1024 / 1024 > 100'
  33. for: 5m
  34. labels:
  35. severity: warning
  36. type: ops
  37. annotations:
  38. summary: Host unusual network throughput out (instance {{ $labels.instance }})
  39. description: "Host network interfaces are probably sending too much data (> 100 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  40. - alert: HostUnusualDiskReadRate
  41. expr: 'sum by (instance) (rate(node_disk_read_bytes_total[2m])) / 1024 / 1024 > 50'
  42. for: 5m
  43. labels:
  44. severity: warning
  45. type: ops
  46. annotations:
  47. summary: Host unusual disk read rate (instance {{ $labels.instance }})
  48. description: "Disk is probably reading too much data (> 50 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  49. - alert: HostUnusualDiskWriteRate
  50. expr: 'sum by (instance) (rate(node_disk_written_bytes_total[2m])) / 1024 / 1024 > 50'
  51. for: 2m
  52. labels:
  53. severity: warning
  54. type: ops
  55. annotations:
  56. summary: Host unusual disk write rate (instance {{ $labels.instance }})
  57. description: "Disk is probably writing too much data (> 50 MB/s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  58. - alert: HostOutOfDiskSpace
  59. expr: '(node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) node_filesystem_readonly == 0'
  60. for: 2m
  61. labels:
  62. severity: warning
  63. type: ops
  64. annotations:
  65. summary: Host out of disk space (instance {{ $labels.instance }})
  66. description: "Disk is almost full (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  67. - alert: HostDiskWillFillIn24Hours
  68. expr: '(node_filesystem_avail_bytes * 100) / node_filesystem_size_bytes < 10 and ON (instance, device, mountpoint) predict_linear(node_filesystem_avail_bytes{fstype!~"tmpfs"}[1h], 24 * 3600) < 0 and ON (instance, device, mountpoint) node_filesystem_readonly == 0'
  69. for: 2m
  70. labels:
  71. severity: warning
  72. type: ops
  73. annotations:
  74. summary: Host disk will fill in 24 hours (instance {{ $labels.instance }})
  75. description: "Filesystem is predicted to run out of space within the next 24 hours at current write rate\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  76. - alert: HostOutOfInodes
  77. expr: 'node_filesystem_files_free{mountpoint ="/rootfs"} / node_filesystem_files{mountpoint="/rootfs"} * 100 < 10 and ON (instance, device, mountpoint) node_filesystem_readonly{mountpoint="/rootfs"} == 0'
  78. for: 2m
  79. labels:
  80. severity: warning
  81. type: ops
  82. annotations:
  83. summary: Host out of inodes (instance {{ $labels.instance }})
  84. description: "Disk is almost running out of available inodes (< 10% left)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  85. - alert: HostInodesWillFillIn24Hours
  86. expr: 'node_filesystem_files_free{mountpoint ="/rootfs"} / node_filesystem_files{mountpoint="/rootfs"} * 100 < 10 and predict_linear(node_filesystem_files_free{mountpoint="/rootfs"}[1h], 24 * 3600) < 0 and ON (instance, device, mountpoint) node_filesystem_readonly{mountpoint="/rootfs"} == 0'
  87. for: 2m
  88. labels:
  89. severity: warning
  90. type: ops
  91. annotations:
  92. summary: Host inodes will fill in 24 hours (instance {{ $labels.instance }})
  93. description: "Filesystem is predicted to run out of inodes within the next 24 hours at current write rate\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  94. - alert: HostUnusualDiskReadLatency
  95. expr: 'rate(node_disk_read_time_seconds_total[1m]) / rate(node_disk_reads_completed_total[1m]) > 0.1 and rate(node_disk_reads_completed_total[1m]) > 0'
  96. for: 2m
  97. labels:
  98. severity: warning
  99. type: ops
  100. annotations:
  101. summary: Host unusual disk read latency (instance {{ $labels.instance }})
  102. description: "Disk latency is growing (read operations > 100ms)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  103. - alert: HostUnusualDiskWriteLatency
  104. expr: 'rate(node_disk_write_time_seconds_total[1m]) / rate(node_disk_writes_completed_total[1m]) > 0.1 and rate(node_disk_writes_completed_total[1m]) > 0'
  105. for: 2m
  106. labels:
  107. severity: warning
  108. type: ops
  109. annotations:
  110. summary: Host unusual disk write latency (instance {{ $labels.instance }})
  111. description: "Disk latency is growing (write operations > 100ms)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  112. - alert: HostHighCpuLoad
  113. expr: '100 - (avg by(instance) (rate(node_cpu_seconds_total{mode="idle"}[2m])) * 100) > 80'
  114. for: 0m
  115. labels:
  116. severity: warning
  117. type: ops
  118. annotations:
  119. summary: Host high CPU load (instance {{ $labels.instance }})
  120. description: "CPU load is > 80%\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  121. - alert: HostCpuStealNoisyNeighbor
  122. expr: 'avg by(instance) (rate(node_cpu_seconds_total{mode="steal"}[5m])) * 100 > 10'
  123. for: 0m
  124. labels:
  125. severity: warning
  126. type: ops
  127. annotations:
  128. summary: Host CPU steal noisy neighbor (instance {{ $labels.instance }})
  129. description: "CPU steal is > 10%. A noisy neighbor is killing VM performances or a spot instance may be out of credit.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  130. - alert: HostCpuHighIowait
  131. expr: 'avg by (instance) (rate(node_cpu_seconds_total{mode="iowait"}[5m])) * 100 > 10'
  132. for: 0m
  133. labels:
  134. severity: warning
  135. type: ops
  136. annotations:
  137. summary: Host CPU high iowait (instance {{ $labels.instance }})
  138. description: "CPU iowait > 10%. A high iowait means that you are disk or network bound.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  139. - alert: HostContextSwitching
  140. expr: '(rate(node_context_switches_total[5m])) / (count without(cpu, mode) (node_cpu_seconds_total{mode="idle"})) > 11000'
  141. for: 0m
  142. labels:
  143. severity: warning
  144. type: ops
  145. annotations:
  146. summary: Host context switching (instance {{ $labels.instance }})
  147. description: "Context switching is growing on node (> 1000 / s)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  148. - alert: HostSwapIsFillingUp
  149. expr: '(1 - (node_memory_SwapFree_bytes / node_memory_SwapTotal_bytes)) * 100 > 80'
  150. for: 2m
  151. labels:
  152. severity: warning
  153. type: ops
  154. annotations:
  155. summary: Host swap is filling up (instance {{ $labels.instance }})
  156. description: "Swap is filling up (>80%)\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  157. - alert: HostSystemdServiceCrashed
  158. expr: 'node_systemd_unit_state{state="failed"} == 1'
  159. for: 0m
  160. labels:
  161. severity: warning
  162. type: ops
  163. annotations:
  164. summary: Host systemd service crashed (instance {{ $labels.instance }})
  165. description: "systemd service crashed\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  166. - alert: HostPhysicalComponentTooHot
  167. expr: 'node_hwmon_temp_celsius > 75'
  168. for: 5m
  169. labels:
  170. severity: warning
  171. type: ops
  172. annotations:
  173. summary: Host physical component too hot (instance {{ $labels.instance }})
  174. description: "Physical hardware component too hot\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  175. - alert: HostNodeOvertemperatureAlarm
  176. expr: 'node_hwmon_temp_crit_alarm_celsius == 1'
  177. for: 0m
  178. labels:
  179. severity: critical
  180. type: ops
  181. annotations:
  182. summary: Host node overtemperature alarm (instance {{ $labels.instance }})
  183. description: "Physical node temperature alarm triggered\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  184. - alert: HostRaidArrayGotInactive
  185. expr: 'node_md_state{state="inactive"} > 0'
  186. for: 0m
  187. labels:
  188. severity: critical
  189. type: ops
  190. annotations:
  191. summary: Host RAID array got inactive (instance {{ $labels.instance }})
  192. description: "RAID array {{ $labels.device }} is in degraded state due to one or more disks failures. Number of spare drives is insufficient to fix issue automatically.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  193. - alert: HostRaidDiskFailure
  194. expr: 'node_md_disks{state="failed"} > 0'
  195. for: 2m
  196. labels:
  197. severity: warning
  198. type: ops
  199. annotations:
  200. summary: Host RAID disk failure (instance {{ $labels.instance }})
  201. description: "At least one device in RAID array on {{ $labels.instance }} failed. Array {{ $labels.md_device }} needs attention and possibly a disk swap\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  202. - alert: HostKernelVersionDeviations
  203. expr: 'count(sum(label_replace(node_uname_info, "kernel", "$1", "release", "([0-9]+.[0-9]+.[0-9]+).*")) by (kernel)) > 1'
  204. for: 6h
  205. labels:
  206. severity: warning
  207. type: ops
  208. annotations:
  209. summary: Host kernel version deviations (instance {{ $labels.instance }})
  210. description: "Different kernel versions are running\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  211. - alert: HostOomKillDetected
  212. expr: 'increase(node_vmstat_oom_kill[1m]) > 0'
  213. for: 0m
  214. labels:
  215. severity: warning
  216. type: ops
  217. annotations:
  218. summary: Host OOM kill detected (instance {{ $labels.instance }})
  219. description: "OOM kill detected\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  220. - alert: HostEdacCorrectableErrorsDetected
  221. expr: 'increase(node_edac_correctable_errors_total[1m]) > 0'
  222. for: 0m
  223. labels:
  224. severity: info
  225. type: ops
  226. annotations:
  227. summary: Host EDAC Correctable Errors detected (instance {{ $labels.instance }})
  228. description: "Host {{ $labels.instance }} has had {{ printf \"%.0f\" $value }} correctable memory errors reported by EDAC in the last 5 minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  229. - alert: HostEdacUncorrectableErrorsDetected
  230. expr: 'node_edac_uncorrectable_errors_total > 0'
  231. for: 0m
  232. labels:
  233. severity: warning
  234. type: ops
  235. annotations:
  236. summary: Host EDAC Uncorrectable Errors detected (instance {{ $labels.instance }})
  237. description: "Host {{ $labels.instance }} has had {{ printf \"%.0f\" $value }} uncorrectable memory errors reported by EDAC in the last 5 minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  238. - alert: HostNetworkReceiveErrors
  239. expr: 'rate(node_network_receive_errs_total[2m]) / rate(node_network_receive_packets_total[2m]) > 0.01'
  240. for: 2m
  241. labels:
  242. severity: warning
  243. type: ops
  244. annotations:
  245. summary: Host Network Receive Errors (instance {{ $labels.instance }})
  246. description: "Host {{ $labels.instance }} interface {{ $labels.device }} has encountered {{ printf \"%.0f\" $value }} receive errors in the last two minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  247. - alert: HostNetworkTransmitErrors
  248. expr: 'rate(node_network_transmit_errs_total[2m]) / rate(node_network_transmit_packets_total[2m]) > 0.01'
  249. for: 2m
  250. labels:
  251. severity: warning
  252. type: ops
  253. annotations:
  254. summary: Host Network Transmit Errors (instance {{ $labels.instance }})
  255. description: "Host {{ $labels.instance }} interface {{ $labels.device }} has encountered {{ printf \"%.0f\" $value }} transmit errors in the last two minutes.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  256. - alert: HostNetworkInterfaceSaturated
  257. expr: '(rate(node_network_receive_bytes_total{device!~"^tap.*|^vnet.*|^veth.*|^tun.*"}[1m]) + rate(node_network_transmit_bytes_total{device!~"^tap.*|^vnet.*|^veth.*|^tun.*"}[1m])) / node_network_speed_bytes{device!~"^tap.*|^vnet.*|^veth.*|^tun.*"} > 0.8 < 10000'
  258. for: 1m
  259. labels:
  260. severity: warning
  261. type: ops
  262. annotations:
  263. summary: Host Network Interface Saturated (instance {{ $labels.instance }})
  264. description: "The network interface \"{{ $labels.device }}\" on \"{{ $labels.instance }}\" is getting overloaded.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  265. - alert: HostNetworkBondDegraded
  266. expr: '(node_bonding_active - node_bonding_slaves) != 0'
  267. for: 2m
  268. labels:
  269. severity: warning
  270. type: ops
  271. annotations:
  272. summary: Host Network Bond Degraded (instance {{ $labels.instance }})
  273. description: "Bond \"{{ $labels.device }}\" degraded on \"{{ $labels.instance }}\".\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  274. - alert: HostConntrackLimit
  275. expr: 'node_nf_conntrack_entries / node_nf_conntrack_entries_limit > 0.8'
  276. for: 5m
  277. labels:
  278. severity: warning
  279. type: ops
  280. annotations:
  281. summary: Host conntrack limit (instance {{ $labels.instance }})
  282. description: "The number of conntrack is approaching limit\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  283. - alert: HostClockSkew
  284. expr: '(node_timex_offset_seconds > 0.05 and deriv(node_timex_offset_seconds[5m]) >= 0) or (node_timex_offset_seconds < -0.05 and deriv(node_timex_offset_seconds[5m]) <= 0)'
  285. for: 2m
  286. labels:
  287. severity: warning
  288. type: ops
  289. annotations:
  290. summary: Host clock skew (instance {{ $labels.instance }})
  291. description: "Clock skew detected. Clock is out of sync. Ensure NTP is configured correctly on this host.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  292. - alert: HostClockNotSynchronising
  293. expr: 'min_over_time(node_timex_sync_status[1m]) == 0 and node_timex_maxerror_seconds >= 16'
  294. for: 2m
  295. labels:
  296. severity: warning
  297. type: ops
  298. annotations:
  299. summary: Host clock not synchronising (instance {{ $labels.instance }})
  300. description: "Clock not synchronising. Ensure NTP is configured on this host.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"
  301. - alert: HostRequiresReboot
  302. expr: 'node_reboot_required > 0'
  303. for: 4h
  304. labels:
  305. severity: info
  306. type: ops
  307. annotations:
  308. summary: Host requires reboot (instance {{ $labels.instance }})
  309. description: "{{ $labels.instance }} requires a reboot.\n VALUE = {{ $value }}\n LABELS = {{ $labels }}"