Configs
Configs emit events when their health changes or when they are created, modified, or removed.
Health events
config.healthy
config.unhealthy
config.warning
config.unknown
ec2-health-notification.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: ec2-instance-health-alerts
namespace: default
spec:
events:
- config.unhealthy
- config.warning
filter: config.type == 'AWS::EC2::Instance'
to:
email: alerts@acme.com
Default Template
The default notification template for health events is:
Title
{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} is {{.config.health}}{{end}}
Template
{{if eq channel "slack"}}
{
"blocks": [
{{slackSectionTextMD (printf `%s *%s* is _%s_` (slackHealthEmoji .config.health) .config.name .config.health)}},
{"type": "divider"},
{{if .config.description}}{{slackSectionTextPlain .config.description}},{{end}}
{
"type": "section",
"fields": [
{{slackSectionTextFieldMD (printf `*Type*: %s` .config.type) }}
{{if .config.status}},{{slackSectionTextFieldMD (printf `*Status*: %s` .config.status) }}{{end}}
{{if ne .agent.name "local"}}
,{{slackSectionTextFieldMD (printf `*Agent*: %s` .agent.name)}}
{{end}}
]
},
{{if .config.labels}}{{slackSectionLabels .config}},{{end}}
{{slackURLAction "View Catalog" .permalink "🔕 Silence" .silenceURL}}
]
}
{{else}}
{{labelsFormat .config.labels}}
[Reference]({{.permalink}})
{{end}}
State events
config.created
config.updated
config.deleted
ec2-instance-updates.yamlapiVersion: mission-control.flanksource.com/v1
kind: Notification
metadata:
name: ec2-instance-changes
namespace: default
spec:
events:
- config.created
- config.updated
- config.deleted
filter: config.type == 'AWS::EC2::Instance'
to:
email: alerts@acme.com
Default Template
Title
{{ if ne channel "slack"}}{{.config.type}} {{.config.name}} was {{.new_state}}{{end}}
Template
{{if eq channel "slack"}}
{
"blocks": [
{{slackSectionTextMD (printf `:information_source: *%s* was _%s_` .config.name .new_state)}},
{"type": "divider"},
{{if .config.description}}{{slackSectionTextPlain .config.description}},{{end}}
{
"type": "section",
"fields": [
{{slackSectionTextFieldMD (printf `*Type*: %s` .config.type) }}
{{if .config.status}},{{slackSectionTextFieldMD (printf `*Status*: %s` .config.status) }}{{end}}
{{if ne .agent.name "local"}}
,{{slackSectionTextFieldMD (printf `*Agent*: %s` .agent.name)}}
{{end}}
]
},
{{if .config.labels}}{{slackSectionLabels .config}},{{end}}
{{slackURLAction "View Catalog" .permalink "🔕 Silence" .silenceURL}}
]
}
{{else}}
{{labelsFormat .config.labels}}
[Reference]({{.permalink}})
{{end}}
Template Variables
Field | Description | Scheme |
---|---|---|
agent | Details of the agent that created the config. | |
config | Corresponding config item. | |
new_state | The db state change that caused this event. Only available on state events. |
|
permalink | Link to the Catalog in mission control |
|
Config Item
Field | Description | Scheme |
---|---|---|
config | Configuration |
|
config_class | Class of the config item |
|
created_at | Creation timestamp |
|
delete_reason | Reason for deletion |
|
deleted_at | Deletion timestamp |
|
description | Description |
|
external_id | External IDs |
|
health |
|
|
id | ID of the config item |
|
labels | Labels |
|
name | Name |
|
properties |
|
|
ready | Whether the config item is ready |
|
scraper_id | ID of the scraper |
|
source | Source |
|
status | Status |
|
tags | Tags |
|
type | Type |
|
updated_at | Update timestamp |
|
Agent
Field | Description | Scheme |
---|---|---|
description | Short description of the agent |
|
id | The id of the agent |
|
name | The name of the agent |
|