mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-17 00:06:59 +00:00
add --warn-count and --crit-count options to suppress alarm noise
Alarm criteria based solely on percentage was found to be difficult to be tricky to setup in environments that has small ranges and big shared-nets mixed up together. These two new options should help making alarming more useful. Requested-by: Frank Bulk <fbulk@mypremieronline.com> Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
7f3d553c7f
commit
5cede1ff31
4 changed files with 42 additions and 5 deletions
|
|
@ -97,7 +97,9 @@ int main(int argc, char **argv)
|
|||
OPT_SNET_ALARMS = CHAR_MAX + 1,
|
||||
OPT_WARN,
|
||||
OPT_CRIT,
|
||||
OPT_MINSIZE
|
||||
OPT_MINSIZE,
|
||||
OPT_WARN_COUNT,
|
||||
OPT_CRIT_COUNT
|
||||
};
|
||||
int ret_val;
|
||||
|
||||
|
|
@ -114,6 +116,8 @@ int main(int argc, char **argv)
|
|||
{"snet-alarms", no_argument, NULL, OPT_SNET_ALARMS},
|
||||
{"warning", required_argument, NULL, OPT_WARN},
|
||||
{"critical", required_argument, NULL, OPT_CRIT},
|
||||
{"warn-count", required_argument, NULL, OPT_WARN_COUNT},
|
||||
{"crit-count", required_argument, NULL, OPT_CRIT_COUNT},
|
||||
{"minsize", required_argument, NULL, OPT_MINSIZE},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
|
@ -132,6 +136,8 @@ int main(int argc, char **argv)
|
|||
config.snet_alarms = false;
|
||||
config.warning = ALARM_WARN;
|
||||
config.critical = ALARM_CRIT;
|
||||
config.warn_count = 0x100000000; /* == 2^32 that is the entire IPv4 space */
|
||||
config.crit_count = 0x100000000; /* basically turns off the count criteria */
|
||||
/* File location defaults */
|
||||
strncpy(config.dhcpdconf_file, DHCPDCONF_FILE, MAXLEN - 1);
|
||||
strncpy(config.dhcpdlease_file, DHCPDLEASE_FILE, MAXLEN - 1);
|
||||
|
|
@ -208,6 +214,14 @@ int main(int argc, char **argv)
|
|||
strcpy(config.output_format, "a");
|
||||
config.critical = strtod_or_err(optarg, "illegal argument");
|
||||
break;
|
||||
case OPT_WARN_COUNT:
|
||||
strcpy(config.output_format, "a");
|
||||
config.warn_count = strtod_or_err(optarg, "illegal argument");
|
||||
break;
|
||||
case OPT_CRIT_COUNT:
|
||||
strcpy(config.output_format, "a");
|
||||
config.crit_count = strtod_or_err(optarg, "illegal argument");
|
||||
break;
|
||||
case OPT_MINSIZE:
|
||||
config.minsize = strtod_or_err(optarg, "illegal argument");
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue