Comment 5 for bug 1889101

Revision history for this message
Takamasa Takenaka (ttakenak) wrote :

[Root Cause]
/var/log/daemon.log (filtered with "NTP")
{noformat}
2021-04-20T19:21:40.900 controller-1 collectd[113955]: info NTP query plugin server list: ['0.pool.ntp.org', '1.pool.ntp.org']
2021-04-20T19:21:40.912 controller-1 collectd[113955]: info NTPQ: *192.168.204.2
2021-04-20T19:21:41.043 controller-1 collectd[113955]: info NTP query plugin 100.114:host=controller-1.ntp alarm cleared
2021-04-20T19:21:41.044 controller-1 collectd[113955]: info NTPQ: 194.0.5.123 3 u 35 64 377 0.305 1.634 3.153
2021-04-20T19:21:41.044 controller-1 collectd[113955]: info NTPQ: +216.6.2.70
2021-04-20T19:21:41.045 controller-1 collectd[113955]: info NTPQ: 195.219.205.18 2 u 39 64 377 209.253 1.348 18.771
2021-04-20T19:21:41.045 controller-1 collectd[113955]: info NTPQ: +138.197.135.239
2021-04-20T19:21:41.045 controller-1 collectd[113955]: info NTPQ: 206.108.0.133 2 u 37 64 377 211.428 4.507 27.263
2021-04-20T19:21:41.045 controller-1 collectd[113955]: info NTP query plugin peer is selected
2021-04-20T19:21:41.089 controller-1 collectd[113955]: info NTP query plugin raised alarm 100.114:host=controller-1.ntp
{noformat}
When peer is selected as ntp server, script ntpq.py checks refid. But refid for server is not in the same line as shown above.
As a result, script could not find reliable refid, even it exists (in the following line) and does not set obj.selected_server.
Later in script, raise alarm because there is no selected_server.

[Overview Design]
When aquiring data from ntpq, conbine data lines to 1 line data if it seems 2 lines data.