perfsonar / toolkit

perfSONAR Toolkit distribution environment scripts and GUI
Apache License 2.0
30 stars 6 forks source link

toolkit fails to detect NTP (chrony) and errors out without details #393

Open fschaer opened 4 years ago

fschaer commented 4 years ago

Hi,

Just faced this : I moved all my servers to chronyd (ntpd is not an CentOS8 thing for instance, be warned), and the check-mk ps-etf monitoring pages were saying (and are still saying, but hopefuilly for 1 hour only) :

CRITICAL - Connection failed (500 Server Error: Internal Server Error)

=> Connection failed != Error 500, but whatever.

Looking at our host web url : toolkit/services/host.cgi?method=get_summary I indeed got errors 500.

Running as apache # perl /usr/lib/perfsonar/web-ng/root/services/host.cgi 'method=get_summary' , I got :

/usr/lib/perfsonar/web-ng/root/services/host.cgi 'method=get_summary'
2019/11/18 14:50:38 (275477) ERROR> Host.pm:286 perfSONAR_PS::NPToolkit::DataService::Host::get_details - Found host record in LS using 192.54.207.250
2019/11/18 14:50:39 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking owamp
2019/11/18 14:50:40 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking twamp
2019/11/18 14:50:40 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking psconfig
2019/11/18 14:50:40 (275477) DEBUG> Host.pm:437 perfSONAR_PS::NPToolkit::DataService::Host::get_services - Checking pscheduler
Alarm clock

Further debugging showed that this line was in cause :

perfSONAR_PS::NPToolkit::DataService::Host::get_details(/usr/lib/perfsonar/web-ng/root/services/../../../lib/perfSONAR_PS/NPToolkit/DataService/Host.pm:330):
330:        $status->{ntp}->{synchronized} = $ntp->is_synced();

I then tried to configure chronyd to listen on localhost on port 123 and allowed our public facing IP in an "allow x.y.z" statement : bingo : the script runs and the cgi returns a json.

Looks like ntp query error handling isn't working as expected, is it ?