-static int ut_config_type_datasource(threshold_t *th, oconfig_item_t *ci) {
- if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
- WARNING("threshold values: The `DataSource' option needs exactly one "
- "string argument.");
- return (-1);
- }
-
- sstrncpy(th->data_source, ci->values[0].value.string,
- sizeof(th->data_source));
-
- return (0);
-} /* int ut_config_type_datasource */
-
-static int ut_config_type_instance(threshold_t *th, oconfig_item_t *ci) {
- if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) {
- WARNING("threshold values: The `Instance' option needs exactly one "
- "string argument.");
- return (-1);
- }
-
- sstrncpy(th->type_instance, ci->values[0].value.string,
- sizeof(th->type_instance));
-
- return (0);
-} /* int ut_config_type_instance */
-
-static int ut_config_type_max(threshold_t *th, oconfig_item_t *ci) {
- if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_NUMBER)) {
- WARNING("threshold values: The `%s' option needs exactly one "
- "number argument.",
- ci->key);
- return (-1);
- }
-
- if (strcasecmp(ci->key, "WarningMax") == 0)
- th->warning_max = ci->values[0].value.number;
- else
- th->failure_max = ci->values[0].value.number;
-
- return (0);
-} /* int ut_config_type_max */
-
-static int ut_config_type_min(threshold_t *th, oconfig_item_t *ci) {
- if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_NUMBER)) {
- WARNING("threshold values: The `%s' option needs exactly one "
- "number argument.",
- ci->key);
- return (-1);
- }
-
- if (strcasecmp(ci->key, "WarningMin") == 0)
- th->warning_min = ci->values[0].value.number;
- else
- th->failure_min = ci->values[0].value.number;
-
- return (0);
-} /* int ut_config_type_min */
-
-static int ut_config_type_hits(threshold_t *th, oconfig_item_t *ci) {
- if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_NUMBER)) {
- WARNING("threshold values: The `%s' option needs exactly one "
- "number argument.",
- ci->key);
- return (-1);
- }
-
- th->hits = ci->values[0].value.number;
-
- return (0);
-} /* int ut_config_type_hits */
-
-static int ut_config_type_hysteresis(threshold_t *th, oconfig_item_t *ci) {
- if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_NUMBER)) {
- WARNING("threshold values: The `%s' option needs exactly one "
- "number argument.",
- ci->key);
- return (-1);
- }
-
- th->hysteresis = ci->values[0].value.number;
-
- return (0);
-} /* int ut_config_type_hysteresis */
-