Saltstack Official Linux Formula
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

103 lines
5.0KB

  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. SystemDiskInodesTooLow:
  25. if: 'predict_linear(disk_inodes_free[1h], 8*3600) < 0'
  26. {% raw %}
  27. labels:
  28. severity: warning
  29. service: system
  30. annotations:
  31. summary: 'Free inodes for {{ $labels.path }} too low on {{ $labels.host }}'
  32. description: 'The disk inodes ({{ $labels.path }}) will be full in less than 8 hours on {{ $labels.host }}.'
  33. {% endraw %}
  34. SystemMemoryAvailableTooLow:
  35. {%- set mem_avail_threshold = monitoring.free_memory_percentage.warn|float %}
  36. if: avg_over_time(mem_available_percent[5m]) < {{ mem_avail_threshold }}
  37. {% raw %}
  38. labels:
  39. severity: warning
  40. service: system
  41. annotations:
  42. summary: 'Free memory too low on {{ $labels.host }}'
  43. description: 'The percentage of free memory is too low on node {{ $labels.host }} (current value={{ $value }}%, threshold={% endraw %}{{ mem_avail_threshold }}%).'
  44. SystemLoad5TooHigh:
  45. if: system_load5 / system_n_cpus > {{ monitoring.load_5.warn }}
  46. {% raw %}
  47. labels:
  48. severity: warning
  49. service: system
  50. annotations:
  51. summary: 'High system load (5m) on {{ $labels.host }}'
  52. description: 'The 5-minutes system load is too high on node {{ $labels.host }} (current value={{ $value }}, threshold={% endraw %}{{ monitoring.load_5.warn }}).'
  53. SystemRxPacketsDroppedTooHigh:
  54. {%- set net_rx_dropped_threshold = monitoring.rx_packets_dropped_rate.warn %}
  55. if: rate(net_drop_in[1m]) > {{ net_rx_dropped_threshold }}
  56. {% raw %}
  57. labels:
  58. severity: warning
  59. service: system
  60. annotations:
  61. summary: 'Too many received packets dropped on {{ $labels.host }} for interface {{ $labels.interface }}'
  62. description: 'The rate of received packets which are dropped is too high on node {{ $labels.host }} for interface {{ $label.interface }} (current value={{ $value }}/sec, threshold={% endraw %}{{ net_rx_dropped_threshold }}/sec)'
  63. SystemTxPacketsDroppedTooHigh:
  64. {%- set net_tx_dropped_threshold = monitoring.tx_packets_dropped_rate.warn %}
  65. if: rate(net_drop_out[1m]) > {{ net_tx_dropped_threshold }}
  66. {% raw %}
  67. labels:
  68. severity: warning
  69. service: system
  70. annotations:
  71. summary: 'Too many transmitted packets dropped on {{ $labels.host }} for interface {{ $labels.interface }}'
  72. description: 'The rate of transmitted packets which are dropped is too high on node {{ $labels.host }} for interface {{ $label.interface }} (current value={{ $value }}/sec, threshold={% endraw %}{{ net_tx_dropped_threshold }}/sec)'
  73. SystemSwapUsed:
  74. {%- set swap_used_threshold = monitoring.swap.warn.strip('%')|float %}
  75. if: avg_over_time(swap_used_percent[1m]) > {{ swap_used_threshold }}
  76. {% raw %}
  77. labels:
  78. severity: warning
  79. service: system
  80. annotations:
  81. summary: 'Swap usage too high on {{ $labels.host }}'
  82. description: 'The average percentage of used swap is too high on node {{ $labels.host }} (current value={{ $value }}%, threshold={% endraw %}{{ swap_used_threshold }}%)'
  83. SystemSwapIn:
  84. {%- set swap_in_threshold = monitoring.swap_in_rate.warn %}
  85. if: rate(swap_in[2m]) > {{ swap_in_threshold }}
  86. {% raw %}
  87. labels:
  88. severity: warning
  89. service: system
  90. annotations:
  91. summary: 'Swap input throughput too high on {{ $labels.host }}'
  92. 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).'
  93. SystemSwapOut:
  94. {%- set swap_out_threshold = monitoring.swap_out_rate.warn %}
  95. if: rate(swap_out[2m]) > {{ swap_out_threshold }}
  96. {% raw %}
  97. labels:
  98. severity: warning
  99. service: system
  100. annotations:
  101. summary: 'Swap output throughput too high on {{ $labels.host }}'
  102. 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).'