-
Notifications
You must be signed in to change notification settings - Fork 14
/
pillar.example
199 lines (179 loc) · 6.32 KB
/
pillar.example
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
# vi: set ft=yaml:
pyenv:
versions:
python-3.10.13: True
postgres:
use_upstream_repo: True
version: 15
pkgs_extra:
- postgresql-plpython3-15
- postgresql-server-dev-15
postgresconf: |-
listen_addresses = '*'
shared_buffers = 4GB
work_mem = 4GB
maintenance_work_mem = 2GB
synchronous_commit = off
commit_delay = 10000
max_wal_size = 4GB
min_wal_size = 2GB
checkpoint_completion_target = 0.9
effective_cache_size = 4GB
default_statistics_target = 500
pg_hba.conf: salt://postgres/templates/pg_hba.conf.j2
acls:
- ["local", "all", "alerta"]
- ["host", "all", "alerta", "0/0"]
config_backup: False # depends on salt-call which is not available in salt-ssh
users:
alerta:
ensure: present
password: xxxxxxxxxxxxx
createdb: False
createroles: False
inherit: True
replication: False
databases:
alerta:
owner: alerta
template: template0
lc_ctype: en_US.UTF-8
lc_collate: en_US.UTF-8
extensions:
uuid-ossp:
maintenance_db: alerta
alerta:
domain: alerta.example.com
acme_account: example.com
#alias: # optional
# domain: alerta.olddomain.com
# acme_account: olddomain.com
#redirect: # optional
# domain: alerta.olddomain.com
# acme_account: olddomain.com
pyenv_version: 3.10.13 # remove /opt/alerta/alerta in case of changing the version
version: v9.0.3
webui_source: salt://alerta/files/v8.7.1/alerta-webui.tar.gz # patched version with customer, group autocomplete and customer sort
db:
user: alerta
pass: xxxxxxxxxxxxxxxx
host: localhost
name: alerta
secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1
cli_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 40 | head -n 1
uwsgi:
processes: 30
listen: 1500
customers:
- id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx # apt-get install uuid-runtime; uuidgen
match: example # Use login, Keycloak role, GitHub org, GitLab group or email domain
customer: Example
keys:
# global
- text: cli
id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
scopes: "{admin,read,write}"
- text: telegram
id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
scopes: "{write:webhooks}"
# customers
- text: mon
id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
scopes: "{write:alerts,write:heartbeats}"
customer: Example
telegram_template: |{% raw %}
source: [alerta](https://alerta.example.com/alert/{{ id }})
severity: *{{ severity }}*
previous-severity: *{{ previous_severity }}*
status: *{{ status }}*
customer: *{{ customer|replace('_', '-')|replace('*', '-') }}*
environment: *{{ environment|replace('_', '-')|replace('*', '-') }}*
service: *{{ service|join(', ')|replace('_', '-')|replace('*', '-') }}*
resource: *{{ resource|replace('_', '-')|replace('*', '-') }}*
event: *{{ event|replace('_', '-')|replace('*', '-') }}*
value: *{{ value|replace('_', '-')|replace('*', '-') }}*
group: *{{ group|replace('_', '-')|replace('*', '-') }}*
origin: *{{ origin|replace('_', '-')|replace('*', '-') }}*
{% for a_key, a_val in attributes.items()|sort %}{{ a_key|replace('_', '-')|replace('*', '-') }}: *{{ a_val|replace('_', '-')|replace('*', '-') }}*
{% endfor %}
```
{{ text }}
```
{% endraw %}
config: | # https://github.com/alerta/alerta/blob/master/alerta/settings.py https://github.com/alerta/alerta-docs/blob/master/configuration.rst
DASHBOARD_URL = 'https://alerta.example.com/'
AUTH_REQUIRED = True
ADMIN_USERS = ['root','admin']
SIGNUP_ENABLED = False
AUTH_PROVIDER = 'gitlab'
GITLAB_URL = 'https://gitlab.example.com'
ALLOWED_GITLAB_GROUPS = ['group1/subgroup2', 'group1/subgroup3']
OAUTH2_CLIENT_ID = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
OAUTH2_CLIENT_SECRET = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
CUSTOMER_VIEWS = True
SITE_LOGO_URL = 'https://example.com/uploads/example.png'
DATE_FORMAT_LONG_DATE = 'YYYY-MM-DD HH:mm:ss Z'
DATE_FORMAT_MEDIUM_DATE = 'YYYY-MM-DD HH:mm'
DATE_FORMAT_SHORT_TIME = 'HH:mm'
DEFAULT_AUDIO_FILE = '/audio/alert_high-intensity.ogg'
API_KEY_EXPIRE_DAYS = 36500 # 100 years
ALERT_TIMEOUT = 86400
HEARTBEAT_TIMEOUT = 86400
DEFAULT_EXPIRED_DELETE_HRS = 12
DEFAULT_INFO_DELETE_HRS = 0 # do not delete info alerts
SEVERITY_MAP = {
'fatal': 0,
'security': 0,
'critical': 1,
'major': 2,
'minor': 3,
'warning': 4,
'ok': 5,
'normal': 5,
'cleared': 5,
'indeterminate': 5,
'informational': 6,
'debug': 7,
'trace': 8,
'unknown': 9
}
COLOR_MAP = {
'severity': {
'fatal': '#8f4df7',
'security': '#d323eb',
'critical': '#fa3e3e',
'major': '#faae20',
'minor': '#fae848',
'warning': '#fa7d3e',
'ok': '#5de35d',
'normal': '#5de35d',
'cleared': '#5de35d',
'indeterminate': '#6fc5ed',
'informational': '#66edbe',
'debug': '#e32bab',
'trace': '#7456b8',
'unknown': '#d3dcde'
},
'text': 'black',
'highlight': 'skyblue'
}
DEFAULT_NORMAL_SEVERITY = 'ok'
DEFAULT_PREVIOUS_SEVERITY = 'indeterminate'
PLUGINS = ['blackout','telegram']
PLUGINS_RAISE_ON_ERROR = True
BLACKOUT_DURATION = 3600
NOTIFICATION_BLACKOUT = True
BLACKOUT_ACCEPT = True
TELEGRAM_TEMPLATE = '/opt/alerta/alerta/telegram_template.jinja'
TELEGRAM_FILTER_NOTIFICATION_SEVERITY = ['fatal', 'security', 'critical']
TELEGRAM_SOUND_NOTIFICATION_SEVERITY = ['fatal']
TELEGRAM_TOKEN = 'xxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
TELEGRAM_CHAT_ID = '-xxxxxxxxxxxxx'
TELEGRAM_WEBHOOK_URL = 'https://alerta.example.com/api/webhooks/telegram?api-key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
TELEGRAM_CHAT_ID_PER_CUSTOMER = {
'Example': '-xxxxxxxxxxxxx',
}
SORT_LIST_BY = ['severity', 'customer', 'status', 'resource']