Script for subscribing to Arista Telemetry Events and sending email alerts.
Project description
Python script that allows you to subscribe to Arista Telemetry events and then send them to an SMTP server for email notifications.
Emails are sent for events that occur while the alerter is running—you won’t get alerts for past events.
We recommend you set up email filters to limit notifications. For example, you can set up filters to ignore “INFO” events based on the email subject.
Installation
Python 2.7 and pip are required.
You can download the alerter via pip by running pip install telemetry-email-alerter.
Usage
You can start up the alerter by running:
telemetry-email-alerter <telemetry-server> <smtp-server> <email-1> <email-2> ... <email-n>
The full list of arguments accepted by the script are listed below.
Name |
Required? |
Default |
Description |
---|---|---|---|
telemetryUrl |
yes |
— |
The IP address or hostname of your CVP Telemetry instance |
smtpServer |
yes |
— |
The IP address or hostname of your SMTP (email) server |
sendToAddress |
yes |
— |
The emails to send notifications to. You can specify multiple emails |
–sendCcAddress a@example.com b@example.com |
no |
— |
Emails to CC notifications for. You can specify multiple emails |
–port 1234 |
no |
465 |
The port your SMTP server listens to if it use a non-standard port |
–subjectPrefix ‘CVP Alert’ |
no |
[CloudVision Telemetry] |
A message to prepend to email subjects |
–noSmtpSsl |
no |
off (SSL is used) |
Disable SSL for SMTP connections |
–smtpUsername a@example.com |
no |
— |
SMTP server username if authentication is required |
–smtpPassword secret |
no |
— |
SMTP server password if authentication is required. You will be prompted at startup if this is not provided |
–noTelemetrySsl |
no |
off (SSL is used) |
Disable SSL for Telemetry connections |
–telemetryUsername example |
no |
— |
Telemetry username if authentication is required |
–telemetryPassword secret |
no |
— |
Telemetry password if authentication is required. You will be prompted at startup if this is not provided |
–noSslValidation |
no |
off (validation is used) |
Disables validation of SSL certificates. For debugging purposes. Not advised to use in real environments |
–verbose |
no |
off |
Show logging messages |
Using an SMTP server
We recommend you use an SMTP server you run and maintain yourself. Your company might have one you can use.
Alternatively you can use the Gmail SMTP server. You can use your Gmail username and an app password. Be aware of its send limits though—it’s certainly possible you might exceed them.
Development info
You will need Python 2.7 with pip and virtualenv. You can read more about these in the Python packaging documentation. Create a virtualenv to house the dependencies of this project. Once that’s done, you can install dependencies by running pip install -r requirements.pip from the project root.
You can test email notifications by using the Gmail SMTP server mentioned in Using an SMTP server. Alternatively you can use an app like mailslurper on your machine locally.
To run the script locally, you can run the telemetry_email_alerter package from the project root:
python telemetry_email_alerter [...args]
Project details
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
File details
Details for the file telemetry_email_alerter-1.0.7.tar.gz
.
File metadata
- Download URL: telemetry_email_alerter-1.0.7.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 469743666b480f7bda078b2e9b87069e0338189d5aada36328d5423620b6da60 |
|
MD5 | bd8ee31ed26f8f217e69a3ad62474b21 |
|
BLAKE2b-256 | 1f28e6c96a3b519f8c185c87b786fa9402b66106f270ff62bcceaf6332cad369 |
File details
Details for the file telemetry_email_alerter-1.0.7-py2.7.egg
.
File metadata
- Download URL: telemetry_email_alerter-1.0.7-py2.7.egg
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a17b63ec62f1f0bd7cac920aa7d2bac902209d179635fffaaf269716c97bcdd3 |
|
MD5 | 893f4bc3303e9e284c730dd43868a8af |
|
BLAKE2b-256 | 286b6f0bebd72f7a3c6ab5e8b3189cedb2ab6a98c392ce1851933894a136546e |