forked from openstack/monasca-notification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotification.yaml
180 lines (165 loc) · 5.96 KB
/
notification.yaml
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
kafka:
url: 192.168.10.4:9092 # or comma seperated list of multiple hosts
group: monasca-notification
alarm_topic: alarm-state-transitions
notification_topic: alarm-notifications
notification_retry_topic: retry-notifications
periodic:
60: 60-seconds-notifications
max_offset_lag: 600 # In seconds, undefined for none
database:
# repo_driver: monasca_notification.common.repositories.postgres.pgsql_repo:PostgresqlRepo
# repo_driver: monasca_notification.common.repositories.orm.orm_repo:OrmRepo
repo_driver: monasca_notification.common.repositories.mysql.mysql_repo:MysqlRepo
orm:
url: 'postgres://notification:[email protected]:5432/mon'
mysql:
host: 192.168.10.4
port: 3306
user: notification
passwd: password
db: mon
# A dictionary set according to the params defined in, http://dev.mysql.com/doc/refman/5.0/en/mysql-ssl-set.html
# ssl: {'ca': '/path/to/ca'}
postgresql:
user: notification
password: password
database: mon
port: 5432
host: 127.0.0.1
notification_types:
plugins:
- monasca_notification.plugins.hipchat_notifier:HipChatNotifier
- monasca_notification.plugins.slack_notifier:SlackNotifier
email:
server: 192.168.10.4
port: 25
user:
password:
timeout: 60
from_addr: [email protected]
template:
subject: "{{ {'ALARM': 'ALARM TRIGGERED', 'OK': 'Alarm cleared', 'UNDETERMINED':'Missing alarm data'}[state] }} for {{alarm_name}}"
text: |
<table style="width="805" cellspacing="10pt">
<tbody>
<h1>OpenStack Monitoring Notification</h1>
</td>
</tr>
</tbody>
</table>
<h2>Alarm {{alarm_name}} changed to status {{status}}</h2>
<p>{{alarm_description}}</p>
<p>Additional Information:</p>
<table>
<tbody>
<tr>
<td style="text-align: left;"><strong>Status</strong></td>
<td>{{_state}}</td>
<td><strong>Previous State</strong></td>
<td>{{_old_state}}</td>
</tr>
<tr>
<td style="text-align: left;"><strong>Severity</strong></td>
<td>{{_severity}}</td>
<td><strong>Timestamp</strong></td>
<td>{{_timestamp}}</td>
</tr>
</tbody>
</table>
mime_type: text/html
webhook:
timeout: 5
pagerduty:
timeout: 5
url: "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
hipchat:
timeout: 5
ca_certs: "/etc/ssl/certs/ca-certificates.crt"
insecure: False
proxy: https://myproxy.corp.com:8080
slack:
timeout: 5
ca_certs: "/etc/ssl/certs/ca-certificates.crt"
insecure: False
proxy: https://myproxy.corp.com:8080
template:
text: |
{
"username": "Monasca ({{.Values.cluster_region}})",
"mrkdwn": true,
"attachments": [
{
"fallback": "{{alarm_description}}",
"color": "{{ {'ALARM': '#d60000', 'OK': '#36a64f', 'UNDETERMINED': '#fff000'}[state] }}",
"title": "{{ {'ALARM': '*Alarm triggered*', 'OK': 'Alarm cleared', 'UNDETERMINED':'Missing alarm data'}[state] }} for {{alarm_name}}",
"text": "{% if state == 'ALARM' %}:bomb:{{alarm_description}}\n{{message}}{% elif state == 'OK' %}:white_check_mark: Resolved: {{alarm_description}}{% else %}:grey_question:{{alarm_description}}{% endif %}",
{% if state == 'ALARM' %}
"fields": [
{
"title": "Severity",
"value": "{{severity}}",
"short": true
},
{
"title": "Previous State",
"value": "{{old_state}}",
"short": true
}
],
{% endif %}
"mrkdwn_in": ["text", "title"]
}
]
}
mime_type: application/json
processors:
alarm:
number: 2
ttl: 14400 # In seconds, undefined for none. Alarms older than this are not processed
notification:
number: 4
retry:
interval: 30
max_attempts: 5
queues:
alarms_size: 256
finished_size: 256
notifications_size: 256
sent_notifications_size: 50 # limiting this size reduces potential # of re-sent notifications after a failure
zookeeper:
url: 192.168.10.4:2181 # or comma seperated list of multiple hosts
notification_path: /notification/alarms
notification_retry_path: /notification/retry
periodic_path:
60: /notification/60_seconds
logging: # Used in logging.dictConfig
version: 1
disable_existing_loggers: False
formatters:
default:
format: "%(asctime)s %(levelname)s %(name)s %(message)s"
handlers:
console:
class: logging.StreamHandler
formatter: default
file:
class : logging.handlers.RotatingFileHandler
filename: /tmp/notification.log
formatter: default
maxBytes: 10485760 # Rotate at file size ~10MB
backupCount: 5 # Keep 5 older logs around
loggers:
kazoo:
level: WARN
kafka:
level: WARN
statsd:
level: WARN
root:
handlers:
- console
level: DEBUG
statsd:
host: 'localhost'
port: 8125