cgroups.conf 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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 ${label:device} 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. options: no-clear-notification
  61. info: ratio of average number of received packets for the network interface ${label:device} over the last 10 seconds, \
  62. compared to the rate over the last minute
  63. to: sysadmin
  64. # ---------------------------------K8s containers--------------------------------------------
  65. template: k8s_cgroup_10min_cpu_usage
  66. on: k8s.cgroup.cpu_limit
  67. class: Utilization
  68. type: Cgroups
  69. component: CPU
  70. os: linux
  71. hosts: *
  72. lookup: average -10m unaligned
  73. units: %
  74. every: 1m
  75. warn: $this > (($status >= $WARNING) ? (75) : (85))
  76. delay: down 15m multiplier 1.5 max 1h
  77. info: average cgroup CPU utilization over the last 10 minutes
  78. to: sysadmin
  79. template: k8s_cgroup_ram_in_use
  80. on: k8s.cgroup.mem_usage
  81. class: Utilization
  82. type: Cgroups
  83. component: Memory
  84. os: linux
  85. hosts: *
  86. calc: ($ram) * 100 / $memory_limit
  87. units: %
  88. every: 10s
  89. warn: $this > (($status >= $WARNING) ? (80) : (90))
  90. crit: $this > (($status == $CRITICAL) ? (90) : (98))
  91. delay: down 15m multiplier 1.5 max 1h
  92. info: cgroup memory utilization
  93. to: sysadmin
  94. # check for packet storms
  95. # 1. calculate the rate packets are received in 1m: 1m_received_packets_rate
  96. # 2. do the same for the last 10s
  97. # 3. raise an alarm if the later is 10x or 20x the first
  98. # we assume the minimum packet storm should at least have
  99. # 10000 packets/s, average of the last 10 seconds
  100. template: k8s_cgroup_1m_received_packets_rate
  101. on: k8s.cgroup.net_packets
  102. class: Workload
  103. type: Cgroups
  104. component: Network
  105. hosts: *
  106. lookup: average -1m unaligned of received
  107. units: packets
  108. every: 10s
  109. info: average number of packets received by the network interface ${label:device} over the last minute
  110. template: k8s_cgroup_10s_received_packets_storm
  111. on: k8s.cgroup.net_packets
  112. class: Workload
  113. type: Cgroups
  114. component: Network
  115. hosts: *
  116. lookup: average -10s unaligned of received
  117. calc: $this * 100 / (($k8s_cgroup_10s_received_packets_storm < 1000)?(1000):($k8s_cgroup_10s_received_packets_storm))
  118. every: 10s
  119. units: %
  120. warn: $this > (($status >= $WARNING)?(200):(5000))
  121. options: no-clear-notification
  122. info: ratio of average number of received packets for the network interface ${label:device} over the last 10 seconds, \
  123. compared to the rate over the last minute
  124. to: sysadmin