diff options
| author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-11-23 00:11:39 +0100 |
|---|---|---|
| committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-11-23 00:11:39 +0100 |
| commit | 479ff15249f0eb395c97a95fe53b3238f7bb59b9 (patch) | |
| tree | 28a76264eedb54ac32100ae979632e9c29049ede /plugins | |
| parent | 1b06060cbcc4bf637fcdbfec181d738f01dfed46 (diff) | |
| download | monitoring-plugins-479ff15249f0eb395c97a95fe53b3238f7bb59b9.tar.gz | |
check_ntp_peer: Fixes for Wmaybe-unitialized and some restructuring
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_ntp_peer.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/check_ntp_peer.c b/plugins/check_ntp_peer.c index 4fb9018c..464a9e10 100644 --- a/plugins/check_ntp_peer.c +++ b/plugins/check_ntp_peer.c | |||
| @@ -558,7 +558,6 @@ char *perfd_truechimers (int num_truechimers) | |||
| 558 | 558 | ||
| 559 | int main(int argc, char *argv[]){ | 559 | int main(int argc, char *argv[]){ |
| 560 | int result, offset_result, stratum, num_truechimers; | 560 | int result, offset_result, stratum, num_truechimers; |
| 561 | int oresult, jresult, sresult, tresult = STATE_UNKNOWN; | ||
| 562 | double offset=0, jitter=0; | 561 | double offset=0, jitter=0; |
| 563 | char *result_line, *perfdata_line; | 562 | char *result_line, *perfdata_line; |
| 564 | 563 | ||
| @@ -595,18 +594,28 @@ int main(int argc, char *argv[]){ | |||
| 595 | result = STATE_UNKNOWN; | 594 | result = STATE_UNKNOWN; |
| 596 | result = max_state_alt(result, get_status(fabs(offset), offset_thresholds)); | 595 | result = max_state_alt(result, get_status(fabs(offset), offset_thresholds)); |
| 597 | } | 596 | } |
| 598 | oresult = result; | 597 | |
| 598 | int oresult = result; | ||
| 599 | |||
| 600 | |||
| 601 | int tresult = STATE_UNKNOWN; | ||
| 599 | 602 | ||
| 600 | if(do_truechimers) { | 603 | if(do_truechimers) { |
| 601 | tresult = get_status(num_truechimers, truechimer_thresholds); | 604 | tresult = get_status(num_truechimers, truechimer_thresholds); |
| 602 | result = max_state_alt(result, tresult); | 605 | result = max_state_alt(result, tresult); |
| 603 | } | 606 | } |
| 604 | 607 | ||
| 608 | |||
| 609 | int sresult = STATE_UNKNOWN; | ||
| 610 | |||
| 605 | if(do_stratum) { | 611 | if(do_stratum) { |
| 606 | sresult = get_status(stratum, stratum_thresholds); | 612 | sresult = get_status(stratum, stratum_thresholds); |
| 607 | result = max_state_alt(result, sresult); | 613 | result = max_state_alt(result, sresult); |
| 608 | } | 614 | } |
| 609 | 615 | ||
| 616 | |||
| 617 | int jresult = STATE_UNKNOWN; | ||
| 618 | |||
| 610 | if(do_jitter) { | 619 | if(do_jitter) { |
| 611 | jresult = get_status(jitter, jitter_thresholds); | 620 | jresult = get_status(jitter, jitter_thresholds); |
| 612 | result = max_state_alt(result, jresult); | 621 | result = max_state_alt(result, jresult); |
