Browse Source

fix(health): don't assume 2 cores if the number is unknown (#14265)

Ilya Mashchenko 2 years ago
parent
commit
3e2924fd46
1 changed files with 4 additions and 1 deletions
  1. 4 1
      health/health.d/load.conf

+ 4 - 1
health/health.d/load.conf

@@ -11,7 +11,7 @@
 component: Load
        os: linux
     hosts: *
-     calc: ($active_processors == nan or $active_processors == inf or $active_processors < 2) ? ( 2 ) : ( $active_processors )
+     calc: ($active_processors < 2) ? ( 2 ) : ( $active_processors )
     units: cpus
     every: 1m
      info: number of active CPU cores in the system
@@ -28,6 +28,7 @@ component: Load
        os: linux
     hosts: *
    lookup: max -1m unaligned of load15
+     calc: ($load_cpu_number == nan) ? (nan) : ($this)
     units: load
     every: 1m
      warn: ($this * 100 / $load_cpu_number) > (($status >= $WARNING) ? 175 : 200)
@@ -43,6 +44,7 @@ component: Load
        os: linux
     hosts: *
    lookup: max -1m unaligned of load5
+     calc: ($load_cpu_number == nan) ? (nan) : ($this)
     units: load
     every: 1m
      warn: ($this * 100 / $load_cpu_number) > (($status >= $WARNING) ? 350 : 400)
@@ -58,6 +60,7 @@ component: Load
        os: linux
     hosts: *
    lookup: max -1m unaligned of load1
+     calc: ($load_cpu_number == nan) ? (nan) : ($this)
     units: load
     every: 1m
      warn: ($this * 100 / $load_cpu_number) > (($status >= $WARNING) ? 700 : 800)