forked from cuttlefish-uk/alertd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexampleConfig.js
More file actions
94 lines (81 loc) · 2.97 KB
/
exampleConfig.js
File metadata and controls
94 lines (81 loc) · 2.97 KB
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
/*
Required Variables:
services: Object containing name: config pairs defining services to monitor.
contacts: Object defining the contacts and contact groups.
Optional Variables:
port: Start a server listening on this UDP port to push metrics to.
application_name: App name used in alerts [default: alertd]
user_agent: User-Agent header to use for HTTP checks [default: alertd/0.1.0]
statsd: Object containing host, port, and key (a prefix assigned to all alertd-generated statsd keys)
*/
{
// enabling statsd allows us to record info about the behaviour of alertd
//
statsd: {
'host': '127.0.0.1',
'port': 8125,
'key': 'alertd',
},
// template service definitions help reduce boilerplate in the config
templates: {
'my_http': {
'extend': 'http', // extend the built-in http template
'interval': 120,
'contact': 'developers',
},
},
// services are things we want to monitor
//
services: {
// here's a full example
'example.com': {
'interval': 120, // check this service every 2 minutes
'fetch': 'http', // fetch over http
'check': 'http', // and check using the http checker
'contact': 'developers', // if checks fail, notify the developers contact
// the http checker supports any or all of the following 3 options:
//'statusCode': 200, // this is optional and defaults to 200.
//'bodyMatch': /not available for registration/, // ensure body matches a regex
'duration': 2, // ensure a response is received within 2 seconds
//'url': 'http://example.com', // URL is optional and defaults to service name unless request is specified:
//'request': {
// // this is passed directly to http.request so can include custom headers etc.
//},
},
// here's a trimmed down version of the above using the built-in http service template.
'example.com/2': {
'extend': 'http',
'interval': 120,
'contact': 'developers',
},
// and trimmed down further using our defined template
'example.com/3': {'extend': 'my_http'},
/*
* This service has no interval so won't be polled.
* It's only checked if we're using the statsd backend, or
* if we're running as a server (the srv.s1.load5 metric is
* to be pushed to alertd).
*/
'srv.s1.load5': {
'check': 'value_gt', // check whether the value of this metric exceeds thresholds
'contact': 'dougal', // notify dougal
// the value checkers (gt, lt, eq) support the following 2 threshold options:
'warning': 2, // warn if >= 2
'critical': 5, // send critical alert if >= 5
},
},
contacts: {
'ted': {
'email': 'ted@example.com'
},
'ted_mobile': {
'method': 'prowl',
'api_key': 'insert prowl api key here',
},
'dougal': {
'email': 'dougal@example.com'
},
// a contact may be an array of other contact names
'developers': ['ted', 'ted_mobile', 'dougal']
}
}