mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 16:26:59 +00:00
output: make --skip-ok to effect --perfdata
Reported-by: Frank Bulk <fbulk@mypremieronline.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
ef5421ed05
commit
15f08bbf02
1 changed files with 9 additions and 6 deletions
15
src/output.c
15
src/output.c
|
|
@ -973,7 +973,6 @@ static int output_alarming(struct conf_t *state)
|
|||
{
|
||||
FILE *outfile;
|
||||
struct range_t *range_p;
|
||||
double range_size;
|
||||
struct shared_network_t *shared_p;
|
||||
struct output_helper_t oh;
|
||||
unsigned int i;
|
||||
|
|
@ -982,7 +981,6 @@ static int output_alarming(struct conf_t *state)
|
|||
|
||||
outfile = open_outfile(state);
|
||||
range_p = state->ranges;
|
||||
range_size = get_range_size(range_p);
|
||||
|
||||
if (state->number_limit & R_BIT) {
|
||||
for (i = 0; i < state->num_ranges; i++) {
|
||||
|
|
@ -1065,13 +1063,15 @@ static int output_alarming(struct conf_t *state)
|
|||
if (state->perfdata == 1 && state->number_limit & R_BIT) {
|
||||
for (i = 0; i < state->num_ranges; i++) {
|
||||
range_p--;
|
||||
range_size = get_range_size(range_p);
|
||||
if (state->minsize < range_size) {
|
||||
range_output_helper(state, &oh, range_p);
|
||||
if (state->skip_ok && oh.status == STATUS_OK)
|
||||
continue;
|
||||
if (state->minsize < oh.range_size) {
|
||||
fprintf(outfile, " %s_r=", ntop_ipaddr(&range_p->first_ip));
|
||||
fprintf(outfile, "%g;%g;%g;0;%g",
|
||||
range_p->count,
|
||||
(range_size * state->warning / 100),
|
||||
(range_size * state->critical / 100), range_size);
|
||||
(oh.range_size * state->warning / 100),
|
||||
(oh.range_size * state->critical / 100), oh.range_size);
|
||||
fprintf(outfile, " %s_rt=%g",
|
||||
ntop_ipaddr(&range_p->first_ip), range_p->touched);
|
||||
if (state->backups_found == 1) {
|
||||
|
|
@ -1097,6 +1097,9 @@ static int output_alarming(struct conf_t *state)
|
|||
}
|
||||
if (state->perfdata == 1 && state->header_limit & R_BIT) {
|
||||
for (shared_p = state->shared_net_root->next; shared_p; shared_p = shared_p->next) {
|
||||
shnet_output_helper(state, &oh, shared_p);
|
||||
if (state->skip_ok && oh.status == STATUS_OK)
|
||||
continue;
|
||||
if (state->minsize < shared_p->available) {
|
||||
fprintf(outfile, " '%s_s'=%g;%g;%g;0;%g",
|
||||
shared_p->name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue