Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add plugin for sosreport #30

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ libopx_nas_l2_la_CXXFLAGS=-std=c++11
libopx_nas_l2_la_CFLAGS=$(C_HARDEN_FLAGS)
libopx_nas_l2_la_LDFLAGS=-shared -version-info 1:1:0 $(LD_HARDEN_FLAGS)
libopx_nas_l2_la_LIBADD=-lopx_nas_linux -lopx_common -lopx_nas_common -lopx_nas_ndi -lopx_cps_api_common -lopx_logging

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 @@ -17,7 +17,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([opx-nas-l2], [1.22.1+opx2], [[email protected]])
AC_INIT([opx-nas-l2], [1.22.1+opx3], [[email protected]])
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-l2 (1.22.1+opx3) unstable; urgency=medium

* feat: Add plugin for sosreport

-- Dell EMC <[email protected]> Wed, 9 Jan 2019 14:13:00 -0800

opx-nas-l2 (1.22.1+opx2) unstable; urgency=medium

* Update: README copyright placement
Expand Down
1 change: 1 addition & 0 deletions debian/libopx-nas-l2-1.install
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
usr/lib/*/lib*.so*
usr/share/sosreport/sos/plugins
30 changes: 30 additions & 0 deletions sos/opx_nas_l2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/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_l2(Plugin, DebianPlugin):
""" Collects nas-l2 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-stg/entry")
self.add_cmd_output("/usr/bin/cps_get_oid.py base-mirror/entry")
self.add_cmd_output("/usr/bin/cps_get_oid.py base-sflow/entry")