From cd20cc063245523d51013849fa28eb0cac013171 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 23 Jun 2025 10:17:28 +0200 Subject: check_icmp: add long options, add output format option This commit switches check_icmp from getopt to getopt_long to provide long options too and (most importantly) homogenize option parsing between the different plugins. --- plugins-root/check_icmp.d/check_icmp_helpers.c | 2 ++ plugins-root/check_icmp.d/config.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'plugins-root/check_icmp.d') diff --git a/plugins-root/check_icmp.d/check_icmp_helpers.c b/plugins-root/check_icmp.d/check_icmp_helpers.c index ec786305..9acc96fd 100644 --- a/plugins-root/check_icmp.d/check_icmp_helpers.c +++ b/plugins-root/check_icmp.d/check_icmp_helpers.c @@ -52,6 +52,8 @@ check_icmp_config check_icmp_config_init() { .number_of_hosts = 0, .hosts = NULL, + + .output_format_is_set = false, }; return tmp; } diff --git a/plugins-root/check_icmp.d/config.h b/plugins-root/check_icmp.d/config.h index fc9dd5a6..8092e343 100644 --- a/plugins-root/check_icmp.d/config.h +++ b/plugins-root/check_icmp.d/config.h @@ -12,11 +12,12 @@ #include #include #include "./check_icmp_helpers.h" +#include "output.h" /* threshold structure. all values are maximum allowed, exclusive */ typedef struct { unsigned char pl; /* max allowed packet loss in percent */ - time_t rta; /* roundtrip time average, microseconds */ + time_t rta; /* roundtrip time average, microseconds */ double jitter; /* jitter time average, microseconds */ double mos; /* MOS */ double score; /* Score */ @@ -77,6 +78,9 @@ typedef struct { unsigned short number_of_hosts; check_icmp_target_container *hosts; + + mp_output_format output_format; + bool output_format_is_set; } check_icmp_config; check_icmp_config check_icmp_config_init(); -- cgit v1.2.3-74-g34f1