From 7dbe8b29980da0d8e9dea2ce8750fbe8807fb333 Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Thu, 21 Nov 2024 16:38:24 +0100 Subject: [PATCH 1/3] Issue #148: [Linux] Enhance filesystem utilization calculation * Updated usage calculation in the awk script --- src/main/connector/system/Linux/Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/connector/system/Linux/Linux.yaml b/src/main/connector/system/Linux/Linux.yaml index 3b141f2..fc03463 100644 --- a/src/main/connector/system/Linux/Linux.yaml +++ b/src/main/connector/system/Linux/Linux.yaml @@ -150,7 +150,7 @@ monitors: commandLine: /usr/bin/df -B1 --output=source,target,fstype,used,avail,size computes: - type: awk - script: NR > 1 {print $1 "(" $2 ")" ";" $2 ";" $3 ";" $4 ";" $5 ";" $4 / $6 ";" $5 / $6} + script: NR > 1 {print $1 "(" $2 ")" ";" $2 ";" $3 ";" $4 ";" $5 ";" $4 / ($4 + $5) ";" $5 / ($4 + $5)} mapping: source: ${source::fileSystemInfo} attributes: From 3077968b9c6bd0ad1a478e7abe242ec8dba62a59 Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Fri, 22 Nov 2024 09:44:49 +0100 Subject: [PATCH 2/3] Issue #148: [Linux] Enhance filesystem utilization calculation Added reserved space computation Co-authored-by: Bertrand Martin <32521698+bertysentry@users.noreply.github.com> --- src/main/connector/system/Linux/Linux.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/connector/system/Linux/Linux.yaml b/src/main/connector/system/Linux/Linux.yaml index fc03463..40ac367 100644 --- a/src/main/connector/system/Linux/Linux.yaml +++ b/src/main/connector/system/Linux/Linux.yaml @@ -150,7 +150,7 @@ monitors: commandLine: /usr/bin/df -B1 --output=source,target,fstype,used,avail,size computes: - type: awk - script: NR > 1 {print $1 "(" $2 ")" ";" $2 ";" $3 ";" $4 ";" $5 ";" $4 / ($4 + $5) ";" $5 / ($4 + $5)} + script: NR > 1 {print $1 "(" $2 ")" ";" $2 ";" $3 ";" $4 ";" $5 ";" $4 / $6 ";" $5 / $6 ";" $6 - ($4 + $5) ";" ($6 - ($4 + $5)) / $6} mapping: source: ${source::fileSystemInfo} attributes: From 3e1933bcd40fbae385dd78b1c6af3f8255dba76f Mon Sep 17 00:00:00 2001 From: Nassim Boutekedjiret Date: Fri, 22 Nov 2024 12:09:09 +0100 Subject: [PATCH 3/3] Issue #148: [Linux] Enhance filesystem utilization calculation - Update the Linux connector mapping to calculate reserved space usage. --- src/main/connector/system/Linux/Linux.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/connector/system/Linux/Linux.yaml b/src/main/connector/system/Linux/Linux.yaml index 40ac367..4263bc2 100644 --- a/src/main/connector/system/Linux/Linux.yaml +++ b/src/main/connector/system/Linux/Linux.yaml @@ -161,8 +161,10 @@ monitors: metrics: system.filesystem.usage{system.filesystem.state="used"}: $4 system.filesystem.usage{system.filesystem.state="free"}: $5 + system.filesystem.usage{system.filesystem.state="reserved"}: $8 system.filesystem.utilization{system.filesystem.state="used"}: $6 system.filesystem.utilization{system.filesystem.state="free"}: $7 + system.filesystem.utilization{system.filesystem.state="reserved"}: $9 system: simple: sources: