mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 08:16:59 +00:00
output: use symbolic exit values for nagios commands
And ensure the exit values are set no matter how user will limit output. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
5454ab7086
commit
eb55946595
2 changed files with 15 additions and 3 deletions
11
src/output.c
11
src/output.c
|
|
@ -1070,16 +1070,21 @@ int output_alarming(void)
|
|||
shared_p++;
|
||||
}
|
||||
}
|
||||
|
||||
if (sc || rc)
|
||||
ret_val = STATE_CRITICAL;
|
||||
else if (sw || rw)
|
||||
ret_val = STATE_WARNING;
|
||||
else
|
||||
ret_val = STATE_OK;
|
||||
|
||||
if ((0 < rc && config.output_limit[1] & BIT1) || (0 < sc && config.output_limit[1] & BIT2)) {
|
||||
ret_val = 2;
|
||||
fprintf(outfile, "CRITICAL: %s:",
|
||||
program_name);
|
||||
} else if ((0 < rw && config.output_limit[1] & BIT1) || (0 < sw && config.output_limit[1] & BIT2)) {
|
||||
ret_val = 1;
|
||||
fprintf(outfile, "WARNING: %s:",
|
||||
program_name);
|
||||
} else {
|
||||
ret_val = 0;
|
||||
if (config.output_limit[1] & BIT3)
|
||||
fprintf(outfile, "OK:");
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue