1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
#pragma once
#include "../../config.h"
#include "thresholds.h"
#include <stddef.h>
enum {
DEFAULT_NTP_PORT = 123,
};
typedef struct {
char *server_address;
int port;
bool quiet;
// truechimer stuff
bool do_truechimers;
char *twarn;
char *tcrit;
thresholds *truechimer_thresholds;
char *owarn;
char *ocrit;
thresholds *offset_thresholds;
// stratum stuff
bool do_stratum;
char *swarn;
char *scrit;
thresholds *stratum_thresholds;
// jitter stuff
bool do_jitter;
char *jwarn;
char *jcrit;
thresholds *jitter_thresholds;
} check_ntp_peer_config;
check_ntp_peer_config check_ntp_peer_config_init() {
check_ntp_peer_config tmp = {
.server_address = NULL,
.port = DEFAULT_NTP_PORT,
.quiet = false,
.do_truechimers = false,
.twarn = "0:",
.tcrit = "0:",
.truechimer_thresholds = NULL,
.owarn = "60",
.ocrit = "120",
.offset_thresholds = NULL,
.do_stratum = false,
.swarn = "-1:16",
.scrit = "-1:16",
.stratum_thresholds = NULL,
.do_jitter = false,
.jwarn = "-1:5000",
.jcrit = "-1:10000",
.jitter_thresholds = NULL,
};
return tmp;
}
|