-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #319 from napalm-automation/develop
Release 0.9.0
- Loading branch information
Showing
24 changed files
with
361 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Publish Python Package | ||
on: | ||
push: | ||
# Sequence of patterns matched against refs/tags | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
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 |
---|---|---|
|
@@ -3,6 +3,7 @@ python: | |
- 2.7 | ||
- 3.5 | ||
- 3.6 | ||
- 3.7 | ||
install: | ||
- pip install tox-travis | ||
- pip install coveralls | ||
|
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,114 @@ | ||
.. _publisher-alerta: | ||
|
||
================ | ||
Alerta Publisher | ||
================ | ||
|
||
.. versionadded:: 0.9.0 | ||
|
||
Publish napalm-logs events to an `Alerta <https://alerta.io/>`__ endpoint. | ||
|
||
.. note:: | ||
|
||
The :ref:`configuration-options-address` must have contain the ``http://`` | ||
or ``https://`` schema. The address can however be specified more explicitly | ||
under the publisher configuration options, using the | ||
:ref:`publisher-alerta-address` field. | ||
|
||
Also, note that you need to provide the URL to the Alerta API, typically | ||
ending in ``/api``, but that may differ depending on your installation. | ||
|
||
.. image:: alerta_screenshot.png | ||
:width: 100% | ||
:alt: Alerta Screenshot | ||
|
||
Configuration examples: | ||
|
||
- From the command line | ||
|
||
.. code-block:: bash | ||
$ napalm-logs --publisher alerta --address https://alerta.example.com/api | ||
- Basic YAML configuration | ||
|
||
.. code-block:: yaml | ||
publisher: alerta | ||
- YAML configuration with more options | ||
|
||
.. code-block:: yaml | ||
publisher: | ||
- alerta: | ||
address: https://alerta.example.com/api | ||
environment: Production | ||
key: HUGcQvd1_C-TKDrHVoZiNqaKS4jCcFYsGKuT0_W8 | ||
max_clients: 20 | ||
Available options | ||
^^^^^^^^^^^^^^^^^ | ||
|
||
The options are generally inherited from the :ref:`publisher-http` Publisher, | ||
with the following notes: | ||
|
||
.. _publisher-alerta-address: | ||
|
||
``address`` | ||
----------- | ||
|
||
Specifies the Alerta API address. The value must contain the ``http://`` or | ||
``https://`` schema. | ||
|
||
Example: | ||
|
||
.. code-block:: yaml | ||
publisher: | ||
- alerta: | ||
address: 'https://alerta.example.com/api' | ||
.. _publisher-alerta-headers: | ||
|
||
``headers`` | ||
----------- | ||
|
||
The headers to use with the HTTP requests. | ||
|
||
|
||
Some headers such as ``Content-type`` are added by default, while others | ||
such as ``Authorization`` are added depending on the | ||
:ref:`publisher-alerta-key` or :ref:`publisher-alerta-token` options. | ||
|
||
.. _publisher-alerta-key: | ||
|
||
``key`` | ||
------- | ||
|
||
Optional value when executing the HTTP requests using an Alerta API key. | ||
|
||
Example: | ||
|
||
.. code-block:: yaml | ||
publisher: | ||
- alerta: | ||
address: 'https://alerta.example.com/api' | ||
key: HUGcQvd1_C-TKDrHVoZiNqaKS4jCcFYsGKuT0_W8 | ||
.. _publisher-alerta-token: | ||
|
||
``token`` | ||
--------- | ||
|
||
Optional value when executing the HTTP requests using a bearer authentication. | ||
|
||
Example: | ||
|
||
.. code-block:: yaml | ||
publisher: | ||
- alerta: | ||
address: 'https://alerta.example.com/api' | ||
token: AbCdEf123456 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -68,6 +68,7 @@ Available publishers and their options | |
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
alerta | ||
cli | ||
http | ||
kafka | ||
|
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,47 @@ | ||
.. _release-0.9.0: | ||
|
||
================================= | ||
Release 0.9.0 - Codename Hand Saw | ||
================================= | ||
|
||
New Publisher Interface: Alerta | ||
------------------------------- | ||
|
||
Publish napalm-logs events to an `Alerta <https://alerta.io/>`__ endpoint. | ||
The messages are published as alerts in the form ``<host>::<message ID>``, | ||
e.g., ``router1::NTP_SERVER_UNREACHABLE``. See the following screenshot for | ||
a visual example: | ||
|
||
.. image:: alerta_screenshot.png | ||
:width: 100% | ||
:alt: Alerta Screenshot | ||
|
||
The alert is sent together with the complete napalm-logs event data, under the | ||
``attributes`` Alerta field, which you can potentially use for leveraging | ||
various automatic actions or processing from these alerts. Using Alerta is | ||
a great option to handle duplicate alerts. | ||
|
||
See :ref:`publisher-alerta` for more details. | ||
|
||
Update the key name for Fortinet | ||
-------------------------------- | ||
|
||
The field ``source_ip``, and ``destination_ip`` have been renamed to | ||
``source_address`` and ``destination_address`` respectively. See `PR #313 | ||
<https://github.com/napalm-automation/napalm-logs/pull/313>`_ for more | ||
information. | ||
|
||
Fix Prometheus label displaying | ||
------------------------------- | ||
|
||
Avoid to display the 'b' prefix on the label with Python3. Thanks @Koaxiel | ||
(Robin Douine) for `PR #317 | ||
<https://github.com/napalm-automation/napalm-logs/pull/317>`_. | ||
|
||
|
||
New Structured Messages | ||
----------------------- | ||
|
||
:ref:`NH_REGION_GRAB_FAILED` for Junos, a message from the FPC logs when failed | ||
to grab new region for next-hops. Thanks @luke-orden `PR #314 | ||
<https://github.com/napalm-automation/napalm-logs/pull/314>`_. |
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
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,15 @@ | ||
messages: | ||
# 'error' should be unique and vendor agnostic. Currently we are using the JUNOS syslog message name as the canonical name. | ||
# This may change if we are able to find a more well defined naming system. | ||
- error: NH_REGION_GRAB_FAILED | ||
tag: JPRDS_NH | ||
values: | ||
id: (\d+) | ||
nh: (\d+) | ||
line: 'jprds_nh_alloc(),{id}: JNH[0] failed to grab new region for NH#{nh}' | ||
model: NO_MODEL | ||
mapping: | ||
variables: | ||
nh//region//failed//id: id | ||
nh//region//failed//nh: nh | ||
static: {} |
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
Oops, something went wrong.