-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.schema.json
208 lines (208 loc) · 8.12 KB
/
config.schema.json
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "metricq-nsca-sink (passive check result reporter) configuration",
"description": "Configuration describing which metrics to monitor and provide results for, based on their availability and value range",
"type": "object",
"definitions": {
"duration": {
"type": "string",
"pattern": "^\\s*([+-]?\\d*[.,]?\\d+)\\s*([^\\d]*)\\s*$"
},
"resend_interval": {
"$ref": "#/definitions/duration",
"description": "Minimum time interval at which a check should trigger reports, even if its overall state did not change.\nThis is useful for keeping the Centreon/Nagios host up-to-date and signaling that this passive check is not dead."
},
"overrides": {
"type": "object",
"properties": {
"ignored_metrics": {
"type": "array",
"items": {
"oneOf": [
{ "$ref": "#/definitions/metric_name" },
{ "$ref": "#/definitions/metric_name_prefix_pattern" }
]
},
"default": []
}
}
},
"metric_name": {
"type": "string",
"pattern": "^([a-zA-Z][a-zA-Z0-9_]+\\.)+[a-zA-Z][a-zA-Z0-9_]+$"
},
"metric_name_prefix_pattern": {
"type": "string",
"pattern": "^([a-zA-Z][a-zA-Z0-9_]+\\.)*\\*$",
"examples": ["foo.bar.*"]
}
},
"properties": {
"reporting_host": {
"type": "string",
"description": "Name of the host for which check results are reported, as configured in Nagios/Centreon (defaults to the output of hostname(1))"
},
"nsca": {
"type": "object",
"description": "NSCA host settings",
"properties": {
"host": {
"type": "string",
"description": "Address of the NSCA daemon to which check results are sent (see `-H` flag of `send_nsca`)"
},
"port": {
"type": "integer",
"description": "Port of the NSCA daemon to which check results are sent (see `-p` flag of `send_nsca`)"
},
"executable": {
"type": "string",
"description": "Path of `send_nsca` executable to use for sending check results"
},
"config_file": {
"type": "string",
"description": "Path to `send_nsca` configuration file (see `-c` flag of `send_nsca`)"
}
}
},
"resend_interval": {
"$ref": "#/definitions/resend_interval"
},
"overrides": {
"$ref": "#/definitions/overrides"
},
"checks": {
"type": "object",
"description": "Configuration for each value/timeout check, by Nagios/Centreon service name",
"patternProperties": {
"^[^\\s;]+$": {
"type": "object",
"description": "Passive check configuration",
"properties": {
"metrics": {
"type": "array",
"description": "List of metrics that should be monitored",
"minItems": 1,
"uniqueItems": true,
"items": {
"type": "string",
"description": "Name of a MetricQ metric"
}
},
"warning_below": {
"type": "number",
"description": "Send a check result of severity \"WARNING\" if the values sent by any monitored metric go below this threshold"
},
"warning_above": {
"type": "number",
"description": "Send a check result of severity \"WARNING\" if the values sent by any monitored metric go above this threshold"
},
"critical_below": {
"type": "number",
"description": "Send a check result of severity \"CRITICAL\" if the values sent by any monitored metric go below this threshold"
},
"critical_above": {
"type": "number",
"description": "Send a check result of severity \"CRITICAL\" if the values sent by any monitored metric go above this threshold"
},
"ignore": {
"type": "array",
"description": "A list of values considered \"OK\", ignored by critical_* and warning_* checks",
"uniqueItems": true,
"items": {
"type": "number"
}
},
"timeout": {
"type": "string",
"description": "Send check result of severity \"WARNING\" if no values arrive apart more than the specified period",
"pattern": "^\\s*([+-]?\\d*[.,]?\\d+)\\s*([^\\d]*)\\s*$"
},
"resend_interval": {
"$ref": "#/definitions/resend_interval"
},
"transition_debounce_window": {
"$ref": "#/definitions/duration"
},
"transition_postprocessing": {
"type": "object",
"allOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
{
"oneOf": [
{
"properties": {
"type": {
"const": "debounce"
}
}
},
{
"properties": {
"type": {
"const": "ignore_short_transitions"
},
"minimum_duration": {
"$ref": "#/definitions/duration"
}
}
},
{
"description": "Ignore a number of consecutive bad states",
"properties": {
"type": {
"const": "soft_fail"
},
"max_fail_count": {
"type": "integer",
"description": "The number of consecutive bad states that are ignored in favour of the preceeding good state"
}
}
}
]
}
],
"description": "If a check enters a new state for less than this duration, ignore the transition and keep the previous state",
"$ref": "#/definitions/duration"
},
"plugins": {
"type": "object",
"description": "A collection of plugin files to be loaded for this check",
"patternProperties": {
"[a-z_]+": {
"type": "object",
"description": "A plugin to load.\nPlugins are python files that expose a single entry point `get_plugin(name: str, config: dict, metric: Set[str]) -> metricq_sink_nsca.plugin.Plugin`. It returns an initialized plugin instance.",
"properties": {
"file": {
"type": "string",
"description": "File system path to plugin implementation (.py file)"
},
"config": {
"type": "object",
"description": "Optional configuration data for this plugin"
}
},
"required": [
"file"
]
}
}
}
},
"required": [
"metrics"
]
}
}
}
},
"required": [
"checks"
]
}