SuperQ / chrony_exporter

Exporter for Chrony NTP
Apache License 2.0
41 stars 11 forks source link

Feature request: Connect via unix socket rather than UDP #41

Closed growse closed 12 months ago

growse commented 1 year ago

I'm currently running chrony with the cmdport set to 0 so that no UDP cmd socket is open. /run/chrony/chronyd.sock still exists and is what chronyc etc use to connect to chronyd.

Right now, the exporter only supports UDP, but it looks like there's some code in the facebook repo that looks to use the same golang lib to connect over unixgram: https://github.com/facebook/time/blob/512b3b30ab2387f45954a90a25645535a4ee1e54/cmd/ntpcheck/checker/chrony.go#L38

I had a very quick go at trying to get this to work, but the exporter just seems to hang when trying to fetch stats. I'm not sure if there's something else needed to get unix socket support, or if I've missed something obvious, but this would be a nice-to-have.

SuperQ commented 1 year ago

I think you're looking for https://github.com/SuperQ/chrony_exporter/pull/35. Waiting on some changes from the author.

growse commented 1 year ago

Oh - apologies, I completely missed this. Will watch that (y)