mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-23 02:43:02 -04:00
check_ntp_peer: do not use uninitialized results for max state
s/t/jresult are not initialized if there is no corresponding threshold supplied. So we shouldn't use them for calculating our result. Signed-off-by: Sven Nierlein <sven@nierlein.de>
This commit is contained in:
parent
a3dcdb8723
commit
df08974bf0
1 changed files with 6 additions and 3 deletions
|
|
@ -599,17 +599,20 @@ int main(int argc, char *argv[]){
|
|||
}
|
||||
oresult = result;
|
||||
|
||||
if(do_truechimers)
|
||||
if(do_truechimers) {
|
||||
tresult = get_status(num_truechimers, truechimer_thresholds);
|
||||
result = max_state_alt(result, tresult);
|
||||
}
|
||||
|
||||
if(do_stratum)
|
||||
if(do_stratum) {
|
||||
sresult = get_status(stratum, stratum_thresholds);
|
||||
result = max_state_alt(result, sresult);
|
||||
}
|
||||
|
||||
if(do_jitter)
|
||||
if(do_jitter) {
|
||||
jresult = get_status(jitter, jitter_thresholds);
|
||||
result = max_state_alt(result, jresult);
|
||||
}
|
||||
|
||||
switch (result) {
|
||||
case STATE_CRITICAL :
|
||||
|
|
|
|||
Loading…
Reference in a new issue