mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 08:16:59 +00:00
add --warn-count and --crit-count test, and fix related bug
I should consider writing tests before features. Sadly recently added new options did not even work. Oh well, at least I did not release them before noticing this. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
15802d6648
commit
da4b7a783a
4 changed files with 57 additions and 2 deletions
|
|
@ -974,9 +974,9 @@ int output_alarming(void)
|
|||
perc =
|
||||
shared_p->available ==
|
||||
0 ? 100 : (float)(100 * shared_p->used) / shared_p->available;
|
||||
if (config.critical < perc && shared_p->available < config.crit_count)
|
||||
if (config.critical < perc && shared_p->used < config.crit_count)
|
||||
sc++;
|
||||
else if (config.warning < perc && shared_p->available < config.warn_count)
|
||||
else if (config.warning < perc && shared_p->used < config.warn_count)
|
||||
sw++;
|
||||
else
|
||||
so++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue