[monitoring-plugins] check_icmp: cleanup some leftover comments

Lorenz Kästle git at monitoring-plugins.org
Mon Jun 23 12:10:11 CEST 2025


 Module: monitoring-plugins
 Branch: master
 Commit: efba4f76545fe03aa9b9af35f23e6f7aad5aabcd
 Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
   Date: Mon Jun 23 10:32:24 2025 +0200
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=efba4f76

check_icmp: cleanup some leftover comments

---

 plugins-root/check_icmp.c | 23 +----------------------
 1 file changed, 1 insertion(+), 22 deletions(-)

diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c
index bad73cc4..7f01e1b6 100644
--- a/plugins-root/check_icmp.c
+++ b/plugins-root/check_icmp.c
@@ -484,7 +484,7 @@ check_icmp_config_wrapper process_arguments(int argc, char **argv) {
 						result.config.need_v6 = true;
 					}
 				} else {
-					// TODO adding host failed, crash here
+					crash("Failed to add host, unable to parse it correctly");
 				}
 			} break;
 			case 'l':
@@ -848,19 +848,6 @@ int main(int argc, char **argv) {
 		mp_set_format(config.output_format);
 	}
 
-	// int icmp_proto = IPPROTO_ICMP;
-	// add_target might change address_family
-	// switch (address_family) {
-	// case AF_INET:
-	// 	icmp_proto = IPPROTO_ICMP;
-	// 	break;
-	// case AF_INET6:
-	// 	icmp_proto = IPPROTO_ICMPV6;
-	// 	break;
-	// default:
-	// 	crash("Address family not supported");
-	// }
-
 	check_icmp_socket_set sockset = {
 		.socket4 = -1,
 		.socket6 = -1,
@@ -1556,14 +1543,6 @@ static void finish(int sig, check_icmp_mode_switches modes, int min_hosts_alive,
 		mp_add_subcheck_to_check(overall, host_check.sc_host);
 	}
 
-	/* this is inevitable */
-	// if (targets_alive(number_of_targets, program_state->targets_down) == 0) {
-	// 	mp_subcheck sc_no_target_alive = mp_subcheck_init();
-	// 	sc_no_target_alive = mp_set_subcheck_state(sc_no_target_alive, STATE_CRITICAL);
-	// 	sc_no_target_alive.output = strdup("No target is alive!");
-	// 	mp_add_subcheck_to_check(overall, sc_no_target_alive);
-	// }
-
 	if (min_hosts_alive > -1) {
 		mp_subcheck sc_min_targets_alive = mp_subcheck_init();
 		sc_min_targets_alive = mp_set_subcheck_default_state(sc_min_targets_alive, STATE_OK);



More information about the Commits mailing list