librenms / librenms-agent

LibreNMS Agent & Scripts
GNU General Public License v2.0
118 stars 188 forks source link

Add chrony support #345

Closed Serphentas closed 3 years ago

Serphentas commented 3 years ago

I am preparing a PR on the frontend side of LibreNMS to add support for chrony, and so this is just a probing script that outputs a JSON containing information from the following chronyc subcommands:

A sample output:

{"tracking": {"reference_name": "50505300", "reference_type": "PPS", "stratum": "1", "reference_time": "1611776272.200448744", "system_time": "-0.000000023", "last_offset": "0.000000019", "rms_offset": "0.000000027", "frequency": "-3.950", "residual_frequency": "0.000", "skew": "0.002", "root_delay": "0.000000001", "root_dispersion": "0.000004171", "update_interval": "4.0", "leap_status": "Normal"}, "sources": [{"source_mode": "#", "source_state": "*", "source_name": "PPS", "stratum": "0", "polling_rate": "2", "reachability": "377", "lastrx": "4", "adjusted_offset": "0.000000175", "measured_offset": "0.000000193", "estimated_error": "0.000000299", "number_samplepoints": "42", "number_runs": "23", "span": "164", "frequency": "0.000", "frequency_skew": "0.002", "offset": "0.000000000", "stddev": "0.000000183"}, {"source_mode": "#", "source_state": "-", "source_name": "GPS", "stratum": "0", "polling_rate": "2", "reachability": "377", "lastrx": "2", "adjusted_offset": "0.016692873", "measured_offset": "0.016692873", "estimated_error": "0.002781948", "number_samplepoints": "6", "number_runs": "5", "span": "21", "frequency": "210.210", "frequency_skew": "964.386", "offset": "0.018130455", "stddev": "0.001614024"}]}