Read messages in a MQTT topic and create PagerDuty alerts
Project description
mqtt-to-pagerduty
Read from a MQTT topic and generate a alert in PagerDuty.
Installation
Direct install
pip install mqtt_to_pagerduty
Docker
docker pull unixorn/mqtt-to-pagerduty
Configuration
mqtt-to-pagerduty
looks for a yaml configuration file in ~/.hass-tools/mqtt-to-pagerduty.yaml
, or /config/mqtt-to-pagerduty.yaml
when run in a container.
Configuration example
pagerduty-api-token: XYZZY
mqtt-server: mqtt.example.com
topic: hass/alerts
default-sender: your_pd_user@example.com
service_id: XYZZY
Tools
mqtt-alerter
Creates an alert message and writes it to a MQTT topic for processing by mqtt-topic-to-pd
.
usage: mqtt-alerter [-h] [-d] [-l {DEBUG,INFO,ERROR,WARNING,CRITICAL}] [--settings-file SETTINGS_FILE] [--sender SENDER]
[--mqtt-server MQTT_SERVER] --title TITLE --service-id SERVICE_ID [--message MESSAGE] [--topic TOPIC]
Emit messages into a MQTT topic
optional arguments:
-h, --help show this help message and exit
-d, --debug Debug setting
-l {DEBUG,INFO,ERROR,WARNING,CRITICAL}, --log-level {DEBUG,INFO,ERROR,WARNING,CRITICAL}
set log level
--settings-file SETTINGS_FILE, --settings SETTINGS_FILE
Path to settings file. Settings in the file are overridden by command line options
--sender SENDER Email address to send alerts from
--mqtt-server MQTT_SERVER
MQTT Server to use
--title TITLE Message title
--service-id SERVICE_ID
PagerDuty service ID to alert
--message MESSAGE Message to send
--topic TOPIC MQTT topic to write to
mqtt-topic-to-pd
Listens to a MQTT topic and when it sees an alert message, creates a corresponding PagerDuty alert.
usage: mqtt-topic-to-pd [-h] [--api-token API_TOKEN] [-l {DEBUG,INFO,ERROR,WARNING,CRITICAL}] [--settings-file SETTINGS_FILE]
[--duration DURATION] [--sender SENDER] [--service-id SERVICE_ID] [--mqtt-server MQTT_SERVER]
[--topic TOPIC]
Read an MQTT queue and create PagerDuty alerts
optional arguments:
-h, --help show this help message and exit
--api-token API_TOKEN
PagerDuty api token
-l {DEBUG,INFO,ERROR,WARNING,CRITICAL}, --log-level {DEBUG,INFO,ERROR,WARNING,CRITICAL}
set log level
--settings-file SETTINGS_FILE, --settings SETTINGS_FILE
Path to settings file. Settings in the file are overridden by command line options
--duration DURATION How long to read the topic, in seconds
--sender SENDER Email address to send alerts from
--service-id SERVICE_ID
Service ID to create an alert
--mqtt-server MQTT_SERVER
MQTT server
--topic TOPIC MQTT topic to read
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for mqtt_to_pagerduty-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14471e2517b1166bcf5173aab365e1330c1e3e9087b0fa8cc25ecdfaa3cf642b |
|
MD5 | aabd89d74e112215cf68221c56676faa |
|
BLAKE2b-256 | 597d3268d03872d8745f3cc229f87c3b8195877c5fbcce4f293dffcba6065ecd |