|
@@ -24,7 +24,7 @@
|
|
#define HEALTH_DELAY_KEY "delay"
|
|
#define HEALTH_DELAY_KEY "delay"
|
|
#define HEALTH_OPTIONS_KEY "options"
|
|
#define HEALTH_OPTIONS_KEY "options"
|
|
#define HEALTH_REPEAT_KEY "repeat"
|
|
#define HEALTH_REPEAT_KEY "repeat"
|
|
-#define HEALTH_LABEL_KEY "label"
|
|
|
|
|
|
+#define HEALTH_HOST_LABEL_KEY "host labels"
|
|
|
|
|
|
static inline int rrdcalc_add_alarm_from_config(RRDHOST *host, RRDCALC *rc) {
|
|
static inline int rrdcalc_add_alarm_from_config(RRDHOST *host, RRDCALC *rc) {
|
|
if(!rc->chart) {
|
|
if(!rc->chart) {
|
|
@@ -499,7 +499,7 @@ static int health_readfile(const char *filename, void *data) {
|
|
hash_delay = 0,
|
|
hash_delay = 0,
|
|
hash_options = 0,
|
|
hash_options = 0,
|
|
hash_repeat = 0,
|
|
hash_repeat = 0,
|
|
- hash_label = 0;
|
|
|
|
|
|
+ hash_host_label = 0;
|
|
|
|
|
|
char buffer[HEALTH_CONF_MAX_LINE + 1];
|
|
char buffer[HEALTH_CONF_MAX_LINE + 1];
|
|
|
|
|
|
@@ -524,7 +524,7 @@ static int health_readfile(const char *filename, void *data) {
|
|
hash_delay = simple_uhash(HEALTH_DELAY_KEY);
|
|
hash_delay = simple_uhash(HEALTH_DELAY_KEY);
|
|
hash_options = simple_uhash(HEALTH_OPTIONS_KEY);
|
|
hash_options = simple_uhash(HEALTH_OPTIONS_KEY);
|
|
hash_repeat = simple_uhash(HEALTH_REPEAT_KEY);
|
|
hash_repeat = simple_uhash(HEALTH_REPEAT_KEY);
|
|
- hash_label = simple_uhash(HEALTH_LABEL_KEY);
|
|
|
|
|
|
+ hash_host_label = simple_uhash(HEALTH_HOST_LABEL_KEY);
|
|
}
|
|
}
|
|
|
|
|
|
FILE *fp = fopen(filename, "r");
|
|
FILE *fp = fopen(filename, "r");
|
|
@@ -798,7 +798,7 @@ static int health_readfile(const char *filename, void *data) {
|
|
&rc->warn_repeat_every,
|
|
&rc->warn_repeat_every,
|
|
&rc->crit_repeat_every);
|
|
&rc->crit_repeat_every);
|
|
}
|
|
}
|
|
- else if(hash == hash_label && !strcasecmp(key, HEALTH_LABEL_KEY)) {
|
|
|
|
|
|
+ else if(hash == hash_host_label && !strcasecmp(key, HEALTH_HOST_LABEL_KEY)) {
|
|
if(rc->labels) {
|
|
if(rc->labels) {
|
|
if(strcmp(rc->labels, value) != 0)
|
|
if(strcmp(rc->labels, value) != 0)
|
|
error("Health configuration at line %zu of file '%s' for alarm '%s' has key '%s' twice, once with value '%s' and later with value '%s'.",
|
|
error("Health configuration at line %zu of file '%s' for alarm '%s' has key '%s' twice, once with value '%s' and later with value '%s'.",
|
|
@@ -943,7 +943,7 @@ static int health_readfile(const char *filename, void *data) {
|
|
&rt->warn_repeat_every,
|
|
&rt->warn_repeat_every,
|
|
&rt->crit_repeat_every);
|
|
&rt->crit_repeat_every);
|
|
}
|
|
}
|
|
- else if(hash == hash_label && !strcasecmp(key, HEALTH_LABEL_KEY)) {
|
|
|
|
|
|
+ else if(hash == hash_host_label && !strcasecmp(key, HEALTH_HOST_LABEL_KEY)) {
|
|
if(rt->labels) {
|
|
if(rt->labels) {
|
|
if(strcmp(rt->labels, value) != 0)
|
|
if(strcmp(rt->labels, value) != 0)
|
|
error("Health configuration at line %zu of file '%s' for template '%s' has key '%s' twice, once with value '%s' and later with value '%s'. Using ('%s').",
|
|
error("Health configuration at line %zu of file '%s' for template '%s' has key '%s' twice, once with value '%s' and later with value '%s'. Using ('%s').",
|