diff --git a/Makefile.am b/Makefile.am index 1d1179f..4c5da89 100644 --- a/Makefile.am +++ b/Makefile.am @@ -65,3 +65,6 @@ libopx_nas_acl_la_LIBADD=-lopx_common -lopx_nas_ndi -lopx_cps_api_common -lopx_l systemdconfdir=/lib/systemd/system systemdconf_DATA = scripts/init/*.service + +sosdir=/usr/share/sosreport/sos/plugins +sos_DATA=sos/* diff --git a/configure.ac b/configure.ac index e69eaa3..a74f4f0 100644 --- a/configure.ac +++ b/configure.ac @@ -16,7 +16,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([opx-nas-acl], [2.8.0+opx3], [ops-dev@lists.openswitch.net]) +AC_INIT([opx-nas-acl], [2.8.0+opx5], [ops-dev@lists.openswitch.net]) AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_SRCDIR([.]) AC_CONFIG_HEADERS([config.h]) diff --git a/debian/changelog b/debian/changelog index c3587c3..e603c33 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +opx-nas-acl (2.8.0+opx5) unstable; urgency=medium + + * feat: Add plugin for sosreport + + -- Dell EMC Wed, 9 Jan 2019 13:30:00 -0800 + +opx-nas-acl (2.8.0+opx4) unstable; urgency=medium + + * feat: Add flag file to prevent ACL creation at startup + + -- Dell EMC Wed, 9 Jan 2019 12:00:00 -0800 + opx-nas-acl (2.8.0+opx3) unstable; urgency=medium * Update: Implement some CodeFactor improvements to scripts diff --git a/debian/libopx-nas-acl1.install b/debian/libopx-nas-acl1.install index 2106813..43d4774 100644 --- a/debian/libopx-nas-acl1.install +++ b/debian/libopx-nas-acl1.install @@ -1,3 +1,3 @@ /usr/lib/*/*.so* /usr/lib/*/*.so - +usr/share/sosreport/sos/plugins/* diff --git a/scripts/init/opx-acl-init.service b/scripts/init/opx-acl-init.service index fe6e35d..9239c6f 100644 --- a/scripts/init/opx-acl-init.service +++ b/scripts/init/opx-acl-init.service @@ -17,6 +17,7 @@ Description=Default ACL entries for Control Plane Protocol packets After=opx-cps.service opx-nas.service Requires=opx-cps.service opx-nas.service +ConditionPathExists=!/etc/opx/opx_acl_nocreate [Service] EnvironmentFile=/etc/opx/opx-environment diff --git a/sos/opx_nas_acl.py b/sos/opx_nas_acl.py new file mode 100644 index 0000000..e104c36 --- /dev/null +++ b/sos/opx_nas_acl.py @@ -0,0 +1,31 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- + +# Copyright (c) 2019 Dell Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 +# +# THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR +# CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT +# LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS +# FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. +# +# See the Apache Version 2.0 License for specific language governing +# permissions and limitations under the License. +from sos.plugins import Plugin, DebianPlugin +import os + +class DN_nas_acl(Plugin, DebianPlugin): + """ Collects nas-acl debugging information + """ + + plugin_name = os.path.splitext(os.path.basename(__file__))[0] + profiles = ('networking', 'opx') + + def setup(self): + self.add_cmd_output("/usr/bin/cps_get_oid.py base-acl/table") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-acl/entry") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-acl/counter") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-acl/stats")