Local NTP, use correct maps

This commit is contained in:
CPbN 2019-03-26 16:56:52 +01:00
parent 0dc2237360
commit d3954ca8df
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;
}