diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-06-23 11:41:24 +0200 |
|---|---|---|
| committer | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-06-23 11:41:24 +0200 |
| commit | 771ccfa52691e591be3736b6d03f36e69d82e464 (patch) | |
| tree | 5179e4957283b336703ba39185c241c92f0d2a1e | |
| parent | 7e9519e0ad730ede8fad0503102e1373b8999be2 (diff) | |
| download | monitoring-plugins-771ccfa52691e591be3736b6d03f36e69d82e464.tar.gz | |
check_icmp: remove unnecessary variable
| -rw-r--r-- | plugins-root/check_icmp.c | 3 | ||||
| -rw-r--r-- | plugins-root/check_icmp.d/check_icmp_helpers.c | 1 | ||||
| -rw-r--r-- | plugins-root/check_icmp.d/config.h | 1 |
3 files changed, 1 insertions, 4 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 3edfffa2..be686ee3 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
| @@ -407,7 +407,6 @@ check_icmp_config_wrapper process_arguments(int argc, char **argv) { | |||
| 407 | if ((unsigned long)size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) && | 407 | if ((unsigned long)size >= (sizeof(struct icmp) + sizeof(struct icmp_ping_data)) && |
| 408 | size < MAX_PING_DATA) { | 408 | size < MAX_PING_DATA) { |
| 409 | result.config.icmp_data_size = (unsigned short)size; | 409 | result.config.icmp_data_size = (unsigned short)size; |
| 410 | result.config.icmp_pkt_size = (unsigned short)(size + ICMP_MINLEN); | ||
| 411 | } else { | 410 | } else { |
| 412 | usage_va("ICMP data length must be between: %lu and %lu", | 411 | usage_va("ICMP data length must be between: %lu and %lu", |
| 413 | sizeof(struct icmp) + sizeof(struct icmp_ping_data), | 412 | sizeof(struct icmp) + sizeof(struct icmp_ping_data), |
| @@ -945,7 +944,7 @@ int main(int argc, char **argv) { | |||
| 945 | printf("crit = {%ld, %u%%}, warn = {%ld, %u%%}\n", config.crit.rta, config.crit.pl, | 944 | printf("crit = {%ld, %u%%}, warn = {%ld, %u%%}\n", config.crit.rta, config.crit.pl, |
| 946 | config.warn.rta, config.warn.pl); | 945 | config.warn.rta, config.warn.pl); |
| 947 | printf("target_interval: %ld\n", config.target_interval); | 946 | printf("target_interval: %ld\n", config.target_interval); |
| 948 | printf("icmp_pkt_size: %u timeout: %u\n", config.icmp_pkt_size, timeout); | 947 | printf("icmp_pkt_size: %u timeout: %u\n", config.icmp_data_size + ICMP_MINLEN, timeout); |
| 949 | } | 948 | } |
| 950 | 949 | ||
| 951 | if (config.min_hosts_alive < -1) { | 950 | if (config.min_hosts_alive < -1) { |
diff --git a/plugins-root/check_icmp.d/check_icmp_helpers.c b/plugins-root/check_icmp.d/check_icmp_helpers.c index 0be0f2dc..d56fbd8b 100644 --- a/plugins-root/check_icmp.d/check_icmp_helpers.c +++ b/plugins-root/check_icmp.d/check_icmp_helpers.c | |||
| @@ -34,7 +34,6 @@ check_icmp_config check_icmp_config_init() { | |||
| 34 | 34 | ||
| 35 | .ttl = DEFAULT_TTL, | 35 | .ttl = DEFAULT_TTL, |
| 36 | .icmp_data_size = DEFAULT_PING_DATA_SIZE, | 36 | .icmp_data_size = DEFAULT_PING_DATA_SIZE, |
| 37 | .icmp_pkt_size = DEFAULT_PING_DATA_SIZE + ICMP_MINLEN, | ||
| 38 | .target_interval = 0, | 37 | .target_interval = 0, |
| 39 | .number_of_packets = DEFAULT_NUMBER_OF_PACKETS, | 38 | .number_of_packets = DEFAULT_NUMBER_OF_PACKETS, |
| 40 | 39 | ||
diff --git a/plugins-root/check_icmp.d/config.h b/plugins-root/check_icmp.d/config.h index 1568d6c3..ab578ba5 100644 --- a/plugins-root/check_icmp.d/config.h +++ b/plugins-root/check_icmp.d/config.h | |||
| @@ -60,7 +60,6 @@ typedef struct { | |||
| 60 | 60 | ||
| 61 | unsigned long ttl; | 61 | unsigned long ttl; |
| 62 | unsigned short icmp_data_size; | 62 | unsigned short icmp_data_size; |
| 63 | unsigned short icmp_pkt_size; | ||
| 64 | time_t target_interval; | 63 | time_t target_interval; |
| 65 | unsigned short number_of_packets; | 64 | unsigned short number_of_packets; |
| 66 | 65 | ||
