From cef40299a93233f043f5b0821a9ad2c69dd612f7 Mon Sep 17 00:00:00 2001 From: Alvar Date: Fri, 6 Feb 2026 11:58:38 +0000 Subject: OpenBSD: pledge(2) some network-facing checks (#2225) OpenBSD's pledge(2) system call allows the current process to self-restrict itself, being reduced to promised pledges. For example, unless a process says it wants to write to files, it is not allowed to do so any longer. This change starts by calling pledge(2) in some network-facing checks, removing the more dangerous privileges, such as executing other files. My initial motivation came from check_icmp, being installed as a setuid binary and (temporarily) running with root privileges. There, the pledge(2) calls result in check_icmp to only being allowed to interact with the network and to setuid(2) to the calling user later on. Afterwards, I went through my most commonly used monitoring plugins directly interacting with the network. Thus, I continued with pledge(2)-ing check_curl - having a huge codebase and all -, check_ntp_time, check_smtp, check_ssh, and check_tcp. For most of those, the changes were quite similar: start with network-friendly promises, parse the configuration, give up file access, and proceed with the actual check. --- plugins/check_smtp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'plugins/check_smtp.c') diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index e8c35f58..03335665 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -100,6 +100,14 @@ static int my_close(int /*socket_descriptor*/); static int verbose = 0; int main(int argc, char **argv) { +#ifdef __OpenBSD__ + /* - rpath is required to read --extra-opts (given up later) + * - inet is required for sockets + * - unix is required for Unix domain sockets + * - dns is required for name lookups */ + pledge("stdio rpath inet unix dns", NULL); +#endif // __OpenBSD__ + setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); @@ -113,6 +121,10 @@ int main(int argc, char **argv) { usage4(_("Could not parse arguments")); } +#ifdef __OpenBSD__ + pledge("stdio inet unix dns", NULL); +#endif // __OpenBSD__ + const check_smtp_config config = tmp_config.config; if (config.output_format_is_set) { -- cgit v1.2.3-74-g34f1 From 0f0865c910096c95594ac09929708e84934e46df Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Fri, 6 Feb 2026 12:59:58 +0100 Subject: Make IPv6 unconditional (#2219) This commits removes the detection of IPv6 availability. The IPv6 code in the plugins is used unconditionally now. --- configure.ac | 24 ------------------------ plugins/check_curl.c | 2 +- plugins/check_curl.d/check_curl_helpers.c | 2 +- plugins/check_http.c | 4 ---- plugins/check_ldap.c | 4 ---- plugins/check_ntp_peer.c | 4 ---- plugins/check_ntp_time.c | 4 ---- plugins/check_ping.c | 4 ---- plugins/check_smtp.c | 4 ---- plugins/check_ssh.c | 4 ---- plugins/check_tcp.c | 4 ---- plugins/netutils.c | 10 ---------- plugins/netutils.h | 4 ---- 13 files changed, 2 insertions(+), 72 deletions(-) (limited to 'plugins/check_smtp.c') diff --git a/configure.ac b/configure.ac index 7361434a..ae7eb30b 100644 --- a/configure.ac +++ b/configure.ac @@ -475,30 +475,6 @@ AC_ARG_WITH([ipv6], [AS_HELP_STRING([--with-ipv6], [support IPv6 @<:@default=check@:>@])], [], [with_ipv6=check]) -dnl Check for AF_INET6 support - unistd.h required for Darwin -if test "$with_ipv6" != "no"; then - AC_CACHE_CHECK([for IPv6 support], np_cv_sys_ipv6, [ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_UNISTD_H - #include - #endif - #include - #include ]], [[struct sockaddr_in6 sin6; - void *p; - - sin6.sin6_family = AF_INET6; - sin6.sin6_port = 587; - p = &sin6.sin6_addr;]])],[np_cv_sys_ipv6=yes],[np_cv_sys_ipv6=no]) - ]) - if test "$np_cv_sys_ipv6" = "no" -a "$with_ipv6" != "check"; then - AC_MSG_FAILURE([--with-ipv6 was given, but test for IPv6 support failed]) - fi - if test "$np_cv_sys_ipv6" = "yes"; then - AC_DEFINE(USE_IPV6,1,[Enable IPv6 support]) - fi - with_ipv6="$np_cv_sys_ipv6" -fi - - dnl Checks for Kerberos. Must come before openssl checks for Redhat EL 3 AC_CHECK_HEADERS(krb5.h,FOUNDINCLUDE=yes,FOUNDINCLUDE=no) if test "$FOUNDINCLUDE" = "no"; then diff --git a/plugins/check_curl.c b/plugins/check_curl.c index 19d36237..95e45282 100644 --- a/plugins/check_curl.c +++ b/plugins/check_curl.c @@ -1265,7 +1265,7 @@ check_curl_config_wrapper process_arguments(int argc, char **argv) { result.config.curl_config.sin_family = AF_INET; break; case '6': -#if defined(USE_IPV6) && defined(LIBCURL_FEATURE_IPV6) +#if defined(LIBCURL_FEATURE_IPV6) result.config.curl_config.sin_family = AF_INET6; #else usage4(_("IPv6 support not available")); diff --git a/plugins/check_curl.d/check_curl_helpers.c b/plugins/check_curl.d/check_curl_helpers.c index 5af00973..ad31b847 100644 --- a/plugins/check_curl.d/check_curl_helpers.c +++ b/plugins/check_curl.d/check_curl_helpers.c @@ -488,7 +488,7 @@ check_curl_configure_curl(const check_curl_static_curl_config config, curl_easy_setopt(result.curl_state.curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4), "CURLOPT_IPRESOLVE(CURL_IPRESOLVE_V4)"); } -#if defined(USE_IPV6) && defined(LIBCURL_FEATURE_IPV6) +#if defined(LIBCURL_FEATURE_IPV6) else if (config.sin_family == AF_INET6) { handle_curl_option_return_code( curl_easy_setopt(result.curl_state.curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V6), diff --git a/plugins/check_http.c b/plugins/check_http.c index d2f080c7..71f94b91 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -544,11 +544,7 @@ bool process_arguments(int argc, char **argv) { address_family = AF_INET; break; case '6': -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage4(_("IPv6 support not available")); -#endif break; case 'v': /* verbose */ verbose = true; diff --git a/plugins/check_ldap.c b/plugins/check_ldap.c index 1b2e2826..333dae41 100644 --- a/plugins/check_ldap.c +++ b/plugins/check_ldap.c @@ -462,11 +462,7 @@ check_ldap_config_wrapper process_arguments(int argc, char **argv) { } break; case '6': -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage(_("IPv6 support not available\n")); -#endif break; case output_format_index: { parsed_output_format parser = mp_parse_output_format(optarg); diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index 26f74286..06737a27 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c @@ -640,11 +640,7 @@ check_ntp_peer_config_wrapper process_arguments(int argc, char **argv) { address_family = AF_INET; break; case '6': -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage4(_("IPv6 support not available")); -#endif break; case '?': /* print short usage statement if args not parsable */ diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c index afa6d16c..5955d22e 100644 --- a/plugins/check_ntp_time.c +++ b/plugins/check_ntp_time.c @@ -640,11 +640,7 @@ static check_ntp_time_config_wrapper process_arguments(int argc, char **argv) { address_family = AF_INET; break; case '6': -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage4(_("IPv6 support not available")); -#endif break; case '?': /* print short usage statement if args not parsable */ diff --git a/plugins/check_ping.c b/plugins/check_ping.c index 61feb958..e1ee0f5c 100644 --- a/plugins/check_ping.c +++ b/plugins/check_ping.c @@ -246,11 +246,7 @@ check_ping_config_wrapper process_arguments(int argc, char **argv) { address_family = AF_INET; break; case '6': /* IPv6 only */ -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage(_("IPv6 support not available\n")); -#endif break; case 'H': /* hostname */ { char *ptr = optarg; diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 03335665..701af7b0 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -819,11 +819,7 @@ check_smtp_config_wrapper process_arguments(int argc, char **argv) { address_family = AF_INET; break; case '6': -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage4(_("IPv6 support not available")); -#endif break; case 'V': /* version */ print_revision(progname, NP_VERSION); diff --git a/plugins/check_ssh.c b/plugins/check_ssh.c index 84b70a53..911f6787 100644 --- a/plugins/check_ssh.c +++ b/plugins/check_ssh.c @@ -173,11 +173,7 @@ process_arguments_wrapper process_arguments(int argc, char **argv) { address_family = AF_INET; break; case '6': -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage4(_("IPv6 support not available")); -#endif break; case 'r': /* remote version */ result.config.remote_version = optarg; diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 430f1218..49a8c4c1 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c @@ -583,11 +583,7 @@ static check_tcp_config_wrapper process_arguments(int argc, char **argv, check_t address_family = AF_INET; break; case '6': // Apparently unused TODO -#ifdef USE_IPV6 address_family = AF_INET6; -#else - usage4(_("IPv6 support not available")); -#endif break; case 'H': /* hostname */ config.host_specified = true; diff --git a/plugins/netutils.c b/plugins/netutils.c index b4c6ff0a..f9933ebd 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c @@ -38,11 +38,7 @@ mp_state_enum socket_timeout_state = STATE_CRITICAL; mp_state_enum econn_refuse_state = STATE_CRITICAL; bool was_refused = false; -#if USE_IPV6 int address_family = AF_UNSPEC; -#else -int address_family = AF_INET; -#endif /* handles socket timeouts */ void socket_timeout_alarm_handler(int sig) { @@ -348,7 +344,6 @@ void host_or_die(const char *str) { } bool is_addr(const char *address) { -#ifdef USE_IPV6 if (address_family == AF_INET && is_inet_addr(address)) { return true; } @@ -356,11 +351,6 @@ bool is_addr(const char *address) { if (address_family == AF_INET6 && is_inet6_addr(address)) { return true; } -#else - if (is_inet_addr(address)) { - return true; - } -#endif return false; } diff --git a/plugins/netutils.h b/plugins/netutils.h index dbd22398..f3d046c3 100644 --- a/plugins/netutils.h +++ b/plugins/netutils.h @@ -78,12 +78,8 @@ bool dns_lookup(const char *, struct sockaddr_storage *, int); void host_or_die(const char *str); #define resolve_host_or_addr(addr, family) dns_lookup(addr, NULL, family) #define is_inet_addr(addr) resolve_host_or_addr(addr, AF_INET) -#ifdef USE_IPV6 # define is_inet6_addr(addr) resolve_host_or_addr(addr, AF_INET6) # define is_hostname(addr) resolve_host_or_addr(addr, address_family) -#else -# define is_hostname(addr) resolve_host_or_addr(addr, AF_INET) -#endif extern unsigned int socket_timeout; extern mp_state_enum socket_timeout_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 'plugins/check_smtp.c') 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