Skip to content

Commit

Permalink
reverse condition
Browse files Browse the repository at this point in the history
  • Loading branch information
xp-1000 committed Nov 17, 2021
1 parent 41df898 commit 0bccabf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/smart-agent_system-common/conf/02-load.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ signals:
num_processors:
metric: cpu.num_processors
signal:
formula: '(${var.per_cpu_enabled ? "load / num_processors" : "load"})'
formula: '(${var.per_cpu_enabled ? "load" : "load/num_processors"})'
rules:
critical:
threshold: 2.5
Expand Down
2 changes: 1 addition & 1 deletion modules/smart-agent_system-common/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resource "signalfx_detector" "load" {
program_text = <<-EOF
load = data('load.midterm', filter=${module.filtering.signalflow})${var.load_aggregation_function}${var.load_transformation_function}
num_processors = data('cpu.num_processors', filter=${module.filtering.signalflow})${var.load_aggregation_function}${var.load_transformation_function}
signal = (${var.per_cpu_enabled ? "load / num_processors" : "load"}).publish('signal')
signal = (${var.per_cpu_enabled ? "load" : "load/num_processors"}).publish('signal')
detect(when(signal > ${var.load_threshold_critical}, lasting=%{if var.load_lasting_duration_critical == null}None%{else}'${var.load_lasting_duration_critical}'%{endif}, at_least=${var.load_at_least_percentage_critical})).publish('CRIT')
detect(when(signal > ${var.load_threshold_major}, lasting=%{if var.load_lasting_duration_major == null}None%{else}'${var.load_lasting_duration_major}'%{endif}, at_least=${var.load_at_least_percentage_major}) and (not when(signal > ${var.load_threshold_critical}, lasting=%{if var.load_lasting_duration_critical == null}None%{else}'${var.load_lasting_duration_critical}'%{endif}, at_least=${var.load_at_least_percentage_critical}))).publish('MAJOR')
EOF
Expand Down

0 comments on commit 0bccabf

Please sign in to comment.