cmdmon: allow client records to be reset

Add a flag to the CLIENT_ACCESSES_BY_INDEX request to reset the
NTP/cmdmon hits/dropped counters after reporting the current values.

Add -r option to the chronyc clients command to perform the reset. This
should make it easier to find clients that send large number of requests
over short periods of time.
This commit is contained in:
Miroslav Lichvar
2020-05-18 13:28:49 +02:00
parent a6ec6ec3ac
commit ee2220f2e7
7 changed files with 39 additions and 14 deletions

View File

@@ -105,7 +105,8 @@
#define REQ_NTP_SOURCE_NAME 65
#define REQ_RESET_SOURCES 66
#define REQ_AUTH_DATA 67
#define N_REQUEST_TYPES 68
#define REQ_CLIENT_ACCESSES_BY_INDEX3 68
#define N_REQUEST_TYPES 69
/* Structure used to exchange timespecs independent of time_t size */
typedef struct {
@@ -321,6 +322,7 @@ typedef struct {
typedef struct {
uint32_t first_index;
uint32_t n_clients;
uint32_t reset;
int32_t EOR;
} REQ_ClientAccessesByIndex;