Skip to content

Commit

Permalink
ignore squashfs type for inodes
Browse files Browse the repository at this point in the history
  • Loading branch information
aogereau committed Nov 15, 2023
1 parent 33027d6 commit 245780d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ value_unit: "%"
signals:
used:
metric: system.filesystem.inodes.usage
filter: filter('state', 'used')
filter: "(filter('state', 'used') and not filter('type', 'squashfs'))"
free:
metric: system.filesystem.inodes.usage
filter: filter('state', 'free')
filter: "(filter('state', 'free') and not filter('type', 'squashfs'))"
signal:
formula: (used / (used + free) * 100)
rules:
Expand Down
1 change: 1 addition & 0 deletions modules/smart-agent_system-common/conf/04-inodes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ value_unit: "%"
signals:
signal:
metric: percent_inodes.used
filter: not filter('fs_type', 'squashfs')
rules:
critical:
threshold: 95
Expand Down
6 changes: 3 additions & 3 deletions modules/smart-agent_system-common/detectors-gen.tf
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ resource "signalfx_detector" "filesystem_inodes" {
}

program_text = <<-EOF
used = data('system.filesystem.inodes.usage', filter=filter('state', 'used') and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
free = data('system.filesystem.inodes.usage', filter=filter('state', 'free') and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
used = data('system.filesystem.inodes.usage', filter=(filter('state', 'used') and not filter('type', 'squashfs')) and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
free = data('system.filesystem.inodes.usage', filter=(filter('state', 'free') and not filter('type', 'squashfs')) and ${module.filtering.signalflow})${var.filesystem_inodes_aggregation_function}${var.filesystem_inodes_transformation_function}
signal = (used / (used + free) * 100).publish('signal')
detect(when(signal > ${var.filesystem_inodes_threshold_critical}, lasting=%{if var.filesystem_inodes_lasting_duration_critical == null}None%{else}'${var.filesystem_inodes_lasting_duration_critical}'%{endif}, at_least=${var.filesystem_inodes_at_least_percentage_critical})).publish('CRIT')
detect(when(signal > ${var.filesystem_inodes_threshold_major}, lasting=%{if var.filesystem_inodes_lasting_duration_major == null}None%{else}'${var.filesystem_inodes_lasting_duration_major}'%{endif}, at_least=${var.filesystem_inodes_at_least_percentage_major}) and (not when(signal > ${var.filesystem_inodes_threshold_critical}, lasting=%{if var.filesystem_inodes_lasting_duration_critical == null}None%{else}'${var.filesystem_inodes_lasting_duration_critical}'%{endif}, at_least=${var.filesystem_inodes_at_least_percentage_critical}))).publish('MAJOR')
Expand Down Expand Up @@ -218,7 +218,7 @@ resource "signalfx_detector" "disk_inodes" {
}

program_text = <<-EOF
signal = data('percent_inodes.used', filter=${module.filtering.signalflow})${var.disk_inodes_aggregation_function}${var.disk_inodes_transformation_function}.publish('signal')
signal = data('percent_inodes.used', filter=not filter('fs_type', 'squashfs') and ${module.filtering.signalflow})${var.disk_inodes_aggregation_function}${var.disk_inodes_transformation_function}.publish('signal')
detect(when(signal > ${var.disk_inodes_threshold_critical}, lasting=%{if var.disk_inodes_lasting_duration_critical == null}None%{else}'${var.disk_inodes_lasting_duration_critical}'%{endif}, at_least=${var.disk_inodes_at_least_percentage_critical})).publish('CRIT')
detect(when(signal > ${var.disk_inodes_threshold_major}, lasting=%{if var.disk_inodes_lasting_duration_major == null}None%{else}'${var.disk_inodes_lasting_duration_major}'%{endif}, at_least=${var.disk_inodes_at_least_percentage_major}) and (not when(signal > ${var.disk_inodes_threshold_critical}, lasting=%{if var.disk_inodes_lasting_duration_critical == null}None%{else}'${var.disk_inodes_lasting_duration_critical}'%{endif}, at_least=${var.disk_inodes_at_least_percentage_critical}))).publish('MAJOR')
EOF
Expand Down

0 comments on commit 245780d

Please sign in to comment.