Merge pull request #1448 from CPbN/ntp

Local NTP, use correct maps
This commit is contained in:
qgarnier 2019-03-26 17:03:45 +01:00 committed by GitHub
commit bb5c68a29e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -84,9 +84,17 @@ sub custom_status_calc {
$self->{result_values}->{rawtype} = $options{new_datas}->{$self->{instance} . '_type'};
$self->{result_values}->{rawstate} = $options{new_datas}->{$self->{instance} . '_state'};
$self->{result_values}->{type} = $type_map_chronyc{$options{new_datas}->{$self->{instance} . '_type'}};
if ($self->{instance_mode}->{option_results}->{command} eq 'ntpq') {
$self->{result_values}->{type} = $type_map_ntpq{$options{new_datas}->{$self->{instance} . '_type'}};
} else {
$self->{result_values}->{type} = $type_map_chronyc{$options{new_datas}->{$self->{instance} . '_type'}};
}
$self->{result_values}->{reach} = $options{new_datas}->{$self->{instance} . '_reach'};
$self->{result_values}->{state} = $state_map_chronyc{$options{new_datas}->{$self->{instance} . '_state'}};
if ($self->{instance_mode}->{option_results}->{command} eq 'ntpq') {
$self->{result_values}->{state} = $state_map_ntpq{$options{new_datas}->{$self->{instance} . '_state'}};
} else {
$self->{result_values}->{state} = $state_map_chronyc{$options{new_datas}->{$self->{instance} . '_state'}};
}
return 0;
}