diff options
author | rincewind <rincewind@example.com> | 2021-09-25 21:24:45 (GMT) |
---|---|---|
committer | rincewind <rincewind@example.com> | 2021-09-25 21:24:45 (GMT) |
commit | 4621427ba8cbfab4815e65d35a728ad51ad8c391 (patch) | |
tree | cb6feecbe00c75fcd1ab0355a32355c2d0d26f22 /gl/xalloc-oversized.h | |
parent | 66e245375992c3942dbd5761f8b991e52bf5f9ab (diff) | |
download | monitoring-plugins-4621427ba8cbfab4815e65d35a728ad51ad8c391.tar.gz |
check_swap: Fix perfdata und thresholds for big values and simplify code
The original problem was https://github.com/monitoring-plugins/monitoring-plugins/pull/1705
where the performance data output of check_swap did not conform to
the parser logic of a monitoring system (which decided to go for
"correct" SI or IEC units.
The PR was accompanied by a change to byte values in the performance
data which broke the _perfdata_ helper function which could not handle
values of this size.
The fix for this, was to use _fperfdata_ which could, but would
use float values.
I didn't like that (since all values here are discreet) and this
is my proposal for a fix for the problem.
It introduces some helper functions which do now explicitely work
with (u)int64_t, including a special version of the _perfdata_ helper.
In the process of introducing this to check_swap, I stumbled over
several sections of the check_swap code which I found problematic.
Therefore I tried to simplify the code and make it more readable
and less redundant.
I am kinda sorry about this, but sincerely hope my changes can
be helpful.
Diffstat (limited to 'gl/xalloc-oversized.h')
0 files changed, 0 insertions, 0 deletions