diff options
author | miwi <miwi@FreeBSD.org> | 2018-05-20 02:41:07 +0800 |
---|---|---|
committer | miwi <miwi@FreeBSD.org> | 2018-05-20 02:41:07 +0800 |
commit | efb8b8227d783d30d026b88447485fa8ff43a917 (patch) | |
tree | 80cc4cfaf9ed9c255fed0f6da3a0d24e422bbd48 /net-mgmt | |
parent | 36628ba71bab75c39ad77fde47c332fbe3466735 (diff) | |
download | freebsd-ports-gnome-efb8b8227d783d30d026b88447485fa8ff43a917.tar.gz freebsd-ports-gnome-efb8b8227d783d30d026b88447485fa8ff43a917.tar.zst freebsd-ports-gnome-efb8b8227d783d30d026b88447485fa8ff43a917.zip |
Parses syslog messages from network devices and produce JSON serializable
Python objects, in a vendor agnostic shape. The output objects are structured
following the OpenConfig or IETF YANG model specifications.
WWW: https://github.com/napalm-automation/napalm-logs
PR: 227719
Submitted by: freebsd_ports@k-worx.org
Sponsored by: iXsystems Inc.
Diffstat (limited to 'net-mgmt')
-rw-r--r-- | net-mgmt/Makefile | 1 | ||||
-rw-r--r-- | net-mgmt/py-napalm-logs/Makefile | 31 | ||||
-rw-r--r-- | net-mgmt/py-napalm-logs/distinfo | 3 | ||||
-rw-r--r-- | net-mgmt/py-napalm-logs/files/patch-napalm__logs_config_____init____.py | 12 | ||||
-rw-r--r-- | net-mgmt/py-napalm-logs/files/pkg-message.in | 57 | ||||
-rw-r--r-- | net-mgmt/py-napalm-logs/pkg-descr | 5 |
6 files changed, 109 insertions, 0 deletions
diff --git a/net-mgmt/Makefile b/net-mgmt/Makefile index 0e682dacc01f..b8ff8003f597 100644 --- a/net-mgmt/Makefile +++ b/net-mgmt/Makefile @@ -314,6 +314,7 @@ SUBDIR += py-msrest SUBDIR += py-msrestazure SUBDIR += py-napalm + SUBDIR += py-napalm-logs SUBDIR += py-ncclient SUBDIR += py-pdagent SUBDIR += py-pyIOSXR diff --git a/net-mgmt/py-napalm-logs/Makefile b/net-mgmt/py-napalm-logs/Makefile new file mode 100644 index 000000000000..155ab496904e --- /dev/null +++ b/net-mgmt/py-napalm-logs/Makefile @@ -0,0 +1,31 @@ +# $FreeBSD$ + +PORTNAME= napalm-logs +DISTVERSION= 0.5.0 +CATEGORIES= net-mgmt python +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= freebsd_ports@k-worx.org +COMMENT= Cross-vendor normalisation for network syslog messages + +LICENSE= APACHE20 + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pip>0:devel/py-pip@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pynacl>0:security/py-pynacl@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyzmq>0:net/py-pyzmq@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}u-msgpack-python>0:devel/py-u-msgpack-python@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}yaml>0:devel/py-yaml@${PY_FLAVOR} + +USES= python +USE_PYTHON= distutils concurrent autoplist +NO_ARCH= yes + +SUB_FILES= pkg-message +SUB_LIST= PREFIX=${PREFIX} PYTHON_VER=${PYTHON_VER} + +post-patch: + @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \ + ${WRKSRC}/napalm_logs/config/__init__.py + +.include <bsd.port.mk> diff --git a/net-mgmt/py-napalm-logs/distinfo b/net-mgmt/py-napalm-logs/distinfo new file mode 100644 index 000000000000..1827fdd97466 --- /dev/null +++ b/net-mgmt/py-napalm-logs/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1526723764 +SHA256 (napalm-logs-0.5.0.tar.gz) = a4d9e06795844e7f375f2152163556d83a3685dc2f6efde379daca02a89acd43 +SIZE (napalm-logs-0.5.0.tar.gz) = 42289 diff --git a/net-mgmt/py-napalm-logs/files/patch-napalm__logs_config_____init____.py b/net-mgmt/py-napalm-logs/files/patch-napalm__logs_config_____init____.py new file mode 100644 index 000000000000..1fe1cb4b621b --- /dev/null +++ b/net-mgmt/py-napalm-logs/files/patch-napalm__logs_config_____init____.py @@ -0,0 +1,12 @@ +--- napalm_logs/config/__init__.py.orig 2018-05-19 10:13:50 UTC ++++ napalm_logs/config/__init__.py +@@ -11,7 +11,8 @@ import napalm_logs.ext.six as six + + # config + ROOT_DIR = '/' +-CONFIG_FILE = os.path.join(ROOT_DIR, 'etc', 'napalm', 'logs') ++#CONFIG_FILE = os.path.join(ROOT_DIR, 'etc', 'napalm', 'logs') ++CONFIG_FILE = os.path.join('%%PREFIX%%', 'etc', 'napalm', 'logs') + ADDRESS = '0.0.0.0' + PORT = 514 + LISTENER = 'udp' diff --git a/net-mgmt/py-napalm-logs/files/pkg-message.in b/net-mgmt/py-napalm-logs/files/pkg-message.in new file mode 100644 index 000000000000..0e6079f24691 --- /dev/null +++ b/net-mgmt/py-napalm-logs/files/pkg-message.in @@ -0,0 +1,57 @@ +=============================================================================== + +===================== + Paths / CLI version +===================== + +napalm-logs has been installed into: + +%%PREFIX%%/bin/napalm-logs-%%PYTHON_VER%% + +The default path for the configuration file is: + +%%PREFIX%%/etc/napalm/logs + +The default path for logfiles (will be created automatically on first run) is: + +/var/log/napalm/logs + +================================== + Message encryption / CLI version +================================== + +If the messaging between server/client should be encrypted, one will require a +certificate and a key otherwise the program will throw an exception and exits. + +Generate a certificate with the following command: + +$ openssl req -nodes -x509 -newkey rsa:4096 -keyout napalm-logs.key -out napalm-logs.crt -days 365 + +If no encryption is required, please read further below how to start the server +without a certificate. + +=================================== + Starting the server / CLI version +=================================== + +a) with encrypted messaging: + +# napalm-logs-%%PYTHON_VER%% --certificate napalm-logs.cert --keyfile napalm-logs.key + +b) with unencrypted messaging: + +# napalm-logs-%%PYTHON_VER%% --disable-security + +In both cases the server will listen on + + 0.0.0.0:514 [UDP / incoming syslog messages] + 0.0.0.0:49017 [TCP / incoming client requests] + +In case a) when security is enabled, the server will listen also on: + + 0.0.0.0:49018 [TCP / incoming authentication requests] + +Please read https://napalm-logs.readthedocs.io/en/latest for further +information. + +============================================================================== diff --git a/net-mgmt/py-napalm-logs/pkg-descr b/net-mgmt/py-napalm-logs/pkg-descr new file mode 100644 index 000000000000..60712b759b53 --- /dev/null +++ b/net-mgmt/py-napalm-logs/pkg-descr @@ -0,0 +1,5 @@ +Parses syslog messages from network devices and produce JSON serializable +Python objects, in a vendor agnostic shape. The output objects are structured +following the OpenConfig or IETF YANG model specifications. + +WWW: https://github.com/napalm-automation/napalm-logs |