diff options
Diffstat (limited to 'plugins-root/check_icmp.c')
-rw-r--r-- | plugins-root/check_icmp.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 34adf6fe..58f5ae70 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c | |||
@@ -878,14 +878,14 @@ int main(int argc, char **argv) { | |||
878 | 878 | ||
879 | check_icmp_state program_state = check_icmp_state_init(); | 879 | check_icmp_state program_state = check_icmp_state_init(); |
880 | 880 | ||
881 | run_checks(config.modes, config.min_hosts_alive, config.icmp_data_size, | 881 | run_checks(config.modes, config.min_hosts_alive, config.icmp_data_size, &pkt_interval, |
882 | &pkt_interval, &target_interval, config.warn, config.crit, config.sender_id, | 882 | &target_interval, config.warn, config.crit, config.sender_id, config.mode, |
883 | config.mode, max_completion_time, prog_start, table, config.number_of_packets, | 883 | max_completion_time, prog_start, table, config.number_of_packets, icmp_sock, |
884 | icmp_sock, config.number_of_targets, &program_state, config.targets); | 884 | config.number_of_targets, &program_state, config.targets); |
885 | 885 | ||
886 | errno = 0; | 886 | errno = 0; |
887 | finish(0, config.modes, config.min_hosts_alive, config.warn, config.crit, | 887 | finish(0, config.modes, config.min_hosts_alive, config.warn, config.crit, icmp_sock, |
888 | icmp_sock, config.number_of_targets, &program_state, config.targets); | 888 | config.number_of_targets, &program_state, config.targets); |
889 | 889 | ||
890 | return (0); | 890 | return (0); |
891 | } | 891 | } |
@@ -906,9 +906,8 @@ static void run_checks(check_icmp_mode_switches modes, int min_hosts_alive, | |||
906 | for (unsigned int target_index = 0; target_index < number_of_targets; target_index++) { | 906 | for (unsigned int target_index = 0; target_index < number_of_targets; target_index++) { |
907 | /* don't send useless packets */ | 907 | /* don't send useless packets */ |
908 | if (!targets_alive(number_of_targets, program_state->targets_down)) { | 908 | if (!targets_alive(number_of_targets, program_state->targets_down)) { |
909 | finish(0, modes, | 909 | finish(0, modes, min_hosts_alive, warn, crit, icmp_sock, number_of_targets, |
910 | min_hosts_alive, warn, crit, icmp_sock, number_of_targets, program_state, | 910 | program_state, target_list); |
911 | target_list); | ||
912 | } | 911 | } |
913 | if (table[target_index]->flags & FLAG_LOST_CAUSE) { | 912 | if (table[target_index]->flags & FLAG_LOST_CAUSE) { |
914 | if (debug) { | 913 | if (debug) { |
@@ -953,9 +952,8 @@ static void run_checks(check_icmp_mode_switches modes, int min_hosts_alive, | |||
953 | if (debug) { | 952 | if (debug) { |
954 | printf("Time passed. Finishing up\n"); | 953 | printf("Time passed. Finishing up\n"); |
955 | } | 954 | } |
956 | finish(0, modes, | 955 | finish(0, modes, min_hosts_alive, warn, crit, icmp_sock, number_of_targets, |
957 | min_hosts_alive, warn, crit, icmp_sock, number_of_targets, program_state, | 956 | program_state, target_list); |
958 | target_list); | ||
959 | } | 957 | } |
960 | 958 | ||
961 | /* catch the packets that might come in within the timeframe, but | 959 | /* catch the packets that might come in within the timeframe, but |
@@ -2065,7 +2063,8 @@ static add_host_wrapper add_host(char *arg, check_icmp_execution_mode mode) { | |||
2065 | mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, | 2063 | mp_subcheck evaluate_target(ping_target target, check_icmp_mode_switches modes, |
2066 | check_icmp_threshold warn, check_icmp_threshold crit) { | 2064 | check_icmp_threshold warn, check_icmp_threshold crit) { |
2067 | /* if no new mode selected, use old schema */ | 2065 | /* if no new mode selected, use old schema */ |
2068 | if (!modes.rta_mode && !modes.pl_mode && !modes.jitter_mode && !modes.score_mode && !modes.mos_mode && !modes.order_mode) { | 2066 | if (!modes.rta_mode && !modes.pl_mode && !modes.jitter_mode && !modes.score_mode && |
2067 | !modes.mos_mode && !modes.order_mode) { | ||
2069 | modes.rta_mode = true; | 2068 | modes.rta_mode = true; |
2070 | modes.pl_mode = true; | 2069 | modes.pl_mode = true; |
2071 | } | 2070 | } |