-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
braiins
committed
May 16, 2023
1 parent
fd4bfab
commit 45ce941
Showing
28 changed files
with
3,902 additions
and
908 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,274 @@ | ||
apiVersion: 1 | ||
groups: | ||
- orgId: 1 | ||
name: invalid-license | ||
folder: Alerts | ||
interval: 1m | ||
rules: | ||
- uid: LTLa_oaVz | ||
title: Invalid Braiins OS+ Licences | ||
condition: Condition | ||
data: | ||
- refId: A | ||
relativeTimeRange: | ||
from: 86400 | ||
to: 0 | ||
datasourceUid: PABF2E7BD7AE7B0F4 | ||
model: | ||
editorMode: code | ||
exemplar: false | ||
expr: count(license_state{job="braiinsos-data"} > 1) > 0 | ||
hide: false | ||
instant: false | ||
intervalMs: 1000 | ||
legendFormat: __auto | ||
maxDataPoints: 43200 | ||
range: true | ||
refId: A | ||
- refId: Number of affected miners | ||
relativeTimeRange: | ||
from: 86400 | ||
to: 0 | ||
datasourceUid: __expr__ | ||
model: | ||
conditions: | ||
- evaluator: | ||
params: [] | ||
type: gt | ||
operator: | ||
type: and | ||
query: | ||
params: | ||
- B | ||
reducer: | ||
params: [] | ||
type: last | ||
type: query | ||
datasource: | ||
type: __expr__ | ||
uid: __expr__ | ||
expression: A | ||
hide: false | ||
intervalMs: 1000 | ||
maxDataPoints: 43200 | ||
reducer: last | ||
refId: Number of affected miners | ||
type: reduce | ||
- refId: Condition | ||
relativeTimeRange: | ||
from: 86400 | ||
to: 0 | ||
datasourceUid: __expr__ | ||
model: | ||
conditions: | ||
- evaluator: | ||
params: | ||
- 0 | ||
type: gt | ||
operator: | ||
type: and | ||
query: | ||
params: | ||
- C | ||
reducer: | ||
params: [] | ||
type: last | ||
type: query | ||
datasource: | ||
type: __expr__ | ||
uid: __expr__ | ||
expression: Number of affected miners | ||
hide: false | ||
intervalMs: 1000 | ||
maxDataPoints: 43200 | ||
refId: Condition | ||
type: threshold | ||
dashboardUid: syQG2Ha4z | ||
panelId: 2 | ||
noDataState: OK | ||
execErrState: Error | ||
for: 5m | ||
annotations: | ||
__dashboardUid__: syQG2Ha4z | ||
__panelId__: "2" | ||
description: Invalid Licenses | ||
summary: Invalid Licenses | ||
labels: | ||
severity: critical | ||
type: license | ||
isPaused: false | ||
- uid: AhDpvAa4z | ||
title: No Braiins OS+ Licences | ||
condition: Condition | ||
data: | ||
- refId: A | ||
relativeTimeRange: | ||
from: 600 | ||
to: 0 | ||
datasourceUid: PABF2E7BD7AE7B0F4 | ||
model: | ||
editorMode: code | ||
expr: count(license_state{job="braiinsos-data"} == 0 and license_time_to_restricted_seconds < 55 * 60) > 0 | ||
hide: false | ||
intervalMs: 1000 | ||
legendFormat: __auto | ||
maxDataPoints: 43200 | ||
range: true | ||
refId: A | ||
- refId: Number of affected miners | ||
relativeTimeRange: | ||
from: 600 | ||
to: 0 | ||
datasourceUid: __expr__ | ||
model: | ||
conditions: | ||
- evaluator: | ||
params: [] | ||
type: gt | ||
operator: | ||
type: and | ||
query: | ||
params: | ||
- B | ||
reducer: | ||
params: [] | ||
type: last | ||
type: query | ||
datasource: | ||
type: __expr__ | ||
uid: __expr__ | ||
expression: A | ||
hide: false | ||
intervalMs: 1000 | ||
maxDataPoints: 43200 | ||
reducer: last | ||
refId: Number of affected miners | ||
type: reduce | ||
- refId: Condition | ||
relativeTimeRange: | ||
from: 600 | ||
to: 0 | ||
datasourceUid: __expr__ | ||
model: | ||
conditions: | ||
- evaluator: | ||
params: | ||
- 0 | ||
type: gt | ||
operator: | ||
type: and | ||
query: | ||
params: | ||
- C | ||
reducer: | ||
params: [] | ||
type: last | ||
type: query | ||
datasource: | ||
type: __expr__ | ||
uid: __expr__ | ||
expression: Number of affected miners | ||
hide: false | ||
intervalMs: 1000 | ||
maxDataPoints: 43200 | ||
refId: Condition | ||
type: threshold | ||
dashboardUid: Kzx8BHa4k | ||
panelId: 2 | ||
noDataState: OK | ||
execErrState: Error | ||
for: 5m | ||
annotations: | ||
__dashboardUid__: Kzx8BHa4k | ||
__panelId__: "2" | ||
description: No Braiins OS+ License | ||
summary: No Braiins OS+ License | ||
labels: | ||
severity: warning | ||
type: license | ||
isPaused: false | ||
- uid: GnxL0AaVz | ||
title: Soon Expired Braiins OS+ Licences | ||
condition: Condition | ||
data: | ||
- refId: A | ||
relativeTimeRange: | ||
from: 600 | ||
to: 0 | ||
datasourceUid: PABF2E7BD7AE7B0F4 | ||
model: | ||
editorMode: code | ||
expr: count(license_state{job="braiinsos-data",label=~"$label"} == 1 and license_time_to_restricted_seconds < 150 * 60) > 0 | ||
hide: false | ||
intervalMs: 1000 | ||
legendFormat: __auto | ||
maxDataPoints: 43200 | ||
range: true | ||
refId: A | ||
- refId: Number of affected miners | ||
relativeTimeRange: | ||
from: 600 | ||
to: 0 | ||
datasourceUid: __expr__ | ||
model: | ||
conditions: | ||
- evaluator: | ||
params: [] | ||
type: gt | ||
operator: | ||
type: and | ||
query: | ||
params: | ||
- B | ||
reducer: | ||
params: [] | ||
type: last | ||
type: query | ||
datasource: | ||
type: __expr__ | ||
uid: __expr__ | ||
expression: A | ||
hide: false | ||
intervalMs: 1000 | ||
maxDataPoints: 43200 | ||
reducer: last | ||
refId: Number of affected miners | ||
type: reduce | ||
- refId: Condition | ||
relativeTimeRange: | ||
from: 600 | ||
to: 0 | ||
datasourceUid: __expr__ | ||
model: | ||
conditions: | ||
- evaluator: | ||
params: | ||
- 0 | ||
type: gt | ||
operator: | ||
type: and | ||
query: | ||
params: | ||
- C | ||
reducer: | ||
params: [] | ||
type: last | ||
type: query | ||
datasource: | ||
type: __expr__ | ||
uid: __expr__ | ||
expression: Number of affected miners | ||
hide: false | ||
intervalMs: 1000 | ||
maxDataPoints: 43200 | ||
refId: Condition | ||
type: threshold | ||
noDataState: OK | ||
execErrState: Alerting | ||
for: 5m | ||
annotations: | ||
summary: Soon Expired Braiins OS+ Licences | ||
labels: | ||
severity: warning | ||
type: license | ||
isPaused: false |
21 changes: 21 additions & 0 deletions
21
monitoring/grafana/provisioning/alerting/contact-points.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: 1 | ||
# more info here https://grafana.com/docs/grafana/latest/alerting/set-up/provision-alerting-resources/file-provisioning/ | ||
contactPoints: | ||
- orgId: 1 | ||
# in the file ./monitoring/grafana/provisioning/grafana.ini you need to define your [smtp] to be able to get email alerts | ||
name: Email | ||
receivers: | ||
- uid: HNEU8Ta4zz | ||
type: email | ||
settings: | ||
addresses: your_name@your_domain.cz | ||
singleEmail: false | ||
disableResolveMessage: true | ||
# to be able to use Telegram, it is needed to generate BOT token. Here you can read how to do it https://medium.com/geekculture/generate-telegram-token-for-bot-api-d26faf9bf064 | ||
- uid: mOVzlTaVk | ||
type: telegram | ||
settings: | ||
bottoken: "token" #Telegram bottoken in "" | ||
chatid: "chat_id" #Telegram bottoken in "" | ||
disable_notification: false | ||
disableResolveMessage: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: 1 | ||
|
||
# A mute timing is a recurring interval of time when no new notifications for a policy are generated or sent. | ||
# Use them to prevent alerts from firing a specific and reoccurring period, for example, a regular maintenance period. | ||
# Read more at https://grafana.com/docs/grafana/latest/alerting/manage-notifications/mute-timings/ | ||
|
||
# To allow mute timings, uncomment time_intervals section with prepared simple config. User can modify it to meet his needs. | ||
# Read more about time interval at at https://prometheus.io/docs/alerting/latest/configuration/#time_interval-0 | ||
muteTimes: | ||
- orgId: 1 | ||
name: mti_1 | ||
#time_intervals: | ||
# - times: | ||
# - start_time: '09:00' | ||
# end_time: '17:00' | ||
# weekdays: ['monday:friday'] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: 1 | ||
|
||
policies: | ||
- orgId: 1 | ||
receiver: Email | ||
group_by: ['grafana_folder','alertname'] | ||
object_matchers: | ||
- ['type', '=', 'license'] | ||
group_wait: 1m | ||
group_interval: 5m | ||
repeat_interval: 1h |
Oops, something went wrong.