mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-04-22 14:46:57 -04:00
Rename icingaweb2 format to multi-line
This commit is contained in:
parent
07873c765b
commit
1d590a0efe
3 changed files with 7 additions and 7 deletions
|
|
@ -235,7 +235,7 @@ char *mp_fmt_output(mp_check check) {
|
|||
char *result = NULL;
|
||||
|
||||
switch (check.format) {
|
||||
case MP_FORMAT_ICINGA_WEB_2: {
|
||||
case MP_FORMAT_MULTI_LINE: {
|
||||
if (check.summary == NULL) {
|
||||
check.summary = get_subcheck_summary(check);
|
||||
}
|
||||
|
|
@ -245,7 +245,7 @@ char *mp_fmt_output(mp_check check) {
|
|||
mp_subcheck_list *subchecks = check.subchecks;
|
||||
|
||||
while (subchecks != NULL) {
|
||||
asprintf(&result, "%s\n%s", result, fmt_subcheck_output(MP_FORMAT_ICINGA_WEB_2, subchecks->subcheck, 1));
|
||||
asprintf(&result, "%s\n%s", result, fmt_subcheck_output(MP_FORMAT_MULTI_LINE, subchecks->subcheck, 1));
|
||||
subchecks = subchecks->next;
|
||||
}
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ static inline char *fmt_subcheck_output(mp_output_format output_format, mp_subch
|
|||
mp_subcheck_list *subchecks = NULL;
|
||||
|
||||
switch (output_format) {
|
||||
case MP_FORMAT_ICINGA_WEB_2:
|
||||
case MP_FORMAT_MULTI_LINE:
|
||||
asprintf(&result, "%s\\_[%s] - %s", generate_indentation_string(indentation), state_text(mp_compute_subcheck_state(check)),
|
||||
check.output);
|
||||
|
||||
|
|
@ -510,7 +510,7 @@ mp_subcheck mp_set_subcheck_default_state(mp_subcheck check, mp_state_enum state
|
|||
}
|
||||
|
||||
char *mp_output_format_map[] = {
|
||||
[MP_FORMAT_ICINGA_WEB_2] = "icingaweb2",
|
||||
[MP_FORMAT_MULTI_LINE] = "multi-line",
|
||||
[MP_FORMAT_TEST_JSON] = "mp-test-json",
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ typedef struct subcheck_list {
|
|||
* Possible output formats
|
||||
*/
|
||||
typedef enum output_format {
|
||||
MP_FORMAT_ICINGA_WEB_2,
|
||||
MP_FORMAT_MULTI_LINE,
|
||||
MP_FORMAT_TEST_JSON,
|
||||
} mp_output_format;
|
||||
|
||||
#define MP_FORMAT_DEFAULT MP_FORMAT_ICINGA_WEB_2
|
||||
#define MP_FORMAT_DEFAULT MP_FORMAT_MULTI_LINE
|
||||
|
||||
/*
|
||||
* The main state object of a plugin. Exists only ONCE per plugin.
|
||||
|
|
|
|||
|
|
@ -197,6 +197,6 @@ For more information about these matters, see the file named COPYING.\n")
|
|||
|
||||
#define UT_OUTPUT_FORMAT _("\
|
||||
--output-format=OUTPUT_FORMAT\n\
|
||||
Select output format. Valid values: \"icingaweb2\", \"mp-test-json\"\n")
|
||||
Select output format. Valid values: \"multi-line\", \"mp-test-json\"\n")
|
||||
|
||||
#endif /* NP_UTILS_H */
|
||||
|
|
|
|||
Loading…
Reference in a new issue