cm->flags |= UTILS_MATCH_CF_GAUGE_MAX;
else if (strcasecmp ("GaugeLast", ci->values[0].value.string) == 0)
cm->flags |= UTILS_MATCH_CF_GAUGE_LAST;
+ else if (strcasecmp ("GaugeInc", ci->values[0].value.string) == 0)
+ cm->flags |= UTILS_MATCH_CF_GAUGE_INC;
+ else if (strcasecmp ("GaugeAdd", ci->values[0].value.string) == 0)
+ cm->flags |= UTILS_MATCH_CF_GAUGE_ADD;
else
cm->flags = 0;
}
gauge_t value;
char *endptr = NULL;
+ if (data->ds_type & UTILS_MATCH_CF_GAUGE_INC)
+ {
+ data->value.gauge = isnan (data->value.gauge) ? 1 : data->value.gauge + 1;
+ data->values_num++;
+ return(0);
+ }
+
if (matches_num < 2)
return (-1);
if (data->value.gauge < value)
data->value.gauge = value;
}
+ else if (data->ds_type & UTILS_MATCH_CF_GAUGE_ADD)
+ {
+ data->value.gauge += value;
+ }
else
{
ERROR ("utils_match: default_callback: obj->ds_type is invalid!");
#define UTILS_MATCH_CF_GAUGE_MIN 0x02
#define UTILS_MATCH_CF_GAUGE_MAX 0x04
#define UTILS_MATCH_CF_GAUGE_LAST 0x08
+#define UTILS_MATCH_CF_GAUGE_INC 0x09
+#define UTILS_MATCH_CF_GAUGE_ADD 0x10
#define UTILS_MATCH_CF_COUNTER_SET 0x01
#define UTILS_MATCH_CF_COUNTER_ADD 0x02