Skip to content

Commit

Permalink
feat: Add plugin for sosreport
Browse files Browse the repository at this point in the history
Signed-off-by: Howard Persh <Howard_Persh@dell.com>
  • Loading branch information
hpersh-dell committed Jan 9, 2019
1 parent 555e585 commit 8ca6d1c
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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+opx4], [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])
Expand Down
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
opx-nas-acl (2.8.0+opx5) unstable; urgency=medium

* feat: Add plugin for sosreport

-- Dell EMC <ops-dev@lists.openswitch.net> 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
Expand Down
2 changes: 1 addition & 1 deletion debian/libopx-nas-acl1.install
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/usr/lib/*/*.so*
/usr/lib/*/*.so

usr/share/sosreport/sos/plugins/*
31 changes: 31 additions & 0 deletions sos/opx_nas_acl.py
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 8ca6d1c

Please sign in to comment.