cgroups.conf 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. # you can disable an alarm notification by setting the 'to' line to: silent
  2. template: cgroup_10min_cpu_usage
  3. on: cgroup.cpu_limit
  4. class: Utilization
  5. type: Cgroups
  6. component: CPU
  7. os: linux
  8. hosts: *
  9. lookup: average -10m unaligned
  10. units: %
  11. every: 1m
  12. warn: $this > (($status >= $WARNING) ? (75) : (85))
  13. crit: $this > (($status == $CRITICAL) ? (85) : (95))
  14. delay: down 15m multiplier 1.5 max 1h
  15. info: average cgroup CPU utilization over the last 10 minutes
  16. to: sysadmin
  17. template: cgroup_ram_in_use
  18. on: cgroup.mem_usage
  19. class: Utilization
  20. type: Cgroups
  21. component: Memory
  22. os: linux
  23. hosts: *
  24. calc: ($ram) * 100 / $memory_limit
  25. units: %
  26. every: 10s
  27. warn: $this > (($status >= $WARNING) ? (80) : (90))
  28. crit: $this > (($status == $CRITICAL) ? (90) : (98))
  29. delay: down 15m multiplier 1.5 max 1h
  30. info: cgroup memory utilization
  31. to: sysadmin
  32. # -----------------------------------------------------------------------------
  33. # check for packet storms
  34. # 1. calculate the rate packets are received in 1m: 1m_received_packets_rate
  35. # 2. do the same for the last 10s
  36. # 3. raise an alarm if the later is 10x or 20x the first
  37. # we assume the minimum packet storm should at least have
  38. # 10000 packets/s, average of the last 10 seconds
  39. template: cgroup_1m_received_packets_rate
  40. on: cgroup.net_packets
  41. class: Workload
  42. type: Cgroups
  43. component: Network
  44. hosts: *
  45. lookup: average -1m unaligned of received
  46. units: packets
  47. every: 10s
  48. info: average number of packets received by the network interface $family over the last minute
  49. template: cgroup_10s_received_packets_storm
  50. on: cgroup.net_packets
  51. class: Workload
  52. type: Cgroups
  53. component: Network
  54. hosts: *
  55. lookup: average -10s unaligned of received
  56. calc: $this * 100 / (($1m_received_packets_rate < 1000)?(1000):($1m_received_packets_rate))
  57. every: 10s
  58. units: %
  59. warn: $this > (($status >= $WARNING)?(200):(5000))
  60. crit: $this > (($status == $CRITICAL)?(5000):(6000))
  61. options: no-clear-notification
  62. info: ratio of average number of received packets for the network interface $family over the last 10 seconds, \
  63. compared to the rate over the last minute
  64. to: sysadmin
  65. # ---------------------------------K8s containers--------------------------------------------
  66. template: k8s_cgroup_10min_cpu_usage
  67. on: k8s.cgroup.cpu_limit
  68. class: Utilization
  69. type: Cgroups
  70. component: CPU
  71. os: linux
  72. hosts: *
  73. lookup: average -10m unaligned
  74. units: %
  75. every: 1m
  76. warn: $this > (($status >= $WARNING) ? (75) : (85))
  77. crit: $this > (($status == $CRITICAL) ? (85) : (95))
  78. delay: down 15m multiplier 1.5 max 1h
  79. info: average cgroup CPU utilization over the last 10 minutes
  80. to: sysadmin
  81. template: k8s_cgroup_ram_in_use
  82. on: k8s.cgroup.mem_usage
  83. class: Utilization
  84. type: Cgroups
  85. component: Memory
  86. os: linux
  87. hosts: *
  88. calc: ($ram) * 100 / $memory_limit
  89. units: %
  90. every: 10s
  91. warn: $this > (($status >= $WARNING) ? (80) : (90))
  92. crit: $this > (($status == $CRITICAL) ? (90) : (98))
  93. delay: down 15m multiplier 1.5 max 1h
  94. info: cgroup memory utilization
  95. to: sysadmin
  96. # check for packet storms
  97. # 1. calculate the rate packets are received in 1m: 1m_received_packets_rate
  98. # 2. do the same for the last 10s
  99. # 3. raise an alarm if the later is 10x or 20x the first
  100. # we assume the minimum packet storm should at least have
  101. # 10000 packets/s, average of the last 10 seconds
  102. template: k8s_cgroup_1m_received_packets_rate
  103. on: k8s.cgroup.net_packets
  104. class: Workload
  105. type: Cgroups
  106. component: Network
  107. hosts: *
  108. lookup: average -1m unaligned of received
  109. units: packets
  110. every: 10s
  111. info: average number of packets received by the network interface $family over the last minute
  112. template: k8s_cgroup_10s_received_packets_storm
  113. on: k8s.cgroup.net_packets
  114. class: Workload
  115. type: Cgroups
  116. component: Network
  117. hosts: *
  118. lookup: average -10s unaligned of received
  119. calc: $this * 100 / (($k8s_cgroup_10s_received_packets_storm < 1000)?(1000):($k8s_cgroup_10s_received_packets_storm))
  120. every: 10s
  121. units: %
  122. warn: $this > (($status >= $WARNING)?(200):(5000))
  123. crit: $this > (($status == $CRITICAL)?(5000):(6000))
  124. options: no-clear-notification
  125. info: ratio of average number of received packets for the network interface $family over the last 10 seconds, \
  126. compared to the rate over the last minute
  127. to: sysadmin