Révision 357c3586
chrony_status: add a serverstats graph
This graph shows packet rates for the chronyd server.
| plugins/chrony/chrony_status | ||
|---|---|---|
| 12 | 12 |
|
| 13 | 13 |
=head1 CONFIGURATION |
| 14 | 14 |
|
| 15 |
No configuration is required for this plugin. |
|
| 15 |
Needs to be run as the user running chronyd (or root) in order to access the |
|
| 16 |
Unix domain socket which chronyc uses to communicate with chronyd. Example |
|
| 17 |
/etc/munin/plugin-conf.d/chrony_status.conf: |
|
| 18 |
|
|
| 19 |
[chrony_status] |
|
| 20 |
user _chrony |
|
| 16 | 21 |
|
| 17 | 22 |
=head1 INTERPRETATION |
| 18 | 23 |
|
| 19 |
Monitor Chrony's stratum value (with warning), time offset, network delay |
|
| 20 |
and clock frequency. It would be very easy to monitor all Chrony's values, but
|
|
| 21 |
IMHO they aren't needed. The most important information in stratum, giving
|
|
| 22 |
"synced" / "not synced" value. |
|
| 24 |
Monitor Chrony's stratum value (with warning), time offset, network delay, clock
|
|
| 25 |
frequency, packets received, and packets dropped. It would be very easy to
|
|
| 26 |
monitor all of Chrony's values, but IMHO they aren't needed. The most important
|
|
| 27 |
information is stratum, giving "synced" / "not synced" value.
|
|
| 23 | 28 |
|
| 24 | 29 |
=head1 AUTHOR |
| 25 | 30 |
|
| ... | ... | |
| 47 | 52 |
'systime': 'System time', |
| 48 | 53 |
'delay': 'Root delay', |
| 49 | 54 |
'frequency': 'Frequency', |
| 55 |
'received': 'NTP packets received', |
|
| 56 |
'dropped': 'NTP packets dropped', |
|
| 57 |
'command_received': 'Command packets received', |
|
| 58 |
'command_dropped': 'Command packets dropped', |
|
| 59 |
'client_log_records_dropped': 'Client log records dropped', |
|
| 50 | 60 |
} |
| 51 | 61 |
|
| 52 | 62 |
|
| 53 | 63 |
def get_values(): |
| 54 |
"""Run "chronyc tracking" and parse it's output.
|
|
| 64 |
"""Run `chronyc tracking` and `chronyc serverstats` and parse their output.
|
|
| 55 | 65 |
|
| 56 | 66 |
Return: list of (label, value, description) |
| 57 | 67 |
""" |
| 58 | 68 |
try: |
| 59 |
output = subprocess.run(['chronyc', 'tracking'],
|
|
| 69 |
output = subprocess.run(['chronyc', '-m', 'tracking', 'serverstats'],
|
|
| 60 | 70 |
stdout=subprocess.PIPE, check=False, |
| 61 | 71 |
encoding='utf-8', errors='ignore') |
| 62 | 72 |
except FileNotFoundError: |
| ... | ... | |
| 107 | 117 |
print('graph_args --base 1000')
|
| 108 | 118 |
print('frequency.label Local clock frequency error')
|
| 109 | 119 |
|
| 120 |
print('multigraph chrony_serverstats')
|
|
| 121 |
print('graph_title Chrony server statistics')
|
|
| 122 |
print('graph_vlabel Packets/${graph_period}')
|
|
| 123 |
print('graph_category time')
|
|
| 124 |
print('graph_args --base 1000')
|
|
| 125 |
print('received.label Packets received')
|
|
| 126 |
print('received.type DERIVE')
|
|
| 127 |
print('received.min 0')
|
|
| 128 |
print('dropped.label Packets dropped')
|
|
| 129 |
print('dropped.type DERIVE')
|
|
| 130 |
print('dropped.min 0')
|
|
| 131 |
print('command_received.label Command packets received')
|
|
| 132 |
print('command_received.type DERIVE')
|
|
| 133 |
print('command_received.min 0')
|
|
| 134 |
print('command_dropped.label Command packets dropped')
|
|
| 135 |
print('command_dropped.type DERIVE')
|
|
| 136 |
print('command_dropped.min 0')
|
|
| 137 |
print('client_log_records_dropped.label Client log records dropped')
|
|
| 138 |
print('client_log_records_dropped.type DERIVE')
|
|
| 139 |
print('client_log_records_dropped.min 0')
|
|
| 140 |
|
|
| 110 | 141 |
if os.environ.get('MUNIN_CAP_DIRTYCONFIG') == '1':
|
| 111 | 142 |
fetch() |
| 112 | 143 |
|
Formats disponibles : Unified diff