diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-02-20 23:52:32 +0100 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-02-20 23:52:32 +0100 |
| commit | 1d590a0efe4193ac9298d3eba448ab8bc3bb665b (patch) | |
| tree | e0161bd9fce96d5415a62d7ed7dc6c0875192dd2 | |
| parent | 07873c765b73c85482436880f122882dfccd7e1b (diff) | |
| download | monitoring-plugins-1d590a0efe4193ac9298d3eba448ab8bc3bb665b.tar.gz | |
Rename icingaweb2 format to multi-line
| -rw-r--r-- | lib/output.c | 8 | ||||
| -rw-r--r-- | lib/output.h | 4 | ||||
| -rw-r--r-- | plugins/utils.h | 2 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/output.c b/lib/output.c index 07a77165..17919afc 100644 --- a/lib/output.c +++ b/lib/output.c | |||
| @@ -235,7 +235,7 @@ char *mp_fmt_output(mp_check check) { | |||
| 235 | char *result = NULL; | 235 | char *result = NULL; |
| 236 | 236 | ||
| 237 | switch (check.format) { | 237 | switch (check.format) { |
| 238 | case MP_FORMAT_ICINGA_WEB_2: { | 238 | case MP_FORMAT_MULTI_LINE: { |
| 239 | if (check.summary == NULL) { | 239 | if (check.summary == NULL) { |
| 240 | check.summary = get_subcheck_summary(check); | 240 | check.summary = get_subcheck_summary(check); |
| 241 | } | 241 | } |
| @@ -245,7 +245,7 @@ char *mp_fmt_output(mp_check check) { | |||
| 245 | mp_subcheck_list *subchecks = check.subchecks; | 245 | mp_subcheck_list *subchecks = check.subchecks; |
| 246 | 246 | ||
| 247 | while (subchecks != NULL) { | 247 | while (subchecks != NULL) { |
| 248 | asprintf(&result, "%s\n%s", result, fmt_subcheck_output(MP_FORMAT_ICINGA_WEB_2, subchecks->subcheck, 1)); | 248 | asprintf(&result, "%s\n%s", result, fmt_subcheck_output(MP_FORMAT_MULTI_LINE, subchecks->subcheck, 1)); |
| 249 | subchecks = subchecks->next; | 249 | subchecks = subchecks->next; |
| 250 | } | 250 | } |
| 251 | 251 | ||
| @@ -330,7 +330,7 @@ static inline char *fmt_subcheck_output(mp_output_format output_format, mp_subch | |||
| 330 | mp_subcheck_list *subchecks = NULL; | 330 | mp_subcheck_list *subchecks = NULL; |
| 331 | 331 | ||
| 332 | switch (output_format) { | 332 | switch (output_format) { |
| 333 | case MP_FORMAT_ICINGA_WEB_2: | 333 | case MP_FORMAT_MULTI_LINE: |
| 334 | asprintf(&result, "%s\\_[%s] - %s", generate_indentation_string(indentation), state_text(mp_compute_subcheck_state(check)), | 334 | asprintf(&result, "%s\\_[%s] - %s", generate_indentation_string(indentation), state_text(mp_compute_subcheck_state(check)), |
| 335 | check.output); | 335 | check.output); |
| 336 | 336 | ||
| @@ -510,7 +510,7 @@ mp_subcheck mp_set_subcheck_default_state(mp_subcheck check, mp_state_enum state | |||
| 510 | } | 510 | } |
| 511 | 511 | ||
| 512 | char *mp_output_format_map[] = { | 512 | char *mp_output_format_map[] = { |
| 513 | [MP_FORMAT_ICINGA_WEB_2] = "icingaweb2", | 513 | [MP_FORMAT_MULTI_LINE] = "multi-line", |
| 514 | [MP_FORMAT_TEST_JSON] = "mp-test-json", | 514 | [MP_FORMAT_TEST_JSON] = "mp-test-json", |
| 515 | }; | 515 | }; |
| 516 | 516 | ||
diff --git a/lib/output.h b/lib/output.h index 14c4bcf4..ffc36f53 100644 --- a/lib/output.h +++ b/lib/output.h | |||
| @@ -29,11 +29,11 @@ typedef struct subcheck_list { | |||
| 29 | * Possible output formats | 29 | * Possible output formats |
| 30 | */ | 30 | */ |
| 31 | typedef enum output_format { | 31 | typedef enum output_format { |
| 32 | MP_FORMAT_ICINGA_WEB_2, | 32 | MP_FORMAT_MULTI_LINE, |
| 33 | MP_FORMAT_TEST_JSON, | 33 | MP_FORMAT_TEST_JSON, |
| 34 | } mp_output_format; | 34 | } mp_output_format; |
| 35 | 35 | ||
| 36 | #define MP_FORMAT_DEFAULT MP_FORMAT_ICINGA_WEB_2 | 36 | #define MP_FORMAT_DEFAULT MP_FORMAT_MULTI_LINE |
| 37 | 37 | ||
| 38 | /* | 38 | /* |
| 39 | * The main state object of a plugin. Exists only ONCE per plugin. | 39 | * The main state object of a plugin. Exists only ONCE per plugin. |
diff --git a/plugins/utils.h b/plugins/utils.h index bc26f704..029ae5a6 100644 --- a/plugins/utils.h +++ b/plugins/utils.h | |||
| @@ -197,6 +197,6 @@ For more information about these matters, see the file named COPYING.\n") | |||
| 197 | 197 | ||
| 198 | #define UT_OUTPUT_FORMAT _("\ | 198 | #define UT_OUTPUT_FORMAT _("\ |
| 199 | --output-format=OUTPUT_FORMAT\n\ | 199 | --output-format=OUTPUT_FORMAT\n\ |
| 200 | Select output format. Valid values: \"icingaweb2\", \"mp-test-json\"\n") | 200 | Select output format. Valid values: \"multi-line\", \"mp-test-json\"\n") |
| 201 | 201 | ||
| 202 | #endif /* NP_UTILS_H */ | 202 | #endif /* NP_UTILS_H */ |
