From 423d0c52674bfa4ec49e4ae8bce645131f657f74 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 16 Feb 2026 11:21:21 +0100 Subject: Fix a few typos (#2231) --- lib/extra_opts.c | 2 +- lib/extra_opts.h | 2 +- lib/output.c | 4 ++-- lib/parse_ini.c | 2 +- lib/perfdata.c | 2 +- lib/states.h | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/extra_opts.c b/lib/extra_opts.c index 3fe69014..fa64d650 100644 --- a/lib/extra_opts.c +++ b/lib/extra_opts.c @@ -120,7 +120,7 @@ char **np_extra_opts(int *argc, char **argv, const char *plugin_name) { } ea1 = ea_tmp = NULL; } - } /* lather, rince, repeat */ + } /* lather, rinse, repeat */ if (ea_num == (size_t)*argc && extra_args == NULL) { /* No extra-opts */ diff --git a/lib/extra_opts.h b/lib/extra_opts.h index 3f64360f..3c2d5eb1 100644 --- a/lib/extra_opts.h +++ b/lib/extra_opts.h @@ -8,7 +8,7 @@ /* np_extra_opts: Process the --extra-opts arguments and create a new argument * array with ini-processed and argument-passed arguments together. The - * ini-procesed arguments always come first (in the order of --extra-opts + * ini-processed arguments always come first (in the order of --extra-opts * arguments). If no --extra-opts arguments are provided or returned nothing * it returns **argv otherwise the new array is returned. --extra-opts are * always removed from **argv. The original pointers from **argv are kept in diff --git a/lib/output.c b/lib/output.c index d650a3c5..d1a8d3b9 100644 --- a/lib/output.c +++ b/lib/output.c @@ -165,7 +165,7 @@ int mp_add_subcheck_to_subcheck(mp_subcheck check[static 1], mp_subcheck subchec void mp_add_summary(mp_check check[static 1], char *summary) { check->summary = summary; } /* - * Generate the summary string of a mp_check object based on it's subchecks + * Generate the summary string of a mp_check object based on its subchecks */ char *get_subcheck_summary(mp_check check) { mp_subcheck_list *subchecks = check.subchecks; @@ -243,7 +243,7 @@ mp_state_enum mp_compute_check_state(const mp_check check) { } /* - * Generate the result state of a mp_check object based on it's own state and it's subchecks states + * Generate the result state of a mp_check object based on its own state and its subchecks states */ mp_state_enum mp_eval_check_default(const mp_check check) { assert(check.subchecks != NULL); // a mp_check without subchecks is invalid, die here diff --git a/lib/parse_ini.c b/lib/parse_ini.c index 196cac79..8a54af58 100644 --- a/lib/parse_ini.c +++ b/lib/parse_ini.c @@ -173,7 +173,7 @@ static bool read_defaults(FILE *defaults_file, const char *stanza, np_arg_list * continue; } switch (current_char) { - /* globble up comment lines */ + /* gobble up comment lines */ case ';': case '#': GOBBLE_TO(defaults_file, current_char, '\n'); diff --git a/lib/perfdata.c b/lib/perfdata.c index 2930a8bc..b447b8ea 100644 --- a/lib/perfdata.c +++ b/lib/perfdata.c @@ -37,7 +37,7 @@ char *pd_to_string(mp_perfdata pd) { if (strchr(pd.label, '\'') == NULL) { asprintf(&result, "'%s'=", pd.label); } else { - // we have a illegal single quote in the string + // we have an illegal single quote in the string // replace it silently instead of complaining for (char *ptr = pd.label; *ptr == '\0'; ptr++) { if (*ptr == '\'') { diff --git a/lib/states.h b/lib/states.h index 4a170caa..43926f0c 100644 --- a/lib/states.h +++ b/lib/states.h @@ -45,7 +45,7 @@ static inline mp_state_enum max_state(mp_state_enum a, mp_state_enum b) { * STATE_OK < STATE_DEPENDENT < STATE_UNKNOWN < STATE_WARNING < STATE_CRITICAL * * The main difference between max_state_alt and max_state it that it doesn't - * allow setting a default to UNKNOWN. It will instead prioritixe any valid + * allow setting a default to UNKNOWN. It will instead prioritize any valid * non-OK state. ****************************************************************************/ -- cgit v1.2.3-74-g34f1 From 07a249a5d74a980ca78cead569de5351963cc561 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 16 Feb 2026 11:22:39 +0100 Subject: Fix typo in enum MP_PARSING_SUCCES(S) (#2233) --- lib/perfdata.c | 14 +++++++------- lib/perfdata.h | 3 ++- plugins/check_curl.c | 6 +++--- plugins/check_dbi.c | 4 ++-- plugins/check_disk.c | 4 ++-- plugins/check_ldap.c | 8 ++++---- plugins/check_mrtg.c | 8 ++++---- plugins/check_mysql.c | 4 ++-- plugins/check_mysql_query.c | 4 ++-- plugins/check_ntp_peer.c | 16 ++++++++-------- plugins/check_ntp_time.c | 4 ++-- plugins/check_pgsql.c | 8 ++++---- plugins/check_real.c | 4 ++-- plugins/check_smtp.c | 4 ++-- plugins/check_snmp.d/check_snmp_helpers.c | 4 ++-- plugins/check_users.c | 4 ++-- 16 files changed, 50 insertions(+), 49 deletions(-) (limited to 'lib') diff --git a/lib/perfdata.c b/lib/perfdata.c index b447b8ea..138df53b 100644 --- a/lib/perfdata.c +++ b/lib/perfdata.c @@ -393,7 +393,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { mp_range_parsed result = { .range = mp_range_init(), - .error = MP_PARSING_SUCCES, + .error = MP_PARSING_SUCCESS, }; if (input[0] == '@') { @@ -436,7 +436,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { result.range.start_infinity = false; perfdata_value_parser_wrapper parsed_pd = parse_pd_value(input); - if (parsed_pd.error != MP_PARSING_SUCCES) { + if (parsed_pd.error != MP_PARSING_SUCCESS) { result.error = parsed_pd.error; free(working_copy); return result; @@ -457,7 +457,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { } else { perfdata_value_parser_wrapper parsed_pd = parse_pd_value(input); - if (parsed_pd.error != MP_PARSING_SUCCES) { + if (parsed_pd.error != MP_PARSING_SUCCESS) { result.error = parsed_pd.error; return result; } @@ -470,7 +470,7 @@ mp_range_parsed mp_parse_range_string(const char *input) { double_parser_wrapper parse_double(const char *input) { double_parser_wrapper result = { - .error = MP_PARSING_SUCCES, + .error = MP_PARSING_SUCCESS, }; if (input == NULL) { @@ -501,7 +501,7 @@ double_parser_wrapper parse_double(const char *input) { integer_parser_wrapper parse_integer(const char *input) { integer_parser_wrapper result = { - .error = MP_PARSING_SUCCES, + .error = MP_PARSING_SUCCESS, }; if (input == NULL) { @@ -548,7 +548,7 @@ perfdata_value_parser_wrapper parse_pd_value(const char *input) { // try integer first integer_parser_wrapper tmp_int = parse_integer(input); - if (tmp_int.error == MP_PARSING_SUCCES) { + if (tmp_int.error == MP_PARSING_SUCCESS) { perfdata_value_parser_wrapper result = { .error = tmp_int.error, .value = tmp_int.value, @@ -558,7 +558,7 @@ perfdata_value_parser_wrapper parse_pd_value(const char *input) { double_parser_wrapper tmp_double = parse_double(input); perfdata_value_parser_wrapper result = {}; - if (tmp_double.error == MP_PARSING_SUCCES) { + if (tmp_double.error == MP_PARSING_SUCCESS) { result.error = tmp_double.error; result.value = tmp_double.value; } else { diff --git a/lib/perfdata.h b/lib/perfdata.h index e51ef5fd..d7e5670a 100644 --- a/lib/perfdata.h +++ b/lib/perfdata.h @@ -111,7 +111,8 @@ mp_range mp_range_set_end(mp_range, mp_perfdata_value); */ typedef enum { - MP_PARSING_SUCCES = 0, + MP_PARSING_SUCCESS = 0, + MP_PARSING_SUCCES = MP_PARSING_SUCCESS, MP_PARSING_FAILURE, MP_RANGE_PARSING_FAILURE, MP_RANGE_PARSING_UNDERFLOW, diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 95e45282..d7d68de5 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -990,7 +990,7 @@ check_curl_config_wrapper process_arguments(int argc, char **argv) { case 'c': /* critical time threshold */ { mp_range_parsed critical_range = mp_parse_range_string(optarg); - if (critical_range.error != MP_PARSING_SUCCES) { + if (critical_range.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical threshold: %s", optarg); } result.config.thlds = mp_thresholds_set_crit(result.config.thlds, critical_range.range); @@ -999,7 +999,7 @@ check_curl_config_wrapper process_arguments(int argc, char **argv) { { mp_range_parsed warning_range = mp_parse_range_string(optarg); - if (warning_range.error != MP_PARSING_SUCCES) { + if (warning_range.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold: %s", optarg); } result.config.thlds = mp_thresholds_set_warn(result.config.thlds, warning_range.range); @@ -1275,7 +1275,7 @@ check_curl_config_wrapper process_arguments(int argc, char **argv) { { mp_range_parsed foo = mp_parse_range_string(optarg); - if (foo.error != MP_PARSING_SUCCES) { + if (foo.error != MP_PARSING_SUCCESS) { die(STATE_CRITICAL, "failed to parse page size limits: %s", optarg); } diff --git a/plugins/check_dbi.c b/plugins/check_dbi.c index 81d92952..dd466d00 100644 --- a/plugins/check_dbi.c +++ b/plugins/check_dbi.c @@ -470,7 +470,7 @@ check_dbi_config_wrapper process_arguments(int argc, char **argv) { case 'c': /* critical range */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical threshold"); } result.config.thresholds = mp_thresholds_set_crit(result.config.thresholds, tmp.range); @@ -478,7 +478,7 @@ check_dbi_config_wrapper process_arguments(int argc, char **argv) { } break; case 'w': /* warning range */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold"); } result.config.thresholds = mp_thresholds_set_warn(result.config.thresholds, tmp.range); diff --git a/plugins/check_disk.c b/plugins/check_disk.c index e1a2baff..0d941f25 100644 --- a/plugins/check_disk.c +++ b/plugins/check_disk.c @@ -838,7 +838,7 @@ check_disk_config_wrapper process_arguments(int argc, char **argv) { } char *range = argv[index++]; mp_range_parsed tmp = mp_parse_range_string(range); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold"); } @@ -859,7 +859,7 @@ check_disk_config_wrapper process_arguments(int argc, char **argv) { } char *range = argv[index++]; mp_range_parsed tmp = mp_parse_range_string(range); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold"); } diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 333dae41..7f8282b4 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -400,7 +400,7 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { break; case 'w': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning connection time threshold"); } result.config.connection_time_threshold = @@ -408,7 +408,7 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { } break; case 'c': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical connection time threshold"); } result.config.connection_time_threshold = @@ -416,7 +416,7 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { } break; case 'W': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse number of entries warning threshold"); } result.config.entries_thresholds = @@ -424,7 +424,7 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { } break; case 'C': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse number of entries critical threshold"); } result.config.entries_thresholds = diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c index cdc2a035..bb38fcc5 100644 --- a/plugins/check_mrtg.c +++ b/plugins/check_mrtg.c @@ -255,7 +255,7 @@ check_mrtg_config_wrapper process_arguments(int argc, char **argv) { break; case 'w': /* critical time threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold"); } result.config.values_threshold = @@ -263,7 +263,7 @@ check_mrtg_config_wrapper process_arguments(int argc, char **argv) { } break; case 'c': /* warning time threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical threshold"); } result.config.values_threshold = @@ -330,7 +330,7 @@ check_mrtg_config_wrapper process_arguments(int argc, char **argv) { if (argc > option_char && !result.config.values_threshold.warning_is_set) { mp_range_parsed tmp = mp_parse_range_string(argv[option_char++]); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold"); } result.config.values_threshold = @@ -339,7 +339,7 @@ check_mrtg_config_wrapper process_arguments(int argc, char **argv) { if (argc > option_char && !result.config.values_threshold.critical_is_set) { mp_range_parsed tmp = mp_parse_range_string(argv[option_char++]); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical threshold"); } result.config.values_threshold = diff --git a/plugins/check_mysql.c b/plugins/check_mysql.c index 26730d4c..15005bf5 100644 --- a/plugins/check_mysql.c +++ b/plugins/check_mysql.c @@ -572,7 +572,7 @@ check_mysql_config_wrapper process_arguments(int argc, char **argv) { break; case 'w': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning time threshold"); } result.config.replica_thresholds = @@ -580,7 +580,7 @@ check_mysql_config_wrapper process_arguments(int argc, char **argv) { } break; case 'c': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical time threshold"); } result.config.replica_thresholds = diff --git a/plugins/check_mysql_query.c b/plugins/check_mysql_query.c index ae6cc15d..fc0966d3 100644 --- a/plugins/check_mysql_query.c +++ b/plugins/check_mysql_query.c @@ -277,14 +277,14 @@ check_mysql_query_config_wrapper process_arguments(int argc, char **argv) { break; case 'w': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold"); } result.config.thresholds = mp_thresholds_set_warn(result.config.thresholds, tmp.range); } break; case 'c': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical threshold"); } result.config.thresholds = mp_thresholds_set_crit(result.config.thresholds, tmp.range); diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index 06737a27..b5cfb460 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c @@ -548,7 +548,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { break; case 'w': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning offset threshold"); } @@ -557,7 +557,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { } break; case 'c': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical offset threshold"); } @@ -567,7 +567,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { case 'W': { result.config.do_stratum = true; mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning stratum threshold"); } @@ -577,7 +577,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { case 'C': { result.config.do_stratum = true; mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical stratum threshold"); } @@ -587,7 +587,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { case 'j': { result.config.do_jitter = true; mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning jitter threshold"); } @@ -597,7 +597,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { case 'k': { result.config.do_jitter = true; mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical jitter threshold"); } @@ -607,7 +607,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { case 'm': { result.config.do_truechimers = true; mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning truechimer threshold"); } @@ -617,7 +617,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { case 'n': { result.config.do_truechimers = true; mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical truechimer threshold"); } diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c index 5955d22e..4e3a55db 100644 --- a/plugins/check_ntp_time.c +++ b/plugins/check_ntp_time.c @@ -605,7 +605,7 @@ static check_ntp_time_config_wrapper process_arguments(int argc, char **argv) { break; case 'w': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold"); } @@ -614,7 +614,7 @@ static check_ntp_time_config_wrapper process_arguments(int argc, char **argv) { } break; case 'c': { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse crit threshold"); } diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 0ce75e0a..8cbaaeeb 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c @@ -401,7 +401,7 @@ static check_pgsql_config_wrapper process_arguments(int argc, char **argv) { break; case 'c': /* critical time threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical time threshold"); } result.config.time_thresholds = @@ -409,7 +409,7 @@ static check_pgsql_config_wrapper process_arguments(int argc, char **argv) { } break; case 'w': /* warning time threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning time threshold"); } result.config.time_thresholds = @@ -417,7 +417,7 @@ static check_pgsql_config_wrapper process_arguments(int argc, char **argv) { } break; case 'C': /* critical query threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical query threshold"); } @@ -427,7 +427,7 @@ static check_pgsql_config_wrapper process_arguments(int argc, char **argv) { } break; case 'W': /* warning query threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning query threshold"); } result.config.qthresholds = diff --git a/plugins/check_real.c b/plugins/check_real.c index 15c8a20c..b415578f 100644 --- a/plugins/check_real.c +++ b/plugins/check_real.c @@ -409,7 +409,7 @@ check_real_config_wrapper process_arguments(int argc, char **argv) { case 'w': /* warning time threshold */ { mp_range_parsed critical_range = mp_parse_range_string(optarg); - if (critical_range.error != MP_PARSING_SUCCES) { + if (critical_range.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning threshold: %s", optarg); } result.config.time_thresholds = @@ -418,7 +418,7 @@ check_real_config_wrapper process_arguments(int argc, char **argv) { case 'c': /* critical time threshold */ { mp_range_parsed critical_range = mp_parse_range_string(optarg); - if (critical_range.error != MP_PARSING_SUCCES) { + if (critical_range.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical threshold: %s", optarg); } result.config.time_thresholds = diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 701af7b0..24883fd8 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -735,7 +735,7 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) { break; case 'c': /* critical time threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse critical time threshold"); } result.config.connection_time = @@ -743,7 +743,7 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) { } break; case 'w': /* warning time threshold */ { mp_range_parsed tmp = mp_parse_range_string(optarg); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "failed to parse warning time threshold"); } result.config.connection_time = diff --git a/plugins/check_snmp.d/check_snmp_helpers.c b/plugins/check_snmp.d/check_snmp_helpers.c index 2dfc88b5..83e94a34 100644 --- a/plugins/check_snmp.d/check_snmp_helpers.c +++ b/plugins/check_snmp.d/check_snmp_helpers.c @@ -52,7 +52,7 @@ int check_snmp_set_thresholds(const char *threshold_string, check_snmp_test_unit } mp_range_parsed tmp = mp_parse_range_string(ptr); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "Unable to parse critical threshold range: %s", ptr); } @@ -70,7 +70,7 @@ int check_snmp_set_thresholds(const char *threshold_string, check_snmp_test_unit // Single value // only valid for the first test unit mp_range_parsed tmp = mp_parse_range_string(threshold_string); - if (tmp.error != MP_PARSING_SUCCES) { + if (tmp.error != MP_PARSING_SUCCESS) { die(STATE_UNKNOWN, "Unable to parse critical threshold range: %s", threshold_string); } diff --git a/plugins/check_users.c b/plugins/check_users.c index 3b2e265e..4027d21a 100644 --- a/plugins/check_users.c +++ b/plugins/check_users.c @@ -222,7 +222,7 @@ check_users_config_wrapper process_arguments(int argc, char **argv) { exit(STATE_UNKNOWN); } - if (tmp.error == MP_PARSING_SUCCES) { + if (tmp.error == MP_PARSING_SUCCESS) { result.config.thresholds.warning = tmp.range; result.config.thresholds.warning_is_set = true; } else { @@ -238,7 +238,7 @@ check_users_config_wrapper process_arguments(int argc, char **argv) { exit(STATE_UNKNOWN); } - if (tmp.error == MP_PARSING_SUCCES) { + if (tmp.error == MP_PARSING_SUCCESS) { result.config.thresholds.critical = tmp.range; result.config.thresholds.critical_is_set = true; } else { -- cgit v1.2.3-74-g34f1 From 15b9a39b6085f9382e1907ef769a50aee716e839 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 16 Feb 2026 11:27:49 +0100 Subject: Make replacing of mismatching single quotes work (#2232) Fixes a logic error in the string handling that led to dead code before. --- lib/perfdata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/perfdata.c b/lib/perfdata.c index 138df53b..f4eaf843 100644 --- a/lib/perfdata.c +++ b/lib/perfdata.c @@ -39,7 +39,7 @@ char *pd_to_string(mp_perfdata pd) { } else { // we have an illegal single quote in the string // replace it silently instead of complaining - for (char *ptr = pd.label; *ptr == '\0'; ptr++) { + for (char *ptr = pd.label; *ptr != '\0'; ptr++) { if (*ptr == '\'') { *ptr = '_'; } -- cgit v1.2.3-74-g34f1 From 2d4f98f50b3470852aea99c61c64cfc11405a8fc Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 16 Mar 2026 12:28:25 +0100 Subject: Remove troublesome symbols from output (#2240) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lorenz Kästle --- lib/output.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib') diff --git a/lib/output.c b/lib/output.c index d1a8d3b9..bfd43195 100644 --- a/lib/output.c +++ b/lib/output.c @@ -259,6 +259,21 @@ mp_state_enum mp_eval_check_default(const mp_check check) { return result; } +// Remove troublesome symbols from plugin output +char *sanitize_output_insitu(char *input) { + if (input == NULL) { + return input; + } + + for (char *walker = input; *walker != '\0'; walker++) { + if (*walker == '|') { + *walker = ' '; + } + } + + return input; +} + /* * Generate output string for a mp_check object * Non static to be available for testing functions @@ -299,6 +314,8 @@ char *mp_fmt_output(mp_check check) { subchecks = subchecks->next; } + result = sanitize_output_insitu(result); + if (pd_string != NULL && strlen(pd_string) > 0) { asprintf(&result, "%s|%s", result, pd_string); } -- cgit v1.2.3-74-g34f1