From b8bfdbebea568815fa1bf42a8d36e79732f104e0 Mon Sep 17 00:00:00 2001 From: Gonzalo Gallardo Date: Mon, 7 Dec 2020 12:14:48 -0500 Subject: [PATCH] Remove snmp-ext and snmp-audittrail from FM Remove the libraries libcgtsAgentPlugin and libsnmpAuditPlugin of Fault Management old net-snmp implementation within Starlingx, to delete the implementation of non-containerized SNMP. Story: 2008132 Task: 40866 Signed-off-by: Gonzalo Gallardo Depends-On: https://review.opendev.org/765381 Change-Id: I3aab46cbd45ae7be9e3f97b3acae0fe4536d1388 --- centos_iso_image.inc | 6 - centos_pkg_dirs | 3 +- snmp-audittrail/centos/build_srpm.data | 2 - snmp-audittrail/centos/snmp-audittrail.spec | 55 -- .../opensuse/snmp-audittrail.changes | 14 - .../opensuse/snmp-audittrail.rpmlintrc | 1 - snmp-audittrail/opensuse/snmp-audittrail.spec | 61 -- snmp-audittrail/sources/LICENSE | 202 ----- snmp-audittrail/sources/Makefile | 30 - snmp-audittrail/sources/snmpAuditPlugin.c | 422 --------- snmp-ext/centos/build_srpm.data | 2 - snmp-ext/centos/snmp-ext.spec | 60 -- snmp-ext/opensuse/snmp-ext.changes | 9 - snmp-ext/opensuse/snmp-ext.rpmlintrc | 1 - snmp-ext/opensuse/snmp-ext.spec | 67 -- snmp-ext/sources/LICENSE | 202 ----- snmp-ext/sources/Makefile | 40 - snmp-ext/sources/cgtsActiveAlarms.c | 266 ------ snmp-ext/sources/cgtsAgentPlugin.c | 164 ---- snmp-ext/sources/cgtsAgentPlugin.h | 69 -- snmp-ext/sources/cgtsEventLogs.c | 268 ------ snmp-ext/sources/mibs/wrsAlarmMib.mib.txt | 818 ------------------ .../sources/mibs/wrsEnterpriseReg.mib.txt | 132 --- 23 files changed, 1 insertion(+), 2893 deletions(-) delete mode 100644 snmp-audittrail/centos/build_srpm.data delete mode 100644 snmp-audittrail/centos/snmp-audittrail.spec delete mode 100644 snmp-audittrail/opensuse/snmp-audittrail.changes delete mode 100644 snmp-audittrail/opensuse/snmp-audittrail.rpmlintrc delete mode 100644 snmp-audittrail/opensuse/snmp-audittrail.spec delete mode 100644 snmp-audittrail/sources/LICENSE delete mode 100644 snmp-audittrail/sources/Makefile delete mode 100644 snmp-audittrail/sources/snmpAuditPlugin.c delete mode 100644 snmp-ext/centos/build_srpm.data delete mode 100644 snmp-ext/centos/snmp-ext.spec delete mode 100644 snmp-ext/opensuse/snmp-ext.changes delete mode 100644 snmp-ext/opensuse/snmp-ext.rpmlintrc delete mode 100644 snmp-ext/opensuse/snmp-ext.spec delete mode 100644 snmp-ext/sources/LICENSE delete mode 100644 snmp-ext/sources/Makefile delete mode 100644 snmp-ext/sources/cgtsActiveAlarms.c delete mode 100644 snmp-ext/sources/cgtsAgentPlugin.c delete mode 100644 snmp-ext/sources/cgtsAgentPlugin.h delete mode 100644 snmp-ext/sources/cgtsEventLogs.c delete mode 100644 snmp-ext/sources/mibs/wrsAlarmMib.mib.txt delete mode 100644 snmp-ext/sources/mibs/wrsEnterpriseReg.mib.txt diff --git a/centos_iso_image.inc b/centos_iso_image.inc index ada4c7ab..2991719e 100644 --- a/centos_iso_image.inc +++ b/centos_iso_image.inc @@ -14,12 +14,6 @@ fm-mgr # fm-doc fm-doc -# snmp-ext -snmp-ext - -# snmp-audittrail -snmp-audittrail - # fm-rest-api fm-rest-api diff --git a/centos_pkg_dirs b/centos_pkg_dirs index 6335d5e7..2068b991 100644 --- a/centos_pkg_dirs +++ b/centos_pkg_dirs @@ -4,5 +4,4 @@ fm-mgr fm-doc fm-rest-api python-fmclient -snmp-ext -snmp-audittrail + diff --git a/snmp-audittrail/centos/build_srpm.data b/snmp-audittrail/centos/build_srpm.data deleted file mode 100644 index 3107c380..00000000 --- a/snmp-audittrail/centos/build_srpm.data +++ /dev/null @@ -1,2 +0,0 @@ -SRC_DIR="sources" -TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/snmp-audittrail/centos/snmp-audittrail.spec b/snmp-audittrail/centos/snmp-audittrail.spec deleted file mode 100644 index fd4ede03..00000000 --- a/snmp-audittrail/centos/snmp-audittrail.spec +++ /dev/null @@ -1,55 +0,0 @@ -Summary: StarlingX SNMP Audit Trail -Name: snmp-audittrail -Version: 1.0 -Release: %{tis_patch_ver}%{?_tis_dist} -License: Apache-2.0 -Group: base -Packager: Wind River -URL: unknown -Source0: %{name}-%{version}.tar.gz -BuildRequires: net-snmp-devel -BuildRequires: fm-common-dev -BuildRequires: uuid-devel -BuildRequires: uuid -BuildRequires: libuuid-devel -Requires: net-snmp -Requires: uuid - -%description -StarlingX SNMP Audit Trail provides audit trail support for incoming -SNMP requests. - -%package -n snmp-audittrail-devel -Summary: StarlingX SNMP Audit Trail Package - Development files -Group: devel -Requires: snmp-audittrail = %{version}-%{release} - -%description -n snmp-audittrail-devel -StarlingX SNMP Audit Trail provides audit trail support for incoming SNMP requests. -This package contains symbolic links, header files, and related items necessary -for software development. - -%prep -%setup - -%build -VER=%{version} -MAJOR=`echo $VER | awk -F . '{print $1}'` -MINOR=`echo $VER | awk -F . '{print $2}'` -make MAJOR=$MAJOR MINOR=$MINOR PATCH=%{tis_patch_ver} %{?_smp_mflags} - -%install -rm -rf $RPM_BUILD_ROOT -VER=%{version} -MAJOR=`echo $VER | awk -F . '{print $1}'` -MINOR=`echo $VER | awk -F . '{print $2}'` -make install DESTDIR=$RPM_BUILD_ROOT LIB_DIR=%{_libdir} MAJOR=$MAJOR MINOR=$MINOR PATCH=%{tis_patch_ver} - -%files -%defattr(-,root,root,-) -%doc LICENSE -%{_libdir}/*.so.* - -%files -n snmp-audittrail-devel -%defattr(-,root,root,-) -%{_libdir}/*.so diff --git a/snmp-audittrail/opensuse/snmp-audittrail.changes b/snmp-audittrail/opensuse/snmp-audittrail.changes deleted file mode 100644 index 3ebfe4f3..00000000 --- a/snmp-audittrail/opensuse/snmp-audittrail.changes +++ /dev/null @@ -1,14 +0,0 @@ -------------------------------------------------------------------- -Thu Jun 13 20:56:01 UTC 2019 - sgw@linux.intel.com - -- convert from tarball to _service file - -------------------------------------------------------------------- -Mon Jun 10 23:21:36 UTC 2019 - sgw@linux.intel.com - -- spec-cleaner and rpmlint checked - -------------------------------------------------------------------- -Thu May 23 20:39:25 UTC 2019 - sgw@bigsur.com - -- Initial Commit diff --git a/snmp-audittrail/opensuse/snmp-audittrail.rpmlintrc b/snmp-audittrail/opensuse/snmp-audittrail.rpmlintrc deleted file mode 100644 index adc59bf3..00000000 --- a/snmp-audittrail/opensuse/snmp-audittrail.rpmlintrc +++ /dev/null @@ -1 +0,0 @@ -setBadness('script-without-shebang', 2) diff --git a/snmp-audittrail/opensuse/snmp-audittrail.spec b/snmp-audittrail/opensuse/snmp-audittrail.spec deleted file mode 100644 index 5df34cdb..00000000 --- a/snmp-audittrail/opensuse/snmp-audittrail.spec +++ /dev/null @@ -1,61 +0,0 @@ -Name: snmp-audittrail -Version: 1.0.0 -Release: %{tis_patch_ver}%{?_tis_dist} -Summary: StarlingX SNMP Audit Trail -License: Apache-2.0 -Group: Development/Tools/Other -URL: https://opendev.org/starlingx/fault -Source0: %{name}-%{version}.tar.gz -BuildRequires: fm-common-devel -BuildRequires: libuuid-devel -BuildRequires: net-snmp-devel -BuildRequires: uuid-devel -Requires: net-snmp -Requires: uuid -%if 0%{?suse_version} -BuildRequires: gcc-c++ -%endif - -%description -StarlingX SNMP Audit Trail provides audit trail support for incoming -SNMP requests. - -%package -n snmp-audittrail-devel -Summary: StarlingX SNMP Audit Trail Package - Development files -Group: Development/Tools/Other -Requires: snmp-audittrail = %{version}-%{release} - -%description -n snmp-audittrail-devel -StarlingX SNMP Audit Trail provides audit trail support for incoming SNMP requests. -This package contains symbolic links, header files, and related items necessary -for software development. - -%prep -%autosetup -n %{name}-%{version}/sources - -%build -VER=%{version} -MAJOR=`echo $VER | awk -F . '{print $1}'` -MINOR=`echo $VER | awk -F . '{print $2}'` -make MAJOR=$MAJOR MINOR=$MINOR PATCH=%{tis_patch_ver} %{?_smp_mflags} - -%install -VER=%{version} -MAJOR=`echo $VER | awk -F . '{print $1}'` -MINOR=`echo $VER | awk -F . '{print $2}'` -make install DESTDIR=%{buildroot} LIB_DIR=%{_libdir} MAJOR=$MAJOR MINOR=$MINOR PATCH=%{tis_patch_ver} - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(-,root,root,-) -%license LICENSE -%{_libdir}/*.so.* - -%files -n snmp-audittrail-devel -%defattr(-,root,root,-) -%{_libdir}/*.so - -%changelog diff --git a/snmp-audittrail/sources/LICENSE b/snmp-audittrail/sources/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/snmp-audittrail/sources/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/snmp-audittrail/sources/Makefile b/snmp-audittrail/sources/Makefile deleted file mode 100644 index 6f7469c6..00000000 --- a/snmp-audittrail/sources/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -SRCS = snmpAuditPlugin.c - -OBJS = $(SRCS:.c=.o) -LDLIBS = -lfmcommon -lnetsnmp -lnetsnmpagent -luuid -INCLUDES += -I./ -CCFLAGS = -fPIC -g -O2 -Wall -Werror -Wformat -Wformat-security -LIBCGTSAGENT_SO := libsnmpAuditPlugin.so -MAJOR ?= 1 -MINOR ?= 0 -PATCH ?= 0 -DESTDIR ?= /usr/lib64 - -build: lib - -.c.o: - $(CXX) $(CCFLAGS) $(INCLUDES) -c $< -o $@ - -lib: $(OBJS) - $(CXX) $(OBJS) $(LDLIBS) -o $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) -shared - ln -sf $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(LIBCGTSAGENT_SO).$(MAJOR) - ln -sf $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(LIBCGTSAGENT_SO) - -clean: - @rm -f $(OBJ) *.o *.so.* - -install: - install -m 755 -d $(DESTDIR)$(LIB_DIR) - install -m 755 $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(DESTDIR)$(LIB_DIR) - ln -s $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(DESTDIR)$(LIB_DIR)/$(LIBCGTSAGENT_SO).$(MAJOR) - ln -s $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(DESTDIR)$(LIB_DIR)/$(LIBCGTSAGENT_SO) diff --git a/snmp-audittrail/sources/snmpAuditPlugin.c b/snmp-audittrail/sources/snmpAuditPlugin.c deleted file mode 100644 index 46d5fd9d..00000000 --- a/snmp-audittrail/sources/snmpAuditPlugin.c +++ /dev/null @@ -1,422 +0,0 @@ -/* - * Copyright (c) 2017 Wind River Systems, Inc. -* -* SPDX-License-Identifier: Apache-2.0 -* - */ - - - -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define LOG_BUF_STR (256) - -#define AUDIT_TAG "snmp-auditor" - -/* Used to keep track of the first handler call for a transaction */ -typedef struct s_audit_req_t { - long transid; - long reqid; -} audit_req_t; - -typedef struct s_enum_to_string_t { - const int enumval; - const char *str; -} enum_to_string_t; - - -/* Logs IP session information, in the format: "remote IP:port ==> local IP:port" */ -static inline char* fmtaddr(const char *prefix, int af, - void *remote_addr, unsigned short remote_port, - char*buf, size_t buflen) -{ - char remote_addr_str[LOG_BUF_STR+1]; - - if (NULL == inet_ntop(af, remote_addr, remote_addr_str, sizeof(remote_addr_str))) { - strncpy(remote_addr_str, "UNKNOWN", LOG_BUF_STR+1); - } - remote_addr_str[LOG_BUF_STR] = 0; - - snprintf(buf, buflen, "transport:%s remote:%s", prefix, remote_addr_str); - return buf; -} - - -#ifdef NETSNMP_ENABLE_IPV6 -static char* ipv6_fmtaddr(const char *prefix, netsnmp_addr_pair *addr_pair, char*buf, size_t buflen) -{ - return fmtaddr(prefix, AF_INET6, - (void *)&addr_pair->remote_addr.sin6.sin6_addr, addr_pair->remote_addr.sin6.sin6_port, - buf, buflen); -} -#endif - - -static char* ipv4_fmtaddr(const char *prefix, netsnmp_addr_pair *addr_pair, char*buf, size_t buflen) -{ - return fmtaddr(prefix, AF_INET, - (void *)&addr_pair->remote_addr.sin.sin_addr, addr_pair->remote_addr.sin.sin_port, - buf, buflen); -} - - -/* Logs IP session information */ -static char* log_session_addresses(const oid* tDomain, netsnmp_addr_pair *addr_pair, char*buf, size_t buflen) -{ - if (tDomain == netsnmpUDPDomain) { - return ipv4_fmtaddr("udp", addr_pair, buf, buflen); - } - - if (tDomain == netsnmp_snmpTCPDomain) { - return ipv4_fmtaddr("tcp", addr_pair, buf, buflen); - } - -#ifdef NETSNMP_ENABLE_IPV6 - if (tDomain == netsnmp_UDPIPv6Domain) { - return ipv6_fmtaddr("udpv6", addr_pair, buf, buflen); - } - - if (tDomain == netsnmp_TCPIPv6Domain) { - return ipv6_fmtaddr("tcpv6", addr_pair, buf, buflen); - } -#endif - strncpy(buf, "IP FMT ERROR", buflen); - buf[buflen-1] = 0; - return buf; -} - - -/* SNMP OID formatting (a wrapper around the 'standard' function */ -static inline char* fmtoid(const oid * theoid, size_t len, int* no_overflow) -{ - u_char *buf = NULL; - size_t buf_len = 0; - size_t out_len = 0; - - *no_overflow = sprint_realloc_objid(&buf, &buf_len, &out_len, 1, theoid, len); - if (NULL == buf) { - *no_overflow = 0; - } - - return (char*)buf; -} - - -/* SNMP var bind formatting (a convenience function) - formats the OID (variable name) - This function is always called with var != NULL */ -static inline char* fmtmsg_var(netsnmp_variable_list * var, int* no_overflow) -{ - return fmtoid(var->name, var->name_length, no_overflow); -} - -static const char* get_version(long version) -{ - switch (version) { - case 0: return "v1"; - case 1: return "v2c"; - case 2: return "v3"; - } - return "error"; -} - - -static const char *get_str_from_enum(int enumval, const enum_to_string_t* table, const char* defval) -{ - const enum_to_string_t* ptr = table; - - for ( ; ptr->str != NULL; ++ptr) { - if (ptr->enumval == enumval) { - return ptr->str; - } - } - if (NULL == defval) { - return "unknown"; - } - return defval; -} - - -static const char *get_auth_error(int errorcode) -{ - static enum_to_string_t errorcodes_str[] = { - { VACM_SUCCESS, "Success", }, - { VACM_NOSECNAME, "InvalidCommunityName" }, - { VACM_NOGROUP, "NoGroup" }, - { VACM_NOACCESS, "NoAccess" }, - { VACM_NOVIEW, "NoViewAccess" }, - { VACM_NOTINVIEW, "NotInView" }, - { VACM_NOSUCHCONTEXT, "NoSuchContext" }, - { VACM_SUBTREE_UNKNOWN,"SubtreeUnknown" }, - {0, NULL} - }; - return get_str_from_enum(errorcode, errorcodes_str, "unknown err"); -} - -static const char *get_result_error(int errorcode) -{ - static enum_to_string_t errorcodes_str[] = { - { 0, "pass" }, - { SNMP_NOSUCHOBJECT, "NoSuchObject" }, - { SNMP_NOSUCHINSTANCE, "NoSuchInstance" }, - { SNMP_ENDOFMIBVIEW, "EndOfMIBView" }, - {0, NULL} - }; - return get_str_from_enum(errorcode, errorcodes_str, "pass"); -} - - -/* Logs all var-binds in PDU (only variable names, aka OID's) */ -static void log_var_list(netsnmp_pdu *pdu) -{ - netsnmp_variable_list * var; - - for (var = pdu->variables; var != NULL; var = var->next_variable) { - int no_overflow_var = 0; - char* var_str = fmtmsg_var(var, &no_overflow_var); - - snmp_log(LOG_INFO, AUDIT_TAG" reqid:%ld oid:%s%s\n", - pdu->reqid, - (var_str != NULL) ? var_str : "INVALID", - (no_overflow_var) ? "" : " [TRUNCATED]"); - free(var_str); - } -} - -/* Logs the 'header' of a PDU/request (IP addresses, reqid, msg type, version) */ -static void log_pdu_header(netsnmp_pdu *pdu, const char *status) -{ - char buf[LOG_BUF_STR]; - netsnmp_addr_pair *addr_pair = (netsnmp_addr_pair *)pdu->transport_data; - - snmp_log(LOG_INFO, AUDIT_TAG" %s reqid:%ld msg-type:%s version:%s%s\n", - log_session_addresses(pdu->tDomain, addr_pair, buf, sizeof(buf)), - pdu->reqid, snmp_pdu_type(pdu->command), get_version(pdu->version), status); -} - -/* Logs the results of a request, namely results obtained from actual processing handlers */ -static void log_results(long reqid, netsnmp_request_info *requests) -{ - netsnmp_request_info *req; - - for (req = requests; req != NULL; req = req->next) { - netsnmp_variable_list *var = req->requestvb; - - if (NULL == var) { - continue; - } - if (var->type != ASN_NULL) { /* NULL means no result, so skip */ - int no_overflow_var = 0; - char* var_str = fmtmsg_var(var, &no_overflow_var); - - /* Print only first variable: this is the request that we get a result for */ - snmp_log(LOG_INFO, AUDIT_TAG" reqid:%ld oid:%s%s status:%s\n", reqid, - (var_str != NULL) ? var_str : "INVALID", - (no_overflow_var) ? "" : " [TRUNCATED]", get_result_error(var->type)); - free(var_str); - } - } -} - - -static void log_invalid_oid_trees(netsnmp_pdu *pdu) -{ - char buf[LOG_BUF_STR]; - netsnmp_variable_list *var; - netsnmp_addr_pair *addr_pair = (netsnmp_addr_pair *)pdu->transport_data; - int first_time = 1; - - for (var = pdu->variables; var != NULL; var = var->next_variable) { - netsnmp_subtree *tp = netsnmp_subtree_find(var->name, var->name_length, - NULL, pdu->contextName); - if (tp != NULL) { - int prefix_len = netsnmp_oid_find_prefix(tp->start_a, - tp->start_len, - tp->end_a, tp->end_len); - while (prefix_len < 1) { - tp = tp->next; - if (NULL == tp) { - break; - } - prefix_len = netsnmp_oid_find_prefix(tp->start_a, - tp->start_len, - tp->end_a, tp->end_len); - } - DEBUGMSGTL(("helper:snmpAudit", "var=%p tp=%p prefix_len=%d\n", var, tp, prefix_len )); - } - else { - DEBUGMSGTL(("helper:snmpAudit", "tp NOT found var=%p\n", var)); - } - if (NULL == tp) { - int no_overflow_var = 0; - char* var_str = fmtmsg_var(var, &no_overflow_var); - - if (first_time) { - first_time = 0; - snmp_log(LOG_INFO, AUDIT_TAG" %s reqid:%ld msg-type:%s version:%s\n", - log_session_addresses(pdu->tDomain, addr_pair, buf, sizeof(buf)), pdu->reqid, - snmp_pdu_type(pdu->command), - get_version(pdu->version)); - log_var_list(pdu); - } - - snmp_log(LOG_INFO, AUDIT_TAG" reqid:%ld oid:%s%s status:%s\n", - pdu->reqid, - (var_str != NULL) ? var_str : "INVALID", - (no_overflow_var) ? "" : " [TRUNCATED]", - get_result_error(SNMP_ENDOFMIBVIEW)); - free(var_str); - } - } -} - -/* - * Register with 'SNMPD_CALLBACK_ACM_CHECK_INITIAL == minorId' - * This function is used to log authorization errors and invalid OID's errors, - * for GET BULK and GET NEXT requests - */ -static int audit_callback_acm_check_initial(int majorID, int minorID, void *serverarg, - void *clientarg) -{ - struct view_parameters *view_parms = - (struct view_parameters *) serverarg; - netsnmp_pdu *pdu = view_parms->pdu; - - DEBUGMSGTL(("helper:snmpAudit", "%s msg-type: %s errcode=%d minorID=%d\n", - __FUNCTION__, snmp_pdu_type(pdu->command), view_parms->errorcode, minorID)); - - if (view_parms->errorcode != VACM_SUCCESS) { - /* Log Authentication errors */ - char buf[LOG_BUF_STR]; - netsnmp_addr_pair *addr_pair = (netsnmp_addr_pair *)pdu->transport_data; - - snmp_log(LOG_INFO, AUDIT_TAG" %s reqid:%ld msg-type:%s version:%s status:%s\n", - log_session_addresses(pdu->tDomain, addr_pair, buf, sizeof(buf)), pdu->reqid, - snmp_pdu_type(pdu->command), get_version(pdu->version), - get_auth_error(view_parms->errorcode)); - log_var_list(pdu); - return 0; - } - - if (SNMP_MSG_GETBULK == pdu->command || - SNMP_MSG_GETNEXT == pdu->command) { - /* Log possible invalid OID subtrees for GETNEXT and GETBULK request - * (e.g. "1.10" - outside the normal ISO MIB subtree) - */ - log_invalid_oid_trees(pdu); - } - return 0; -} - -/* - * Register with 'SNMPD_CALLBACK_ACM_CHECK == minorId' - * This function is used to log SET requests (which are normally rejected) - */ -static int audit_callback_acm_check(int majorID, int minorID, void *serverarg, - void *clientarg) -{ - struct view_parameters *view_parms = - (struct view_parameters *) serverarg; - netsnmp_pdu *pdu = view_parms->pdu; - - DEBUGMSGTL(("helper:snmpAudit", "%s msg-type: %s errcode=%d minorID=%d\n", - __FUNCTION__, snmp_pdu_type(pdu->command), view_parms->errorcode, minorID)); - if (SNMP_MSG_SET == pdu->command) { - char status_buf[LOG_BUF_STR]; - snprintf(status_buf, LOG_BUF_STR, - " status:%s", get_auth_error(view_parms->errorcode)); - log_pdu_header(pdu, status_buf); - log_var_list(pdu); - } - return 0; -} - - -/* Main log handler function: logs 'normal' requests: - * everything except SET operations, authentication errors and GETBULK/GETNEXT for invalid OIDs */ -static int audit_log_handler(netsnmp_mib_handler *handler, - netsnmp_handler_registration *reginfo, - netsnmp_agent_request_info *reqinfo, - netsnmp_request_info *requests) -{ - static audit_req_t req = { - .transid = 0, - .reqid = 0 - }; - netsnmp_pdu *orig_pdu = reqinfo->asp->orig_pdu; - int ret; - - /* Note. Assumes single-threaded processing. */ - if ((req.transid != orig_pdu->transid) && - (req.reqid != orig_pdu->reqid)) { - - /* New transaction */ - req.transid = orig_pdu->transid; - req.reqid = orig_pdu->reqid; - - /* Logs session information (e.g. IP addresses, version...) */ - log_pdu_header(orig_pdu, ""); - /* Logs the variables names in the request */ - log_var_list(orig_pdu); - } - /* Calls the next handlers, to obtain processing results */ - ret = netsnmp_call_next_handler(handler, reginfo, reqinfo, requests); - /* Logs the variables names in the results - * resulted from the calls to 'netsnmp_call_next_handler' above - * which invokes all other handlers in the chain. - */ - log_results(orig_pdu->reqid, requests); - return ret; -} - - - -/* - * Initialization routine, automatically called by the agent - * (to get called, the function name must match init_FILENAME()) - */ -extern "C" void init_snmpAuditPlugin(void) { - - netsnmp_mib_handler *audit_handler = NULL; - - snmp_log(LOG_INFO, "init_snmpAuditPlugin\n"); - audit_handler = netsnmp_create_handler("snmpAudit", - audit_log_handler); - if (audit_handler != NULL) { - netsnmp_register_handler_by_name("snmpAudit", audit_handler); - } - - netsnmp_register_callback(SNMP_CALLBACK_APPLICATION, SNMPD_CALLBACK_ACM_CHECK, - audit_callback_acm_check, - NULL, NETSNMP_CALLBACK_LOWEST_PRIORITY ); - netsnmp_register_callback(SNMP_CALLBACK_APPLICATION, SNMPD_CALLBACK_ACM_CHECK_INITIAL, - audit_callback_acm_check_initial, - NULL, NETSNMP_CALLBACK_LOWEST_PRIORITY); -} - -extern "C" void deinit_snmpAuditPlugin(void) -{ - snmp_log(LOG_INFO, "deinit_snmpAuditPlugin\n"); - snmp_unregister_callback(SNMP_CALLBACK_APPLICATION, SNMPD_CALLBACK_ACM_CHECK, - audit_callback_acm_check, NULL, 1); - snmp_unregister_callback(SNMP_CALLBACK_APPLICATION, SNMPD_CALLBACK_ACM_CHECK_INITIAL, - audit_callback_acm_check_initial, NULL, 1); -} diff --git a/snmp-ext/centos/build_srpm.data b/snmp-ext/centos/build_srpm.data deleted file mode 100644 index 3107c380..00000000 --- a/snmp-ext/centos/build_srpm.data +++ /dev/null @@ -1,2 +0,0 @@ -SRC_DIR="sources" -TIS_PATCH_VER=PKG_GITREVCOUNT diff --git a/snmp-ext/centos/snmp-ext.spec b/snmp-ext/centos/snmp-ext.spec deleted file mode 100644 index 5cdc0abe..00000000 --- a/snmp-ext/centos/snmp-ext.spec +++ /dev/null @@ -1,60 +0,0 @@ -Summary: CGTS Platform SNMP extension Package -Name: snmp-ext -Version: 1.0 -Release: %{tis_patch_ver}%{?_tis_dist} -License: Apache-2.0 -Group: base -Packager: Wind River -URL: unknown -Source0: %{name}-%{version}.tar.gz -BuildRequires: fm-common-dev -BuildRequires: net-snmp-devel -BuildRequires: libuuid-devel -Requires: fm-common -Requires: net-snmp - -%define mib_ver 2.0 - -%description -StarlingX platform SNMP extension provides Wind River enterprise MIBs support -and it serves as SNMP based alarm surveillance module for Network Manager -System. - -%package -n snmp-ext-devel -Summary: StarlingX Platform SNMP extension Package - Development files -Group: devel -Requires: snmp-ext = %{version}-%{release} - -%description -n snmp-ext-devel -StarlingX platform SNMP extension provides Wind River enterprise MIBs support -and it serves as SNMP based alarm surveillance module for Network Manager -System. This package contains symbolic links, header files, and related -items necessary for software development. - -%prep -%setup - -%build -MAJOR=`echo %{version} | awk -F . '{print $1}'` -MINOR=`echo %{version} | awk -F . '{print $2}'` -make MAJOR=$MAJOR MINOR=$MINOR PATCH=%{tis_patch_ver} %{?_smp_mflags} - -%install -MAJOR=`echo %{version} | awk -F . '{print $1}'` -MINOR=`echo %{version} | awk -F . '{print $2}'` -make DEST_DIR=%{buildroot} \ - LIB_DIR=%{_libdir} \ - MAJOR=$MAJOR \ - MINOR=$MINOR \ - MIBVER=%{mib_ver} \ - PATCH=%{tis_patch_ver} install - -%files -%defattr(-,root,root,-) -%doc LICENSE -%{_libdir}/*.so.* -%{_datadir}/snmp/mibs/* - -%files -n snmp-ext-devel -%defattr(-,root,root,-) -%{_libdir}/*.so diff --git a/snmp-ext/opensuse/snmp-ext.changes b/snmp-ext/opensuse/snmp-ext.changes deleted file mode 100644 index 2bb92135..00000000 --- a/snmp-ext/opensuse/snmp-ext.changes +++ /dev/null @@ -1,9 +0,0 @@ -------------------------------------------------------------------- -Mon Jun 10 23:47:39 UTC 2019 - sgw@linux.intel.com - -- spec-cleaner and rpmlint checked - -------------------------------------------------------------------- -Thu May 23 21:03:10 UTC 2019 - sgw@bigsur.com - -- Initial Commit diff --git a/snmp-ext/opensuse/snmp-ext.rpmlintrc b/snmp-ext/opensuse/snmp-ext.rpmlintrc deleted file mode 100644 index adc59bf3..00000000 --- a/snmp-ext/opensuse/snmp-ext.rpmlintrc +++ /dev/null @@ -1 +0,0 @@ -setBadness('script-without-shebang', 2) diff --git a/snmp-ext/opensuse/snmp-ext.spec b/snmp-ext/opensuse/snmp-ext.spec deleted file mode 100644 index 8bc1b7e5..00000000 --- a/snmp-ext/opensuse/snmp-ext.spec +++ /dev/null @@ -1,67 +0,0 @@ -%define mib_ver 2.0 -Name: snmp-ext -Version: 1.0.0 -Release: %{tis_patch_ver}%{?_tis_dist} -Summary: StarlingX Platform SNMP extension Package -License: Apache-2.0 -Group: Development/Tools/Other -URL: https://opendev.org/starlingx/fault -Source0: %{name}-%{version}.tar.gz -BuildRequires: fm-common-devel -BuildRequires: libuuid-devel -BuildRequires: net-snmp-devel -Requires: fm-common -Requires: net-snmp -%if 0%{?suse_version} -BuildRequires: gcc-c++ -%endif - -%description -StarlingX Cloud platform SNMP extension provides Wind River enterprise MIBs support -and it serves as SNMP based alarm surveillance module for Network Manager -System. - -%package -n snmp-ext-devel -Summary: StarlingX Cloud Platform SNMP extension Package - Development files -Group: Development/Tools/Other -Requires: snmp-ext = %{version}-%{release} - -%description -n snmp-ext-devel -StarlingX Cloud platform SNMP extension provides Wind River enterprise MIBs support -and it serves as SNMP based alarm surveillance module for Network Manager -System. This package contains symbolic links, header files, and related -items necessary for software development. - -%prep -%autosetup -n %{name}-%{version}/sources - -%build -MAJOR=`echo %{version} | awk -F . '{print $1}'` -MINOR=`echo %{version} | awk -F . '{print $2}'` -make MAJOR=$MAJOR MINOR=$MINOR PATCH=%{tis_patch_ver} %{?_smp_mflags} - -%install -MAJOR=`echo %{version} | awk -F . '{print $1}'` -MINOR=`echo %{version} | awk -F . '{print $2}'` -make DEST_DIR=%{buildroot} \ - LIB_DIR=%{_libdir} \ - MAJOR=$MAJOR \ - MINOR=$MINOR \ - MIBVER=%{mib_ver} \ - PATCH=%{tis_patch_ver} install - -%post -p /sbin/ldconfig - -%postun -p /sbin/ldconfig - -%files -%defattr(-,root,root,-) -%license LICENSE -%{_libdir}/*.so.* -%{_datadir}/snmp/mibs/* - -%files -n snmp-ext-devel -%defattr(-,root,root,-) -%{_libdir}/*.so - -%changelog diff --git a/snmp-ext/sources/LICENSE b/snmp-ext/sources/LICENSE deleted file mode 100644 index d6456956..00000000 --- a/snmp-ext/sources/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/snmp-ext/sources/Makefile b/snmp-ext/sources/Makefile deleted file mode 100644 index 408ea342..00000000 --- a/snmp-ext/sources/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -# -# SPDX-License-Identifier: Apache-2.0 -# - -MAJOR ?= 1 -MINOR ?= 0 -PATCH ?= 0 -MIBVER ?= 2.0 - -DEST_DIR ?= / -DATA_DIR ?= /usr/share -LIB_DIR ?= /usr/lib64 - -SRCS = cgtsActiveAlarms.c cgtsAgentPlugin.c cgtsEventLogs.c - -OBJS = $(SRCS:.c=.o) -LDLIBS = -lfmcommon -lnetsnmp -lnetsnmpagent -luuid -INCLUDES += -I./ -CCFLAGS = -fPIC -g -O2 -Wall -Werror -Wformat -Wformat-security -LIBCGTSAGENT_SO := libcgtsAgentPlugin.so - -.c.o: - $(CXX) $(CCFLAGS) $(INCLUDES) -c $< -o $@ - -lib: $(OBJS) - $(CXX) $(OBJS) $(LDLIBS) -o $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) -shared - ln -sf $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(LIBCGTSAGENT_SO).$(MAJOR) - ln -sf $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(LIBCGTSAGENT_SO) - -clean: - @rm -f $(OBJ) *.o *.so.* *.tgz - -install: - install -m 755 -d $(DEST_DIR)$(LIB_DIR) - install -m 755 $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(DEST_DIR)$(LIB_DIR) - install -m 755 -d $(DEST_DIR)$(DATA_DIR)/snmp/mibs - install -m 644 mibs/wrsAlarmMib.mib.txt $(DEST_DIR)$(DATA_DIR)/snmp/mibs/ - install -m 644 mibs/wrsEnterpriseReg.mib.txt $(DEST_DIR)$(DATA_DIR)/snmp/mibs/ - ln -s $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(DEST_DIR)$(LIB_DIR)/$(LIBCGTSAGENT_SO).$(MAJOR) - ln -s $(LIBCGTSAGENT_SO).$(MAJOR).$(MINOR).$(PATCH) $(DEST_DIR)$(LIB_DIR)/$(LIBCGTSAGENT_SO) diff --git a/snmp-ext/sources/cgtsActiveAlarms.c b/snmp-ext/sources/cgtsActiveAlarms.c deleted file mode 100644 index e1abc688..00000000 --- a/snmp-ext/sources/cgtsActiveAlarms.c +++ /dev/null @@ -1,266 +0,0 @@ -/* -* Copyright (c) 2013-2014 Wind River Systems, Inc. -* -* SPDX-License-Identifier: Apache-2.0 -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cgtsAgentPlugin.h" - - -netsnmp_feature_require(date_n_time) - -#define MINLOADFREQ 1 /* min reload frequency in seconds */ - -static long Active_Alarm_Count = 0; -static struct activealarm *alarm_list; -static struct activealarm *alarmaddr, savealarm, *savealarmaddr; -static int saveIndex = 0; -static char saveUuid[36]; -static long LastLoad = 0; /* ET in secs at last table load */ -extern long long_return; - - -int Active_Alarm_Get_Count(void); - -static void -Alarm_Scan_Init() -{ - struct timeval et; /* elapsed time */ - struct activealarm **activealarm_ptr; - SFmAlarmQueryT aquery; - size_t i = 0; - - saveIndex = 0; - netsnmp_get_monotonic_clock(&et); - if ( et.tv_sec < LastLoad + MINLOADFREQ ) { - DEBUGMSG(("cgtsAgentPlugin", "Skip reload" )); - alarmaddr = alarm_list; - return; - } - LastLoad = et.tv_sec; - - /* - * free old list: - */ - while (alarm_list) { - struct activealarm *old = alarm_list; - alarm_list = alarm_list->next; - free(old); - } - alarmaddr = 0; - activealarm_ptr = &alarm_list; - - /* - * query active alarm list from DB - */ - if (fm_snmp_util_get_all_alarms(getAlarmSession(), &aquery) != true){ - DEBUGMSG(("cgtsAgentPlugin", "get_all_alarms from db failed\n")); - return; - } - DEBUGMSG(("cgtsAgentPlugin", "get_all_alarms returns %lu alarms\n", aquery.num)); - for (i = 0; i < aquery.num; ++i){ - struct activealarm *almnew; - /*populate alarm_list*/ - almnew = (struct activealarm *) calloc(1, sizeof(struct activealarm)); - if (almnew == NULL) - break; /* alloc error */ - *activealarm_ptr = almnew; - activealarm_ptr = &almnew->next; - memset(&almnew->alarmdata, 0 , sizeof(almnew->alarmdata)); - memcpy(&almnew->alarmdata, aquery.alarm + i, sizeof(almnew->alarmdata)); - } - alarmaddr = alarm_list; - free(aquery.alarm); -} - -static int -Alarm_Scan_NextAlarm(int *Index, - char *Name, - struct activealarm *Aalm) -{ - struct activealarm alm; - while (alarmaddr) { - alm = *alarmaddr; - strlcpy(saveUuid, alm.alarmdata.uuid, sizeof(saveUuid)); - if (Index) - *Index = ++saveIndex; - if (Aalm) - *Aalm = alm; - if (Name) - strcpy(Name, saveUuid); - - savealarm = alm; - savealarmaddr = alarmaddr; - alarmaddr = alm.next; - return 1; - } - return 0; -} - -static int -Alarm_Scan_By_Index(int Index, - char *Name, - struct activealarm *Aalm) -{ - int i; - - DEBUGMSGTL(("cgtsAgentPlugin","Alarm_Scan_By_Index")); - Alarm_Scan_Init(); - while (Alarm_Scan_NextAlarm(&i, Name, Aalm)) { - if (i == Index) - break; - } - if (i != Index) - return (-1); /* Error, doesn't exist */ - return (0); /* DONE */ -} - -static int -header_alarmEntry(struct variable *vp, - oid * name, - size_t * length, - int exact, size_t * var_len, - WriteMethod ** write_method) -{ -#define ALM_ENTRY_NAME_LENGTH 14 - oid newname[MAX_OID_LEN]; - register int index; - int result, count; - - DEBUGMSGTL(("cgtsAgentPlugin", "header_alarmEntry: ")); - DEBUGMSGOID(("cgtsAgentPlugin", name, *length)); - DEBUGMSG(("cgtsAgentPlugin", "exact %d\n", exact)); - - memcpy((char *) newname, (char *) vp->name, - (int) vp->namelen * sizeof(oid)); - /* - * find "next" alarm - */ - count = Active_Alarm_Get_Count(); - DEBUGMSG(("cgtsAgentPlugin", "count %d\n", count)); - for (index = 1; index <= count; index++) { - newname[ALM_ENTRY_NAME_LENGTH] = (oid) index; - result = - snmp_oid_compare(name, *length, newname, - (int) vp->namelen + 1); - if ((exact && (result == 0)) || (!exact && (result < 0))) - break; - } - if (index > count) { - DEBUGMSGTL(("cgtsAgentPlugin", "... index out of range\n")); - return MATCH_FAILED; - } - - memcpy((char *) name, (char *) newname, - ((int) vp->namelen + 1) * sizeof(oid)); - *length = vp->namelen + 1; - *write_method = 0; - *var_len = sizeof(long); /* default to 'long' results */ - - DEBUGMSGTL(("cgtsAgentPlugin", "... get ALM data ")); - DEBUGMSGOID(("cgtsAgentPlugin", name, *length)); - DEBUGMSG(("cgtsAgentPlugin", "\n")); - - DEBUGMSG(("cgtsAgentPlugin","Return index: %d\n", index)); - return index; -} - - -int -Active_Alarm_Get_Count(void) -{ - static time_t scan_time = 0; - time_t time_now = time(NULL); - - if (!Active_Alarm_Count || (time_now > scan_time + 60)) { - scan_time = time_now; - Alarm_Scan_Init(); - Active_Alarm_Count = 0; - while (Alarm_Scan_NextAlarm(NULL, NULL, NULL) != 0) { - Active_Alarm_Count++; - } - } - return (Active_Alarm_Count); -} - -u_char * -var_alarms(struct variable *vp, - oid * name, - size_t * length, - int exact, size_t * var_len, - WriteMethod ** write_method) -{ - static struct activealarm alrm; - static char Name[36]; - char *cp; - int index = 0; - - DEBUGMSGTL(("cgtsAgentPlugin", "var_alarms")); - index = header_alarmEntry(vp, name, length, exact, var_len, write_method); - if (index == MATCH_FAILED) - return NULL; - - Alarm_Scan_By_Index(index, Name, &alrm); - - switch (vp->magic) { - case ALARM_INDEX: - long_return = index; - return (u_char *) & long_return; - case ALARM_UUID: - cp = Name; - *var_len = strlen(cp); - return (u_char *) cp; - case ALARM_ID: - cp = alrm.alarmdata.alarm_id; - *var_len = strlen(cp); - return (u_char *) cp; - case ALARM_INSTANCE_ID: - cp = alrm.alarmdata.entity_instance_id; - *var_len = strlen(cp); - return (u_char *) cp; - case ALARM_TIME:{ - time_t when = alrm.alarmdata.timestamp/SECOND_PER_MICROSECOND; - cp = (char *) date_n_time(&when, var_len ); - return (u_char *) cp; - } - case ALARM_SEVERITY: - long_return = alrm.alarmdata.severity; - return (u_char *) & long_return; - case ALARM_REASONTEXT: - cp = alrm.alarmdata.reason_text; - *var_len = strlen(cp); - return (u_char *) cp; - case ALARM_EVENTTYPE: - long_return = alrm.alarmdata.alarm_type; - return (u_char *) & long_return; - case ALARM_PROBABLECAUSE: - long_return = alrm.alarmdata.probable_cause; - return (u_char *) & long_return; - case ALARM_REPAIRACTION: - cp = alrm.alarmdata.proposed_repair_action; - *var_len = strlen(cp); - return (u_char *) cp; - case ALARM_SERVICEAFFECTING: - long_return = alrm.alarmdata.service_affecting; - return (u_char *) & long_return; - case ALARM_SUPPRESSION: - long_return = alrm.alarmdata.suppression; - return (u_char *) & long_return; - default: - DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_alarms\n", - vp->magic)); - } - return NULL; -} - diff --git a/snmp-ext/sources/cgtsAgentPlugin.c b/snmp-ext/sources/cgtsAgentPlugin.c deleted file mode 100644 index b19ef773..00000000 --- a/snmp-ext/sources/cgtsAgentPlugin.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -* Copyright (c) 2016 Wind River Systems, Inc. -* -* SPDX-License-Identifier: Apache-2.0 -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cgtsAgentPlugin.h" - - -#define CGTS_ALM_TABLE_NAME "wrsAlarmActiveTable" -#define CGTS_EVENT_TABLE_NAME "wrsEventTable" - -#define _UNREGISTER_MIB(var, miboid) \ - do{ \ - size_t varsize = sizeof(struct variable2); \ - struct variable2 *vp; \ - oid myoid[MAX_OID_LEN]; \ - size_t length; \ - int i, result; \ - int numvars = sizeof(var)/varsize; \ - int miboidlen = sizeof(miboid)/sizeof(oid); \ - for (i=0; i < numvars; i++) { \ - vp = (struct variable2 *)((char *)var + varsize * i); \ - memcpy(myoid, miboid, miboidlen * sizeof(oid)); \ - memcpy(myoid+miboidlen, vp->name, vp->namelen * sizeof(oid)); \ - length = miboidlen + vp->namelen; \ - result = unregister_mib(myoid, length); \ - DEBUGMSGOID(("cgtsAgentPlugin", myoid, length)); \ - if (result != MIB_UNREGISTERED_OK) { \ - snmp_log(LOG_ERR, "%s: Unregistering failed:%d\n", \ - __FUNCTION__, result); \ - } else { \ - DEBUGMSGTL(("cgtsAgentPlugin", "Unregistering succeeded\n")); \ - } \ - } \ - }while(0); - - -static TFmAlarmSessionT alm_handle; - -/* - * * the OID we want to register our integer at. This should be the - * * OID node for the entire table. In our case this is the - * * wrsAlarmActiveTable oid definition - */ -oid cgtsAlarmTable_oid[] = - { 1, 3, 6, 1, 4, 1, 731, 1, 1, 1, 1, 1}; - -oid cgtsEventLogTable_oid[] = - { 1, 3, 6, 1, 4, 1, 731, 1, 1, 1, 1, 4}; - - -struct variable2 alarm_variables[] = { - {ALARM_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 1}}, - {ALARM_UUID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 2}}, - {ALARM_ID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 3}}, - {ALARM_INSTANCE_ID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 4}}, - {ALARM_TIME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 5}}, - {ALARM_SEVERITY, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 6}}, - {ALARM_REASONTEXT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 7}}, - {ALARM_EVENTTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 8}}, - {ALARM_PROBABLECAUSE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 9}}, - {ALARM_REPAIRACTION , ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 10}}, - {ALARM_SERVICEAFFECTING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 11}}, - {ALARM_SUPPRESSION, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_alarms, 2, {1, 12}}, -}; - -struct variable2 event_log_variables[] = { - {EVENT_INDEX, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 1}}, - {EVENT_UUID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 2}}, - {EVENT_EVENT_ID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 3}}, - {EVENT_STATE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 4}}, - {EVENT_INSTANCE_ID, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 5}}, - {EVENT_TIME, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 6}}, - {EVENT_SEVERITY, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 7}}, - {EVENT_REASONTEXT, ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 8}}, - {EVENT_EVENTTYPE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 9}}, - {EVENT_PROBABLECAUSE, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 10}}, - {EVENT_REPAIRACTION , ASN_OCTET_STR, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 11}}, - {EVENT_SERVICEAFFECTING, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 12}}, - {EVENT_SUPPRESSION, ASN_INTEGER, NETSNMP_OLDAPI_RONLY, - var_events, 2, {1, 13}}, -}; - - -TFmAlarmSessionT getAlarmSession() -{ - return alm_handle; -} - -/* - * our initialization routine, automatically called by the agent - * (to get called, the function name must match init_FILENAME()) - */ -void -init_cgtsAgentPlugin(void) -{ - snmp_log(LOG_INFO,"init_cgtsAgentPlugin start"); - snmp_log(LOG_INFO,"MIB registration: %s",CGTS_ALM_TABLE_NAME); - REGISTER_MIB(CGTS_ALM_TABLE_NAME, alarm_variables, - variable2, cgtsAlarmTable_oid); - - snmp_log(LOG_INFO,"MIB registration: %s",CGTS_EVENT_TABLE_NAME); - REGISTER_MIB(CGTS_EVENT_TABLE_NAME, event_log_variables, - variable2, cgtsEventLogTable_oid); - - snmp_log(LOG_INFO,"get alarm database handler"); - if (fm_snmp_util_create_session(&alm_handle, NULL) != true){ - snmp_log(LOG_ERR,"failed to get alarm database handler"); - exit(-1); - } - /* - * a debugging statement. Run the agent with -DcgtsAgentPlugin to see - * the output of this debugging statement. - */ - DEBUGMSGTL(("cgtsAgentPlugin", "Done initializing.\n")); -} - -void -deinit_cgtsAgentPlugin(void) -{ - snmp_log(LOG_INFO,"deinit_cgtsAgentPlugin start"); - _UNREGISTER_MIB(alarm_variables, cgtsAlarmTable_oid); - _UNREGISTER_MIB(event_log_variables, cgtsEventLogTable_oid); - fm_snmp_util_destroy_session(alm_handle); -} - - - diff --git a/snmp-ext/sources/cgtsAgentPlugin.h b/snmp-ext/sources/cgtsAgentPlugin.h deleted file mode 100644 index df82e1fd..00000000 --- a/snmp-ext/sources/cgtsAgentPlugin.h +++ /dev/null @@ -1,69 +0,0 @@ -/* -* Copyright (c) 2013-2014 Wind River Systems, Inc. -* -* SPDX-License-Identifier: Apache-2.0 -* -*/ - -#ifndef CGTSAGENTPLUGIN_H -#define CGTSAGENTPLUGIN_H - -#include -#include -#include - -extern FindVarMethod var_alarms; - -extern FindVarMethod var_events; - -/* Active alarm Table */ -#define ALARM_INDEX 1 -#define ALARM_UUID 2 -#define ALARM_ID 3 -#define ALARM_INSTANCE_ID 4 -#define ALARM_TIME 5 -#define ALARM_SEVERITY 6 -#define ALARM_REASONTEXT 7 -#define ALARM_EVENTTYPE 8 -#define ALARM_PROBABLECAUSE 9 -#define ALARM_REPAIRACTION 10 -#define ALARM_SERVICEAFFECTING 11 -#define ALARM_SUPPRESSION 12 - -/* Event Log Table */ -#define EVENT_INDEX 1 -#define EVENT_UUID 2 -#define EVENT_EVENT_ID 3 -#define EVENT_STATE 4 -#define EVENT_INSTANCE_ID 5 -#define EVENT_TIME 6 -#define EVENT_SEVERITY 7 -#define EVENT_REASONTEXT 8 -#define EVENT_EVENTTYPE 9 -#define EVENT_PROBABLECAUSE 10 -#define EVENT_REPAIRACTION 11 -#define EVENT_SERVICEAFFECTING 12 -#define EVENT_SUPPRESSION 13 - - -#define SECOND_PER_MICROSECOND 1000000 - -struct activealarm { - SFmAlarmDataT alarmdata; - struct activealarm *next; -}; - -/* - * function declarations - */ -#ifdef __cplusplus -extern "C" { -#endif -void init_cgtsAgentPlugin(void); -void deinit_cgtsAgentPlugin(void); -TFmAlarmSessionT getAlarmSession(); -#ifdef __cplusplus -} -#endif - -#endif /* CGTSAGENTPLUGIN_H */ diff --git a/snmp-ext/sources/cgtsEventLogs.c b/snmp-ext/sources/cgtsEventLogs.c deleted file mode 100644 index 848261fa..00000000 --- a/snmp-ext/sources/cgtsEventLogs.c +++ /dev/null @@ -1,268 +0,0 @@ -/* -* Copyright (c) 2013-2016 Wind River Systems, Inc. -* -* SPDX-License-Identifier: Apache-2.0 -* -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "cgtsAgentPlugin.h" - - -netsnmp_feature_require(date_n_time) - -#define MINLOADFREQ 2 /* min reload frequency in seconds */ - -static long Event_Log_Count = 0; -static struct activealarm *alarm_list; -static struct activealarm *alarmaddr, savealarm, *savealarmaddr; -static int saveIndex = 0; -static char saveUuid[36]; -static long LastLoad = 0; /* ET in secs at last table load */ -extern long long_return; - - -int Event_Log_Get_Count(void); - -static void -Event_Log_Scan_Init() -{ - struct timeval et; /* elapsed time */ - struct activealarm **activealarm_ptr; - SFmAlarmQueryT aquery; - size_t i = 0; - - saveIndex = 0; - netsnmp_get_monotonic_clock(&et); - if ( et.tv_sec < LastLoad + MINLOADFREQ ) { - DEBUGMSG(("cgtsAgentPlugin", "Skip reload" )); - alarmaddr = alarm_list; - return; - } - LastLoad = et.tv_sec; - - /* - * free old list: - */ - while (alarm_list) { - struct activealarm *old = alarm_list; - alarm_list = alarm_list->next; - free(old); - } - alarmaddr = 0; - activealarm_ptr = &alarm_list; - - /* - * query event log list from DB - */ - if (fm_snmp_util_get_all_event_logs(getAlarmSession(), &aquery) != true){ - DEBUGMSG(("cgtsAgentPlugin", "get_all_event_logs from db failed\n")); - return; - } - DEBUGMSG(("cgtsAgentPlugin", "get_all_event_logs returns %lu logs\n", aquery.num)); - for (i = 0; i < aquery.num; ++i){ - struct activealarm *almnew; - /*populate alarm_list*/ - almnew = (struct activealarm *) calloc(1, sizeof(struct activealarm)); - if (almnew == NULL) - break; /* alloc error */ - *activealarm_ptr = almnew; - activealarm_ptr = &almnew->next; - memset(&almnew->alarmdata, 0 , sizeof(almnew->alarmdata)); - memcpy(&almnew->alarmdata, aquery.alarm + i, sizeof(almnew->alarmdata)); - } - alarmaddr = alarm_list; - free(aquery.alarm); -} - -static int -Event_Log_Scan_NextLog(int *Index, - char *Name, - struct activealarm *Aalm) -{ - struct activealarm alm; - while (alarmaddr) { - alm = *alarmaddr; - strlcpy(saveUuid, alm.alarmdata.uuid, sizeof(saveUuid)); - if (Index) - *Index = ++saveIndex; - if (Aalm) - *Aalm = alm; - if (Name) - strcpy(Name, saveUuid); - - savealarm = alm; - savealarmaddr = alarmaddr; - alarmaddr = alm.next; - return 1; - } - return 0; -} - -static int -Event_Log_Scan_By_Index(int Index, - char *Name, - struct activealarm *Aalm) -{ - int i; - - DEBUGMSGTL(("cgtsAgentPlugin","Event_Log_Scan_By_Index")); - Event_Log_Scan_Init(); - while (Event_Log_Scan_NextLog(&i, Name, Aalm)) { - if (i == Index) - break; - } - if (i != Index) - return (-1); /* Error, doesn't exist */ - return (0); /* DONE */ -} - -static int -header_eventLogEntry(struct variable *vp, - oid * name, - size_t * length, - int exact, size_t * var_len, - WriteMethod ** write_method) -{ -#define ALM_ENTRY_NAME_LENGTH 14 - oid newname[MAX_OID_LEN]; - register int index; - int result, count; - - DEBUGMSGTL(("cgtsAgentPlugin", "header_eventLogEntry: ")); - DEBUGMSGOID(("cgtsAgentPlugin", name, *length)); - DEBUGMSG(("cgtsAgentPlugin", "exact %d\n", exact)); - - memcpy((char *) newname, (char *) vp->name, - (int) vp->namelen * sizeof(oid)); - /* - * find "next" log - */ - count = Event_Log_Get_Count(); - DEBUGMSG(("cgtsAgentPlugin", "count %d\n", count)); - for (index = 1; index <= count; index++) { - newname[ALM_ENTRY_NAME_LENGTH] = (oid) index; - result = - snmp_oid_compare(name, *length, newname, - (int) vp->namelen + 1); - if ((exact && (result == 0)) || (!exact && (result < 0))) - break; - } - if (index > count) { - DEBUGMSGTL(("cgtsAgentPlugin", "... index out of range\n")); - return MATCH_FAILED; - } - - memcpy((char *) name, (char *) newname, - ((int) vp->namelen + 1) * sizeof(oid)); - *length = vp->namelen + 1; - *write_method = 0; - *var_len = sizeof(long); /* default to 'long' results */ - - DEBUGMSGTL(("cgtsAgentPlugin", "... get ALM data ")); - DEBUGMSGOID(("cgtsAgentPlugin", name, *length)); - DEBUGMSG(("cgtsAgentPlugin", "\n")); - - DEBUGMSG(("cgtsAgentPlugin","Return index: %d\n", index)); - return index; -} - -int -Event_Log_Get_Count(void) -{ - static time_t scan_time = 0; - time_t time_now = time(NULL); - - if (!Event_Log_Count || (time_now > scan_time + 60)) { - scan_time = time_now; - Event_Log_Scan_Init(); - Event_Log_Count = 0; - while (Event_Log_Scan_NextLog(NULL, NULL, NULL) != 0) { - Event_Log_Count++; - } - } - return (Event_Log_Count); -} - -u_char * -var_events(struct variable *vp, - oid * name, - size_t * length, - int exact, size_t * var_len, - WriteMethod ** write_method) -{ - static struct activealarm alrm; - static char Name[36]; - char *cp; - int index = 0; - - DEBUGMSGTL(("cgtsAgentPlugin", "var_events")); - index = header_eventLogEntry(vp, name, length, exact, var_len, write_method); - if (index == MATCH_FAILED) - return NULL; - - Event_Log_Scan_By_Index(index, Name, &alrm); - - switch (vp->magic) { - case EVENT_INDEX: - long_return = index; - return (u_char *) & long_return; - case EVENT_UUID: - cp = Name; - *var_len = strlen(cp); - return (u_char *) cp; - case EVENT_EVENT_ID: - cp = alrm.alarmdata.alarm_id; - *var_len = strlen(cp); - return (u_char *) cp; - case EVENT_STATE: - long_return = alrm.alarmdata.alarm_state; - return (u_char *) & long_return; - case EVENT_INSTANCE_ID: - cp = alrm.alarmdata.entity_instance_id; - *var_len = strlen(cp); - return (u_char *) cp; - case EVENT_TIME:{ - time_t when = alrm.alarmdata.timestamp/SECOND_PER_MICROSECOND; - cp = (char *) date_n_time(&when, var_len ); - return (u_char *) cp; - } - case EVENT_SEVERITY: - long_return = alrm.alarmdata.severity; - return (u_char *) & long_return; - case EVENT_REASONTEXT: - cp = alrm.alarmdata.reason_text; - *var_len = strlen(cp); - return (u_char *) cp; - case EVENT_EVENTTYPE: - long_return = alrm.alarmdata.alarm_type; - return (u_char *) & long_return; - case EVENT_PROBABLECAUSE: - long_return = alrm.alarmdata.probable_cause; - return (u_char *) & long_return; - case EVENT_REPAIRACTION: - cp = alrm.alarmdata.proposed_repair_action; - *var_len = strlen(cp); - return (u_char *) cp; - case EVENT_SERVICEAFFECTING: - long_return = alrm.alarmdata.service_affecting; - return (u_char *) & long_return; - case EVENT_SUPPRESSION: - long_return = alrm.alarmdata.suppression; - return (u_char *) & long_return; - default: - DEBUGMSGTL(("snmpd", "unknown sub-id %d in var_events\n", - vp->magic)); - } - return NULL; -} - diff --git a/snmp-ext/sources/mibs/wrsAlarmMib.mib.txt b/snmp-ext/sources/mibs/wrsAlarmMib.mib.txt deleted file mode 100644 index 7c5fb7fe..00000000 --- a/snmp-ext/sources/mibs/wrsAlarmMib.mib.txt +++ /dev/null @@ -1,818 +0,0 @@ -WRS-ALARM-MIB - -DEFINITIONS ::= BEGIN - - IMPORTS - wrsAlarms, WrsUUID, WrsBoolean FROM WRS-ENTERPRISE-REG-MIB - - NOTIFICATION-GROUP, OBJECT-GROUP, MODULE-COMPLIANCE - FROM SNMPv2-CONF - - DateAndTime, DisplayString, TEXTUAL-CONVENTION - FROM SNMPv2-TC - - MODULE-IDENTITY, OBJECT-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE, Unsigned32 - FROM SNMPv2-SMI; - - - wrsAlarmMIB MODULE-IDENTITY - LAST-UPDATED "201703310000Z" - ORGANIZATION "Wind River Systems, Inc." - CONTACT-INFO "Wind River Systems, Inc. - 500 Wind River Way - Alameda, CA 94501, USA - Contact : Wind River Systems Support - E-mail: support@windriver.com - Phone : 510.748.4100" - DESCRIPTION "This module contains objects of the - Titanium Cloud Alarm MIB, - including notifications." - - -- Revision history - REVISION "201703310000Z" - DESCRIPTION "Titanium Cloud Release 4 version, with new Event table and removal of deprecated customer and alarm history tables." - ::= { wrsAlarms 1 } - - wrsAlarmObjects OBJECT IDENTIFIER ::= { wrsAlarmMIB 1 } - wrsAlarmConformance OBJECT IDENTIFIER ::= { wrsAlarmMIB 2 } - wrsAlarmCompliances OBJECT IDENTIFIER ::= { wrsAlarmConformance 1 } - wrsAlarmGroups OBJECT IDENTIFIER ::= { wrsAlarmConformance 2 } - - - -- Textual Conventions - - WrsAlarmSeverity ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION "The severity of the alarm." - SYNTAX INTEGER - { - not-applicable (0), - warning (1), - minor (2), - major (3), - critical (4) - } - - WrsAlarmState ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION "The state of the alarm." - SYNTAX INTEGER - { - clear (0), - set (1), - log (3) - } - - WrsAlarmId ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION "An ID identifying the particular Alarm condition. - Typically used as an index for looking up Alarm details - in a System's Alarm Document. - - This will be a structured ID, in order to allow grouping of - Alarms into general categories and allow specific Alarms to - be independently added and numbered within the group. - - e.g. . - where = 000 - 999 - = 000 - 999 - - NOTE: the { alarm-id, entity-instance-id } uniquely identifies an ACTIVE Alarm. - e.g. - - an alarm is cleared based on the matching { alarm-id, entity-instance-id }, - - consecutive sets of an alarm with matching { alarm-id, entity-instance-id } - updates the fields of the single ACTIVE Alarm. - E.g. updates severity for example. " - SYNTAX OCTET STRING (SIZE (0..7)) - - WrsAlarmEntityInstanceId ::= TEXTUAL-CONVENTION - DISPLAY-HINT "255a" - STATUS current - DESCRIPTION "This is a textual description of the resource under alarm. - - A '.' separated list of sub-entity-type=instance-value pairs, - representing the containment structure of the overall entity - instance. - - Can be larger than 256 bytes. - - Note that this containment structure will be used for - processing hierarchical clears. - - e.g - system=ironpass1-4 - system=ironpass1-4 . host=compute-0 - system=ironpass1-4 . host=compute-0 . port=eth0 - system=ironpass1-4 . host=compute-0 . disk=/dev/sda - - system=ironpass1-4 . instance=vyatta_rtr_0 - system=ironpass1-4 . stack=vyatta_scaling_rtrs - - NOTE: the { alarm-id, entity-instance-id } uniquely identifies an ACTIVE Alarm. - e.g. - - an alarm is cleared based on the matching { alarm-id, entity-instance-id }, - - consecutive sets of an alarm with matching { alarm-id, entity-instance-id } - updates the fields of the single ACTIVE Alarm. - E.g. updates severity for example." - SYNTAX OCTET STRING - - WrsAlarmText ::= TEXTUAL-CONVENTION - DISPLAY-HINT "255a" - STATUS current - DESCRIPTION "Variable length string to encapsulate alarm or message - information from the entity raising the trap. - Can be larger than 256 bytes." - SYNTAX OCTET STRING - - WrsAlarmProbableCause ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "ITU-T probable cause values. Duplicate values defined in - X.733 are appended with X733 to ensure syntactic uniqueness. - Probable cause value 0 is reserved for special purposes. - - The Internet Assigned Number Authority (IANA) is responsible - for the assignment of the enumerations in this TC. - IANAItuProbableCause value of 0 is reserved for special - purposes and MUST NOT be assigned. - - Values of IANAItuProbableCause in the range 1 to 1023 are - reserved for causes that correspond to ITU-T probable cause. - - All other requests for new causes will be handled on a - first-come, first served basis and will be assigned - enumeration values starting with 1025. - - Request should come in the form of well-formed - SMI [RFC2578] for enumeration names that are unique and - sufficiently descriptive. - - While some effort will be taken to ensure that new probable - causes do not conceptually duplicate existing probable - causes it is acknowledged that the existence of conceptual - duplicates in the starting probable cause list is an known - industry reality. - - To aid IANA in the administration of probable cause names - and values, the OPS Area Director will appoint one or more - experts to help review requests. - - See http://www.iana.org" - REFERENCE - "ITU Recommendation M.3100, 'Generic Network Information - Model', 1995 - ITU Recommendation X.733, 'Information Technology - Open - Systems Interconnection - System Management: Alarm - Reporting Function', 1992 - ITU Recommendation X.736, 'Information Technology - Open - Systems Interconnection - System Management: Security - Alarm Reporting Function', 1992" - SYNTAX INTEGER - { - not-applicable (0), - -- The following probable causes were defined in M.3100 - adaptor-error (1), - application-subsystem-failure (2), - bandwidth-reduced (3), - call-establishment-error (4), - communication-protocol-error (5), - communication-subsystem-failure (6), - configuration-or-customization-error (7), - congestion (8), - corrupt-data (9), - cpu-cycles-limit-exceeded (10), - dataset-or-modem-error (11), - degraded-signal (12), - dte-dce-interface-error (13), - enclosure-door-open (14), - equipment-malfunction (15), - excessive-vibration (16), - file-error (17), - fire-detected (18), - flood-detected (19), - framing-error (20), - heating-ventilation-cooling-system-problem (21), - humidity-unacceptable (22), - io-device-error (23), - input-device-error (24), - lan-error (25), - leak-detected (26), - local-node-transmission-error (27), - loss-of-frame (28), - loss-of-signal (29), - material-supply-exhausted (30), - multiplexer-problem (31), - out-of-memory (32), - output-device-error (33), - performance-degraded (34), - power-problem (35), - processor-problem (36), - pump-failure (37), - queue-size-exceeded (38), - receive-failure (39), - receiver-failure (40), - remote-node-transmission-error (41), - resource-at-or-nearing-capacity (42), - response-time-excessive (43), - retransmission-rate-excessive (44), - software-error (45), - software-program-abnormally-terminated (46), - software-program-error (47), - storage-capacity-problem (48), - temperature-unacceptable (49), - threshold-crossed (50), - timing-problem (51), - toxic-leak-detected (52), - transmit-failure (53), - transmitter-failure (54), - underlying-resource-unavailable (55), - version-mismatch (56), - duplicate-information (57), - information-missing (58), - information-modification-detected (59), - information-out-of-sequence (60), - unexpected-information (61), - denial-of-service (62), - out-of-service (63), - procedural-error (64), - unspecified-reason (65), - cable-tamper (66), - intrusion-detection (67), - authentication-failure (68), - breach-of-confidentiality (69), - non-repudiation-failure (70), - unauthorized-access-attempt (71), - delayed-information (72), - key-expired (73), - out-of-hours-activity (74) - } - - WrsAlarmEventType ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION - "The ITU event Type values. - - The Internet Assigned Number Authority (IANA) is - responsible for the assignment of the enumerations - in this TC. - - Request should come in the form of well-formed - SMI [RFC2578] for enumeration names that are unique - and sufficiently descriptive. - - See http://www.iana.org " - REFERENCE - "ITU Recommendation X.736, 'Information Technology - Open - Systems Interconnection - System Management: Security - Alarm Reporting Function', 1992" - SYNTAX INTEGER - { - other (0), - communicationsAlarm (1), - qualityOfServiceAlarm (2), - processingErrorAlarm (3), - equipmentAlarm (4), - environmentalAlarm (5), - integrityViolation (6), - operationalViolation (7), - physicalViolation (8), - securityServiceOrMechanismViolation (9), - timeDomainViolation (10) - } - - - -- Wind River Systems Active Alarm Table - - wrsAlarmActiveTable OBJECT-TYPE - SYNTAX SEQUENCE OF WrsAlarmActiveEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION "This table contains information about active alarms." - ::= { wrsAlarmObjects 1 } - - wrsAlarmActiveEntry OBJECT-TYPE - SYNTAX WrsAlarmActiveEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION "An active alarm entry" - INDEX { wrsAlarmActiveIndex } - ::= { wrsAlarmActiveTable 1 } - - WrsAlarmActiveEntry ::= SEQUENCE { - wrsAlarmActiveIndex Unsigned32, - wrsAlarmActiveUuid DisplayString, - wrsAlarmActiveAlarmId WrsAlarmId, - wrsAlarmActiveEntityInstanceId WrsAlarmEntityInstanceId, - wrsAlarmActiveDateAndTime DateAndTime, - wrsAlarmActiveAlarmSeverity WrsAlarmSeverity, - wrsAlarmActiveReasonText WrsAlarmText, - wrsAlarmActiveEventType WrsAlarmEventType, - wrsAlarmActiveProbableCause WrsAlarmProbableCause, - wrsAlarmActiveProposedRepairAction WrsAlarmText, - wrsAlarmActiveServiceAffecting WrsBoolean, - wrsAlarmActiveSuppressionAllowed WrsBoolean - } - - wrsAlarmActiveIndex OBJECT-TYPE - SYNTAX Unsigned32 (1..4294967295) - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION "The index of the Active Alarm in the Active Alarm Table." - ::= { wrsAlarmActiveEntry 1 } - - wrsAlarmActiveUuid OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION "An ID identifying the active alarm instance in the Active Alarm Table." - ::= { wrsAlarmActiveEntry 2 } - - wrsAlarmActiveAlarmId OBJECT-TYPE - SYNTAX WrsAlarmId - MAX-ACCESS read-only - STATUS current - DESCRIPTION "An ID identifying the particular Alarm condition. - Typically used as an index for looking up Alarm details - in a System's Alarm Document. - - This will be a structured ID, in order to allow grouping of - Alarms into general categories and allow specific Alarms to - be independently added and numbered within the group. - - e.g. . - where = 000 - 999 - = 000 - 999 - - NOTE: the { alarm-id, entity-instance-id } uniquely identifies an ACTIVE Alarm. - e.g. - - an alarm is cleared based on the matching { alarm-id, entity-instance-id }, - - consecutive sets of an alarm with matching { alarm-id, entity-instance-id } - updates the fields of the single ACTIVE Alarm. - E.g. updates severity for example. " - ::= { wrsAlarmActiveEntry 3 } - - wrsAlarmActiveEntityInstanceId OBJECT-TYPE - SYNTAX WrsAlarmEntityInstanceId - MAX-ACCESS read-only - STATUS current - DESCRIPTION "This is a textual description of the resource under alarm. - - A '.' separated list of sub-entity-type=instance-value pairs, - representing the containment structure of the overall entity - instance. - - Note that this containment structure will be used for - processing hierarchical clears. - - e.g - system=ironpass1-4 - system=ironpass1-4 . host=compute-0 - system=ironpass1-4 . host=compute-0 . port=eth0 - system=ironpass1-4 . host=compute-0 . disk=/dev/sda - - system=ironpass1-4 . instance=vyatta_rtr_0 - system=ironpass1-4 . stack=vyatta_scaling_rtrs - - NOTE: the { alarm-id, entity-instance-id } uniquely identifies an ACTIVE Alarm. - e.g. - - an alarm is cleared based on the matching { alarm-id, entity-instance-id }, - - consecutive sets of an alarm with matching { alarm-id, entity-instance-id } - updates the fields of the single ACTIVE Alarm. - E.g. updates severity for example." - ::= { wrsAlarmActiveEntry 4 } - - wrsAlarmActiveDateAndTime OBJECT-TYPE - SYNTAX DateAndTime - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Provided in this table as a convenience. It is a copy of the Date and Time of the alarm." - ::= { wrsAlarmActiveEntry 5} - - wrsAlarmActiveAlarmSeverity OBJECT-TYPE - SYNTAX WrsAlarmSeverity - MAX-ACCESS read-only - STATUS current - DESCRIPTION "The severity of the alarm." - ::= { wrsAlarmActiveEntry 6} - - wrsAlarmActiveReasonText OBJECT-TYPE - SYNTAX WrsAlarmText - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Represents the per active alarm instance additional text field." - REFERENCE "ITU Recommendation M.3100, 'Generic Network Information Model', 1995 - ITU Recommendation X.733, 'Information Technology - Open - Systems Interconnection - System Management: Alarm Reporting Function', 1992" - ::= { wrsAlarmActiveEntry 7} - - wrsAlarmActiveEventType OBJECT-TYPE - SYNTAX WrsAlarmEventType - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Represents the per active alarm instance event type values." - REFERENCE "ITU Recommendation M.3100, 'Generic Network Information Model', 1995 - ITU Recommendation X.733, 'Information Technology - Open - Systems Interconnection - System Management: Alarm Reporting Function', 1992 - ITU Recommendation X.736, 'Information Technology - Open - Systems Interconnection - System Management: Security - Alarm Reporting Function', 1992" - ::= { wrsAlarmActiveEntry 8 } - - wrsAlarmActiveProbableCause OBJECT-TYPE - SYNTAX WrsAlarmProbableCause - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Per active alarm instance ITU probable cause values." - REFERENCE "ITU Recommendation M.3100, 'Generic Network Information Model', 1995 - ITU Recommendation X.733, 'Information Technology - Open - Systems Interconnection - System Management: Alarm Reporting Function', 1992 - ITU Recommendation X.736, 'Information Technology - Open - Systems Interconnection - System Management: Security - Alarm Reporting Function', 1992" - ::= { wrsAlarmActiveEntry 9 } - - wrsAlarmActiveProposedRepairAction OBJECT-TYPE - SYNTAX WrsAlarmText - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Represents more of the per active alarm instance additional text field." - ::= { wrsAlarmActiveEntry 10} - - wrsAlarmActiveServiceAffecting OBJECT-TYPE - SYNTAX WrsBoolean - MAX-ACCESS read-only - STATUS current - DESCRIPTION "This attribute indicates whether the alarm is service affecting or not." - ::= { wrsAlarmActiveEntry 11 } - - wrsAlarmActiveSuppressionAllowed OBJECT-TYPE - SYNTAX WrsBoolean - MAX-ACCESS read-only - STATUS current - DESCRIPTION "This attribute indicates whether the alarm can be manually suppressed or not." - ::= { wrsAlarmActiveEntry 12 } - - - -- Wind River Event Table - - wrsEventTable OBJECT-TYPE - SYNTAX SEQUENCE OF WrsEventEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION "This table contains information about events." - ::= { wrsAlarmObjects 4 } - - wrsEventEntry OBJECT-TYPE - SYNTAX WrsEventEntry - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION "An event entry" - INDEX { wrsEventIndex } - ::= { wrsEventTable 1 } - - WrsEventEntry ::= SEQUENCE { - wrsEventIndex Unsigned32, - wrsEventUuid DisplayString, - wrsEventEventId WrsAlarmId, - wrsEventState WrsAlarmState, - wrsEventEntityInstanceId WrsAlarmEntityInstanceId, - wrsEventDateAndTime DateAndTime, - wrsEventSeverity WrsAlarmSeverity, - wrsEventReasonText WrsAlarmText, - wrsEventEventType WrsAlarmEventType, - wrsEventProbableCause WrsAlarmProbableCause, - wrsEventProposedRepairAction WrsAlarmText, - wrsEventServiceAffecting WrsBoolean, - wrsEventSuppressionAllowed WrsBoolean - } - - wrsEventIndex OBJECT-TYPE - SYNTAX Unsigned32 (1..4294967295) - MAX-ACCESS not-accessible - STATUS current - DESCRIPTION "The index of the event in the Event Table." - ::= { wrsEventEntry 1 } - - wrsEventUuid OBJECT-TYPE - SYNTAX DisplayString - MAX-ACCESS read-only - STATUS current - DESCRIPTION "An ID identifying the event instance in the Event Table." - ::= { wrsEventEntry 2 } - - wrsEventEventId OBJECT-TYPE - SYNTAX WrsAlarmId - MAX-ACCESS read-only - STATUS current - DESCRIPTION "An ID identifying the particular Event condition. - Typically used as an index for looking up Event details - in a System's Event Document. - - This will be a structured ID, in order to allow grouping of - Events into general categories and allow specific Event to - be independently added and numbered within the group. - - e.g. . - where = 000 - 999 - = 000 - 999 " - ::= { wrsEventEntry 3 } - - wrsEventState OBJECT-TYPE - SYNTAX WrsAlarmState - MAX-ACCESS read-only - STATUS current - DESCRIPTION "The state of the event. - - For Customer log events, this field is set to LOG. The attributes that are applicable for a LOG state are: - State, EventId, EntityInstanceId, DateAndTime, Severity, ReasonText, EventType, ProbableCause, ServiceAffecting - - " - ::= { wrsEventEntry 4 } - - wrsEventEntityInstanceId OBJECT-TYPE - SYNTAX WrsAlarmEntityInstanceId - MAX-ACCESS read-only - STATUS current - DESCRIPTION "This is a textual description of the resource under event. - - A '.' separated list of sub-entity-type=instance-value pairs, - representing the containment structure of the overall entity - instance. - - e.g - system=ironpass1-4 - system=ironpass1-4 . host=compute-0 - system=ironpass1-4 . host=compute-0 . port=eth0 - system=ironpass1-4 . host=compute-0 . disk=/dev/sda - - system=ironpass1-4 . instance=vyatta_rtr_0 - system=ironpass1-4 . stack=vyatta_scaling_rtrs" - ::= { wrsEventEntry 5 } - - wrsEventDateAndTime OBJECT-TYPE - SYNTAX DateAndTime - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Provided in this table as a convenience. It is the event last update Date and Time ." - ::= { wrsEventEntry 6 } - - wrsEventSeverity OBJECT-TYPE - SYNTAX WrsAlarmSeverity - MAX-ACCESS read-only - STATUS current - DESCRIPTION "The severity of the Event." - ::= { wrsEventEntry 7 } - - wrsEventReasonText OBJECT-TYPE - SYNTAX WrsAlarmText - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Represents the per Event instance additional text field." - REFERENCE "ITU Recommendation M.3100, 'Generic Network Information Model', 1995 - ITU Recommendation X.733, 'Information Technology - Open - Systems Interconnection - System Management: Alarm Reporting Function', 1992" - ::= { wrsEventEntry 8 } - - wrsEventEventType OBJECT-TYPE - SYNTAX WrsAlarmEventType - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Represents the per Event instance event type values." - REFERENCE "ITU Recommendation M.3100, 'Generic Network Information Model', 1995 - ITU Recommendation X.733, 'Information Technology - Open - Systems Interconnection - System Management: Alarm Reporting Function', 1992 - ITU Recommendation X.736, 'Information Technology - Open - Systems Interconnection - System Management: Security - Alarm Reporting Function', 1992" - ::= { wrsEventEntry 9 } - - wrsEventProbableCause OBJECT-TYPE - SYNTAX WrsAlarmProbableCause - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Per Event instance ITU probable cause values." - REFERENCE "ITU Recommendation M.3100, 'Generic Network Information Model', 1995 - ITU Recommendation X.733, 'Information Technology - Open - Systems Interconnection - System Management: Alarm Reporting Function', 1992 - ITU Recommendation X.736, 'Information Technology - Open - Systems Interconnection - System Management: Security - Alarm Reporting Function', 1992" - ::= { wrsEventEntry 10 } - - wrsEventProposedRepairAction OBJECT-TYPE - SYNTAX WrsAlarmText - MAX-ACCESS read-only - STATUS current - DESCRIPTION "Represents more of the per historical alarm instance additional text field. - Applies to alarms only." - ::= { wrsEventEntry 11} - - wrsEventServiceAffecting OBJECT-TYPE - SYNTAX WrsBoolean - MAX-ACCESS read-only - STATUS current - DESCRIPTION "This attribute indicates whether the Event is service affecting or not." - ::= { wrsEventEntry 12 } - - wrsEventSuppressionAllowed OBJECT-TYPE - SYNTAX WrsBoolean - MAX-ACCESS read-only - STATUS current - DESCRIPTION "This attribute indicates whether the alarm can be manually suppressed or not. - Applies to alarms only." - ::= { wrsEventEntry 13 } - - - -- All notification OIDs would be prefixed with a zero OID to facilitate snmp v1<->v2 conversion - - wrsTrapPrefix OBJECT-IDENTITY - STATUS current - DESCRIPTION "This OID represents the prefix branch for all WIND RIVER ITU Alarm Trap. - The last but one sub identifier in the OID of any Notification must have the value - zero to facilitate v2<-->v1 conversion." - ::= {wrsAlarmObjects 0 } - - --- Generic Severity-based Traps / Alarms - - wrsAlarmCritical NOTIFICATION-TYPE - OBJECTS { - wrsAlarmActiveAlarmId, - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveAlarmSeverity, - wrsAlarmActiveReasonText, - wrsAlarmActiveEventType, - wrsAlarmActiveProbableCause, - wrsAlarmActiveProposedRepairAction, - wrsAlarmActiveServiceAffecting, - wrsAlarmActiveSuppressionAllowed - } - STATUS current - DESCRIPTION "This notification indicates that an alarm of 'Critical' severity - has been raised on the system. - The varbinds include details of the alarm." - ::= { wrsTrapPrefix 1 } - - - wrsAlarmMajor NOTIFICATION-TYPE - OBJECTS { - wrsAlarmActiveAlarmId, - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveAlarmSeverity, - wrsAlarmActiveReasonText, - wrsAlarmActiveEventType, - wrsAlarmActiveProbableCause, - wrsAlarmActiveProposedRepairAction, - wrsAlarmActiveServiceAffecting, - wrsAlarmActiveSuppressionAllowed - } - STATUS current - DESCRIPTION "This notification indicates that an alarm of 'Major' severity - has been raised on the system. - The varbinds include details of the alarm." - ::= { wrsTrapPrefix 2 } - - - wrsAlarmMinor NOTIFICATION-TYPE - OBJECTS { - wrsAlarmActiveAlarmId, - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveAlarmSeverity, - wrsAlarmActiveReasonText, - wrsAlarmActiveEventType, - wrsAlarmActiveProbableCause, - wrsAlarmActiveProposedRepairAction, - wrsAlarmActiveServiceAffecting, - wrsAlarmActiveSuppressionAllowed - } - STATUS current - DESCRIPTION "This notification indicates that an alarm of 'Minor' severity - has been raised on the system. - The varbinds include details of the alarm." - ::= { wrsTrapPrefix 3 } - - - wrsAlarmWarning NOTIFICATION-TYPE - OBJECTS { - wrsAlarmActiveAlarmId, - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveAlarmSeverity, - wrsAlarmActiveReasonText, - wrsAlarmActiveEventType, - wrsAlarmActiveProbableCause, - wrsAlarmActiveProposedRepairAction, - wrsAlarmActiveServiceAffecting, - wrsAlarmActiveSuppressionAllowed - } - STATUS current - DESCRIPTION "This notification indicates that an alarm of 'Warning' severity - has been raised on the system. - The varbinds include details of the alarm." - ::= { wrsTrapPrefix 4 } - - - wrsAlarmMessage NOTIFICATION-TYPE - OBJECTS { - wrsAlarmActiveAlarmId, - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveAlarmSeverity, - wrsAlarmActiveReasonText, - wrsAlarmActiveEventType, - wrsAlarmActiveProbableCause, - wrsAlarmActiveProposedRepairAction, - wrsAlarmActiveServiceAffecting, - wrsAlarmActiveSuppressionAllowed - } - STATUS current - DESCRIPTION "This notification indicates that a stateless message alarm - event has occurred on the system. - The varbinds include details of the alarm. - Note that these events are stored in the Customer Log Table." - ::= { wrsTrapPrefix 5 } - - - wrsAlarmClear NOTIFICATION-TYPE - OBJECTS { - wrsAlarmActiveAlarmId, - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveReasonText - } - STATUS current - DESCRIPTION "This notification indicates that a previously - reported alarm have been cleared. - The previously reported alarm is identified by the - { AlarmId, EntityInstanceId } tuple." - ::= { wrsTrapPrefix 9 } - - wrsAlarmHierarchicalClear NOTIFICATION-TYPE - OBJECTS { - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveReasonText - } - STATUS current - DESCRIPTION "This notification indicates that one or more previously - reported alarms have been cleared. - The previously reported alarms are identified by the - EntityInstanceId attribute. - ALL alarms against EntityInstanceId and all of its children - have been cleared." - ::= { wrsTrapPrefix 99 } - - - --- Notification group definitions - - wrsAlarmNotificationsGroup NOTIFICATION-GROUP - NOTIFICATIONS { - wrsAlarmClear, - wrsAlarmHierarchicalClear, - wrsAlarmMessage, - wrsAlarmWarning, - wrsAlarmMinor, - wrsAlarmMajor, - wrsAlarmCritical - } - STATUS current - DESCRIPTION "Wind River alarm notification group." - ::= { wrsAlarmGroups 1} - - wrsAlarmGroup OBJECT-GROUP - OBJECTS { - wrsAlarmActiveUuid, - wrsAlarmActiveAlarmId, - wrsAlarmActiveEntityInstanceId, - wrsAlarmActiveDateAndTime, - wrsAlarmActiveAlarmSeverity, - wrsAlarmActiveReasonText, - wrsAlarmActiveEventType, - wrsAlarmActiveProbableCause, - wrsAlarmActiveProposedRepairAction, - wrsAlarmActiveServiceAffecting, - wrsAlarmActiveSuppressionAllowed - } - STATUS current - DESCRIPTION "Wind River alarm group." - ::= { wrsAlarmGroups 2} - - - --- Compliance - - wrsAlarmCompliance MODULE-COMPLIANCE - STATUS current - DESCRIPTION "The compliance statement for entities which implement - the Wind River Alarm MIB." - MODULE -- this module - MANDATORY-GROUPS { wrsAlarmGroup - } - ::= { wrsAlarmCompliances 1} - - -END diff --git a/snmp-ext/sources/mibs/wrsEnterpriseReg.mib.txt b/snmp-ext/sources/mibs/wrsEnterpriseReg.mib.txt deleted file mode 100644 index f009cac1..00000000 --- a/snmp-ext/sources/mibs/wrsEnterpriseReg.mib.txt +++ /dev/null @@ -1,132 +0,0 @@ ------------------------------------------------------------------------------- --- --- File : wrsEnterpriseReg.mib --- Description : Wind River Enterprise Registration Hierarchy MIB --- Version : 1.2.0 --- Date : June 2, 2017 --- OBSOLETES : wrsMasterMib.mib v0.6 (August 29, 2000) --- --- Copyright (c) 2014-2017 Wind River Systems, Inc. All Rights Reserved. --- --- This module defines the Wind River Systems (WRS) registration hierarchy, --- --- The Wind River Systems registration tree is administered with the following --- hierarchy: --- iso(1).org(3).dod(6).internet(1).private(4).enterprise(1) --- .wrs(731) --- .wrs(731).wrsCommon(1) --- .wrs(731).wrsCommon(1).wrs(1-...) ... cont'd in wrsCommon.mib --- .wrs(731).wrs(2-...) ... cont'd in wrs.mib --- --- Reproduction of this document is authorized on condition that this --- copyright notice is included. This Wind River Enterprise Registration MIB --- embodies proprietary intellectual property of Wind River Systems (WRS). --- WRS retains all title and ownership in the specification, including any --- revisions. --- --- It is the intent of WRS to encourage the widespread use of this --- specification in connection with the management of Wind River products. --- WRS grants vendors, end-users, and other interested parties a --- non-exclusive license to use this specification in connection with the --- management of Wind River products. --- --- This specification is supplied "AS IS", and WRS makes no warranty, --- either express or implied, as to the use, operations, condition, --- or performance of this specification. --- ------------------------------------------------------------------------------- - -WRS-ENTERPRISE-REG-MIB DEFINITIONS ::= BEGIN - -IMPORTS - TEXTUAL-CONVENTION FROM SNMPv2-TC - MODULE-IDENTITY, enterprises FROM SNMPv2-SMI; - - wrs MODULE-IDENTITY - LAST-UPDATED "201407100000Z" -- July 10, 2014 - ORGANIZATION "Wind River Systems, Inc." - CONTACT-INFO "Wind River Systems, Inc. - 500 Wind River Way - Alameda, CA 94501, USA - Contact: Wind River Systems Support - E-mail : support@windriver.com - Phone : 510.748.4100" - DESCRIPTION "This module defines the Wind River Systems, Inc. Registration hierarchy." - - -- Revision history - REVISION "201407100000Z" -- July 10, 2014 - DESCRIPTION "Initial Version of MIB." - - ::= { enterprises 731 } - --- WRS Common Enterprise MIB Modules - wrsCommon OBJECT IDENTIFIER ::= { wrs 1 } - wrsAlarms OBJECT IDENTIFIER ::= { wrsCommon 1 } -- Common WRS Enterprise Alarm MIB - --- WRS Products --- tms1_0 OBJECT IDENTIFIER ::= { wrs 1 } Obsolete - tms OBJECT IDENTIFIER ::= { wrs 2 } - wrsTs OBJECT IDENTIFIER ::= { wrs 3 } -- WRS Titanium Cloud specific Enterprise MIBs - - - - - - ---------------------------------------------------------------------------- --- TMS OID Definitions --- - --- TMS Major MIB Categories - idb OBJECT IDENTIFIER ::= { tms 1 } -- IDB MIBs - tmsGeneric OBJECT IDENTIFIER ::= { tms 2 } -- TMS Generic MIBs - oemSwapi OBJECT IDENTIFIER ::= { tms 3 } -- OEM swAPI MIBs - oemProd OBJECT IDENTIFIER ::= { tms 4 } -- OEM Product MIBs - --- TMS IDB Internal Module MIBs - rmonMib OBJECT IDENTIFIER ::= { idb 1 } --- garpMib OBJECT IDENTIFIER ::= { idb 2 } SMIv2 --- stpMib OBJECT IDENTIFIER ::= { idb 3 } SMIv2 - --- TMS Generic MIBs --- tmsCommonMib OBJECT IDENTIFIER ::= { tmsGeneric 1 } SMIv2 --- tmsL3Mib OBJECT IDENTIFIER ::= { tmsGeneric 2 } SMIv2 - --- OEM swAPI MIBs --- pmSwapi OBJECT IDENTIFIER ::= { oemSwapi 1 } SMIv2 --- bcmSwapi OBJECT IDENTIFIER ::= { oemSwapi 2 } SMIv2 --- pcSwapi OBJECT IDENTIFIER ::= { oemSwapi 3 } SMIv2 - --- OEM Product MIBs --- pm3575 OBJECT IDENTIFIER ::= { oemProd 1 } SMIv2 --- bcm5600 OBJECT IDENTIFIER ::= { oemProd 2 } SMIv2 --- pcSwitch OBJECT IDENTIFIER ::= { oemProd 3 } SMIv2 - - - ---------------------------------------------------------------------------- --- General Textual Conventions --- - -WrsUUID ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION "Universally Unique IDentifier; - format is typically XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX , - where X is a hex-digit." - SYNTAX OCTET STRING (SIZE (0..36)) - -WrsBoolean ::= TEXTUAL-CONVENTION - STATUS current - DESCRIPTION "Boolean type." - SYNTAX INTEGER - { - false (0), - true (1) - } - - --- --- END of WRS-ENTERPRISE-REG-MIB --- - -END