diff --git a/Makefile.am b/Makefile.am index 034cbb2..a54e656 100644 --- a/Makefile.am +++ b/Makefile.am @@ -36,3 +36,6 @@ libopx_nas_qos_la_LIBADD=-lopx_logging -lopx_nas_ndi -lopx_cps_api_common -lopx_ 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 54027b4..78a870e 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) -AC_INIT([opx-nas-qos], [2.4.0+opx7], [ops-dev@lists.openswitch.net]) +AC_INIT([opx-nas-qos], [2.4.0+opx9], [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 d190191..ee8835c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +opx-nas-qos (2.4.0+opx9) unstable; urgency=medium + + * feat: Add plugin for sosreport + + -- Dell EMC Wed, 9 Jan 2019 15:45:00 -0800 + +opx-nas-qos (2.4.0+opx8) unstable; urgency=medium + + * feat: Add flag file to prevent QoS initialization + + -- Dell EMC Wed, 9 Jan 2019 15:27:00 -0800 + opx-nas-qos (2.4.0+opx7) unstable; urgency=medium * Update: Remove duplicated header files from ./inc diff --git a/debian/libopx-nas-qos1.install b/debian/libopx-nas-qos1.install index 703ad8b..0316a02 100644 --- a/debian/libopx-nas-qos1.install +++ b/debian/libopx-nas-qos1.install @@ -1 +1,2 @@ usr/lib/*/lib*.so* +usr/share/sosreport/sos/plugins diff --git a/scripts/init/opx-qos-init.service b/scripts/init/opx-qos-init.service index 477ffc6..ffa96a6 100644 --- a/scripts/init/opx-qos-init.service +++ b/scripts/init/opx-qos-init.service @@ -18,6 +18,7 @@ Description=QoS default initialization After=opx-cps.service opx-nas.service opx-create-interface.service Requires=opx-cps.service opx-nas.service opx-create-interface.service +ConditionPathExists=!/etc/opx/base_qos_no_init [Service] Type=oneshot diff --git a/sos/opx_nas_qos.py b/sos/opx_nas_qos.py new file mode 100644 index 0000000..6f643ca --- /dev/null +++ b/sos/opx_nas_qos.py @@ -0,0 +1,35 @@ +#!/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_qos(Plugin, DebianPlugin): + """ Collects nas-qos 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-qos/meter") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-qos/wred-profile") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-qos/scheduler-profile") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-qos/dot1p-to-tc-color-map") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-qos/dscp-to-tc-color-map") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-qos/tc-to-queue-map") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-qos/tc-color-to-dot1p-map") + self.add_cmd_output("/usr/bin/cps_get_oid.py base-qos/tc-color-to-dscp-map")