Saltstack Official Linux Formula
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.

123 lines
5.8KB

  1. {%- from "linux/map.jinja" import monitoring with context %}
  2. server:
  3. alert:
  4. SystemCpuIdleTooLow:
  5. {%- set cpu_idle_threshold = monitoring.cpu_idle_percentage.warn|float %}
  6. if: avg_over_time(cpu_usage_idle{cpu="cpu-total"}[5m]) < {{ cpu_idle_threshold }}
  7. {% raw %}
  8. labels:
  9. severity: warning
  10. service: system
  11. annotations:
  12. summary: 'Idle CPU usage too low on {{ $labels.host }}'
  13. description: 'The average idle CPU usage is too low on node {{ $labels.host }} (current value={{ $value }}%, threshold={% endraw %}{{ cpu_idle_threshold}}%).'
  14. SystemDiskSpaceTooLow:
  15. if: 'predict_linear(disk_free[1h], 8*3600) < 0'
  16. {% raw %}
  17. labels:
  18. severity: warning
  19. service: system
  20. annotations:
  21. summary: 'Free space for {{ $labels.path }} too low on {{ $labels.host }}'
  22. description: 'The disk partition ({{ $labels.path }}) will be full in less than 8 hours on {{ $labels.host }}.'
  23. {% endraw %}
  24. SystemDiskSpaceFull:
  25. if: 'disk_used_percent >= 99 and disk_inodes_total > 0'
  26. {% raw %}
  27. labels:
  28. severity: critical
  29. service: system
  30. annotations:
  31. summary: 'Disk partition {{ $labels.path }} full on {{ $labels.host }}'
  32. description: 'The disk partition ({{ $labels.path }}) is used at {{ $value }}% on {{ $labels.host }}.'
  33. {% endraw %}
  34. SystemDiskInodesTooLow:
  35. if: 'predict_linear(disk_inodes_free[1h], 8*3600) < 0'
  36. {% raw %}
  37. labels:
  38. severity: warning
  39. service: system
  40. annotations:
  41. summary: 'Free inodes for {{ $labels.path }} too low on {{ $labels.host }}'
  42. description: 'The disk inodes ({{ $labels.path }}) will be full in less than 8 hours on {{ $labels.host }}.'
  43. {% endraw %}
  44. SystemDiskInodesFull:
  45. if: 'disk_inodes_used / disk_inodes_total >= 0.99'
  46. {% raw %}
  47. labels:
  48. severity: critical
  49. service: system
  50. annotations:
  51. summary: 'Inodes for {{ $labels.path }} full on {{ $labels.host }}'
  52. description: 'The disk inodes ({{ $labels.path }}) are used at {{ $value }}% on {{ $labels.host }}.'
  53. {% endraw %}
  54. SystemMemoryAvailableLow:
  55. {%- set mem_avail_warn_threshold = monitoring.free_memory_percentage.warn|float %}
  56. if: avg_over_time(mem_available_percent[5m]) < {{ mem_avail_warn_threshold }}
  57. {% raw %}
  58. labels:
  59. severity: warning
  60. service: system
  61. annotations:
  62. summary: 'Free memory low on {{ $labels.host }}'
  63. description: 'The percentage of free memory is low on node {{ $labels.host }} (current value={{ $value }}%, threshold={% endraw %}{{ mem_avail_warn_threshold }}%).'
  64. SystemMemoryAvailableTooLow:
  65. {%- set mem_avail_crit_threshold = monitoring.free_memory_percentage.crit|float %}
  66. if: avg_over_time(mem_available_percent[5m]) < {{ mem_avail_crit_threshold }}
  67. {% raw %}
  68. labels:
  69. severity: critical
  70. service: system
  71. annotations:
  72. summary: 'Free memory too low on {{ $labels.host }}'
  73. description: 'The percentage of free memory is too low on node {{ $labels.host }} (current value={{ $value }}%, threshold={% endraw %}{{ mem_avail_crit_threshold }}%).'
  74. SystemLoad5TooHigh:
  75. if: system_load5 / system_n_cpus > {{ monitoring.load_5.warn }}
  76. {% raw %}
  77. labels:
  78. severity: warning
  79. service: system
  80. annotations:
  81. summary: 'High system load (5m) on {{ $labels.host }}'
  82. description: 'The 5-minutes system load is too high on node {{ $labels.host }} (current value={{ $value }}, threshold={% endraw %}{{ monitoring.load_5.warn }}).'
  83. SystemRxPacketsDroppedTooHigh:
  84. {%- set net_rx_dropped_threshold = monitoring.rx_packets_dropped_rate.warn %}
  85. if: rate(net_drop_in[1m]) > {{ net_rx_dropped_threshold }}
  86. {% raw %}
  87. labels:
  88. severity: critical
  89. service: system
  90. annotations:
  91. summary: 'Too many received packets dropped on {{ $labels.host }} for interface {{ $labels.interface }}'
  92. description: 'The rate of received packets which are dropped is too high on node {{ $labels.host }} for interface {{ $labels.interface }} (current value={{ $value }}/sec, threshold={% endraw %}{{ net_rx_dropped_threshold }}/sec)'
  93. SystemTxPacketsDroppedTooHigh:
  94. {%- set net_tx_dropped_threshold = monitoring.tx_packets_dropped_rate.warn %}
  95. if: rate(net_drop_out[1m]) > {{ net_tx_dropped_threshold }}
  96. {% raw %}
  97. labels:
  98. severity: critical
  99. service: system
  100. annotations:
  101. summary: 'Too many transmitted packets dropped on {{ $labels.host }} for interface {{ $labels.interface }}'
  102. description: 'The rate of transmitted packets which are dropped is too high on node {{ $labels.host }} for interface {{ $labels.interface }} (current value={{ $value }}/sec, threshold={% endraw %}{{ net_tx_dropped_threshold }}/sec)'
  103. SystemSwapIn:
  104. {%- set swap_in_threshold = monitoring.swap_in_rate.warn %}
  105. if: rate(swap_in[2m]) > {{ swap_in_threshold }}
  106. {% raw %}
  107. labels:
  108. severity: warning
  109. service: system
  110. annotations:
  111. summary: 'Swap input throughput too high on {{ $labels.host }}'
  112. description: 'The rate of swap input bytes is too high on node {{ $labels.host }} (current value={{ $value }}b/s, threshold={% endraw %}{{ swap_in_threshold }}b/s).'
  113. SystemSwapOut:
  114. {%- set swap_out_threshold = monitoring.swap_out_rate.warn %}
  115. if: rate(swap_out[2m]) > {{ swap_out_threshold }}
  116. {% raw %}
  117. labels:
  118. severity: warning
  119. service: system
  120. annotations:
  121. summary: 'Swap output throughput too high on {{ $labels.host }}'
  122. description: 'The rate of swap output bytes is too high on node {{ $labels.host }} (current value={{ $value }}b/s, threshold={% endraw %}{{ swap_out_threshold }}b/s).'