diff options
author | Sven Nierlein <sven@nierlein.de> | 2022-07-25 10:00:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 10:00:18 +0200 |
commit | a01de7b33dee837e7a474d9e00131942d7f177f0 (patch) | |
tree | 9f48f038a9a027bad9a829ec267c052cd8537bc8 /plugins | |
parent | 9f2a9ca3d72023ff9b5707d1872c54d65edc9017 (diff) | |
download | monitoring-plugins-a01de7b33dee837e7a474d9e00131942d7f177f0.tar.gz |
fix parsing swap values (#1780)
tmp_KB changed from float to uint64, so change the sscanf format accordingly.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_swap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/check_swap.c b/plugins/check_swap.c index bb854beb..6c9418f2 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c | |||
@@ -150,7 +150,7 @@ main (int argc, char **argv) | |||
150 | * The following sscanf call looks for lines looking like: "SwapTotal: 123" and "SwapFree: 123" | 150 | * The following sscanf call looks for lines looking like: "SwapTotal: 123" and "SwapFree: 123" |
151 | * This format exists at least on Debian Linux with a 5.* kernel | 151 | * This format exists at least on Debian Linux with a 5.* kernel |
152 | */ | 152 | */ |
153 | else if (sscanf (input_buffer, "%*[S]%*[w]%*[a]%*[p]%[TotalFreCchd]%*[:] %f %*[k]%*[B]", str, &tmp_KB)) { | 153 | else if (sscanf (input_buffer, "%*[S]%*[w]%*[a]%*[p]%[TotalFreCchd]%*[:] %lu %*[k]%*[B]", str, &tmp_KB)) { |
154 | if (verbose >= 3) { | 154 | if (verbose >= 3) { |
155 | printf("Got %s with %lu\n", str, tmp_KB); | 155 | printf("Got %s with %lu\n", str, tmp_KB); |
156 | } | 156 | } |