-
Notifications
You must be signed in to change notification settings - Fork 6
/
config.yml
158 lines (144 loc) · 6.24 KB
/
config.yml
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
### GENERAL CONFIGURATION
### All these directives are optional. If missing, defaults will be applied (see below).
# Enable debug logging (default: false)
# If enabled, detailed information about received data will be logged.
# If disabled, only errors will be logged.
debug: true
# Maximum size of log history to maintain (default: 1000)
logsize: 1000
# hostname (default: obtained from OS or "janitor"), used for Prometheus metrics
hostname: "janitor"
# Configuration of built in web server:
# - Host name (default: '' meaning all interfaces will be bound)
# - Port number (default: 8080)
web:
host: ""
port: 8080
### MONITORING TARGETS
### All these blocks are optional. If missing, will not be monitored.
monitor:
# MQTT monitoring
mqtt:
# Server connection details
# Scheme (optional: can be mqtt or mqtts, mqtt by default) and host name
server: mqtt://openwrt.lan
# Port number (default: 1883)
port: 1883
# User and password if required
user:
password:
# Maximum number of messages to retain for display and average frequency calculation (default: 10)
history: 10
# Standard timeout to apply as a multiple of the average transmit frequency (default: 1.5, interpreted as 1.5 * avg transmit frequency)
# (can be overridden per topics below)
standardtimeout: 1.5
# Topics to monitor. Can include wildcard ('/#') and wildcard subscriptions can overlap with others.
# In case of overlap, the first matching topic will be used to determine timeout.
targets:
# Topic name
- topic: "/sensors/aqara_inside/#"
# Custom timeout threshold (fixed value in seconds) to be used for the topic (default: standardtimeout as defined above)
timeout: 3600
# Custom name to show instead of MQTT topic (note: does not work with wildcard topic names, only exact matches)
name: "Inside temperature"
- topic: "/sensors/aqara_outside/#"
timeout: 3600
- topic: "/sensors/#"
- topic: "/stats/#"
# Ping monitoring
ping:
# Default interval between checks in seconds (default: 60)
# (can be overridden per target below)
interval: 60
# Threshold for alerts - number of consecutive misses to reach (default: 2)
# (can be overridden per target below)
threshold: 2
# Targets to ping
targets:
# Name of the target (used for display and alerting)
- name: openwrt
# Network address to ping
address: openwrt.lan
# Interval between checks in seconds (default: default interval specified above)
interval: 10
# Threshold for alerts - number of consecutive misses to reach (default: default threshold specified above)
threshold: 3
- name: google
address: google.com
# HTTP monitoring
http:
# Default interval between checks in seconds (default: 60)
# (can be overridden per target below)
interval: 60
# Default timeout for the HTTP requests in milliseconds (default: 5000)
# (can be overridden per target below)
timeout: 5000
# Threshold for alerts - number of consecutive misses to reach (default: 2)
# (can be overridden per target below)
threshold: 2
# Targets to monitor with HTTP GET
targets:
# Name of the target (used for display and alerting)
- name: NAS
# HTTP address for GET request
address: http://index.nas
# String value to check for in reply (optional - not used if not specified)
value: nas
# Interval between checks in seconds (default: default interval specified above)
interval: 10
# Timeout for the HTTP requests in milliseconds (default: default interval specified above)
timeout: 500
# Threshold for alerts - number of consecutive failed requests to reach (default: default threshold specified above)
threshold: 3
- name: google
address: http://google.com
# Monitoring by executing an external command
exec:
# Default interval between checks in seconds (default: 60)
# (can be overridden per target below)
interval: 60
# Default timeout for the command to complete in milliseconds (default: 5000).
# The execution will be terminated and marked as failed when this timeout is reached.
timeout: 5000
# Threshold for alerts - number of consecutive failed commands to reach (default: 2)
# (can be overridden per target below)
threshold: 2
targets:
# Name of the target (used for display and alerting)
- name: check if /tmp/foo exists
# Command to be executed. On Linux, this will be given to a shell process.
command: test -f /tmp/foo
### ALERTING METHODS
### All these blocks are optional. If missing, will not be used for alerting.
alert:
# Telegram alerting. Please specify token and chat id for the messages.
# For more information, please see:
# https://core.telegram.org/bots#6-botfather
# https://stackoverflow.com/questions/45414021/get-telegram-channel-group-id
#telegram:
# token: "INSERTYOURTOKENHERE"
# chat: 12
# Gotify alerting. Please specify server and token.
#gotify:
# server: "http://nas:8765"
# token: AMuHwu9EhjF0Z4M
# Executing arbitrary commands. On Linux, this will be given to a shell process.
# The command will receive the alert message on standard input.
#exec: /home/joe/bin/alert.sh
# Alerting by posting to predefined MQTT topic with a JSON payload. Example payload with description of the structure:
# {"type":"HTTP", // type of the sensor - potential values: HTTP, Ping, MQTT
# "name":"NAS", // name of the sensor
# "status":"ERROR", // status of the sensor - potential values: OK, ERROR
# "since":"2020-03-22T18:58:00.157284409+01:00", // last error/ok timestamp for sensor
# "error":"", // further error message if any
# "message":"⚠ HTTP ERROR for NAS, last seen 2s ago"} // text alert message
mqtt:
# Server connection details
# Scheme (optional: can be mqtt or mqtts, mqtt by default) and host name
server: mqtt://openwrt.lan
# Port number (default: 1883)
port: 1883
# User and password if required
user:
password:
topic: /janitor/alerts