diff options
Diffstat (limited to 'net-analyzer/mk-livestatus')
8 files changed, 0 insertions, 488 deletions
diff --git a/net-analyzer/mk-livestatus/Manifest b/net-analyzer/mk-livestatus/Manifest deleted file mode 100644 index 12603de1..00000000 --- a/net-analyzer/mk-livestatus/Manifest +++ /dev/null @@ -1,8 +0,0 @@ -AUX 1.2.2_p3-list-regex-match-001.patch 6668 SHA256 01cc808f2796ec6453a907e7cc40de43681d9e56c1dee5c5c69cec5b361e8eff WHIRLPOOL e17c77b52de58f2494c91834035649a9908b0e92fe6f854c6aa0b62b78cadf7ec9d52fcc4d57802ffcf484ba6df8853b9afeabe7c6f6c9ab1c26e21b6908afc8 -AUX 1.2.2_p3-list-regex-match-002.patch 1750 SHA256 1e4bf9693c74cd7c11f344c480c3ad62d38c8043368d9d8998fcb1943cf9c196 WHIRLPOOL 3b0e014ef12094021392413c56f09ab5942e7516eab7fa310f73484987f1ebd6f5271a29116a794c8f9e55f7dcfef4e48c79fdab741fd74ec6a83adfe0353bc2 -AUX 1.2.2_p3-list-regex-match-003.patch 1730 SHA256 e7ee7bd2a70ac6e5772d53b43073bc866cbdcea4c91c9350c4dd8921ff072395 WHIRLPOOL 2534aa06e5387b1464149ef27ba3549b62bfcf36a283839d0f032d1b179e49465b32ff0417a292d92e5b626e23311e99e8b2556b3159ee5bc30b37b6ae496e56 -AUX mk-livestatus-1.2.2_p3-no-strip.diff 902 SHA256 0adfdf8a0870f821c66232dc1172344d5422a09cbc759ceef9635a73c447d03a WHIRLPOOL 5da4987ca95a949ca084d513fabca2573cd7691c1986bab51a5747f89e6e3fa2d33d366f113f978fae1e662c7b4e2203cb25db3ae6fc7caec91b79e908f3e62a -AUX mk-livestatus-1.2.2_p3-test-RequireRcsKeywords.diff 549 SHA256 e329e81cd9ba4a1903ba5d72c80c01b338680aad5a05a140ab67ef64af4ecb61 WHIRLPOOL ffe12d03aec794e0ad06c45f5a8b70be604805f18923c0652954881512414de39301c00097b0e5b5e4699f071663e99722d4eeaae4b4c887f3bec2b25a91e03a -DIST mk-livestatus-1.2.2p3.tar.gz 382030 SHA256 edceb13675ed3375fd867216e2ffe31c350d5860509f9fb0abd182148e270616 WHIRLPOOL 7fe080bbfc2d04a037248a94a202137cdc0ca40689800e51c273bd83dfe4e5c2e5d54ca6ff525d6ffb5015ff6032b8cfe65739896a63adaf01a7d550f771d8e4 -EBUILD mk-livestatus-1.2.2_p3.ebuild 2595 SHA256 886182663cf5014199792a01f9f2b9780bb75c32a19d926dc2ba7e62d07b9655 WHIRLPOOL 54b203c59bd02ae7872cb48d863b9bcceb5979b29427f105e9fedd2e50fa5b4e27f37439b62cbbbc27ee917bb642e96c677fbd2c1b7ddf77be7f0ea58727fd74 -MISC metadata.xml 166 SHA256 2caff447f5bd2701d8456ada5cc633c41ef4373fa4bfeabeb73599d40bcc941b WHIRLPOOL 1ff70497eca6531f0e0614c72a19f4b8e5ff486a58d369f4f0b36308d1d6b01168f9da887740e3b9f536236be251d3fe05f904d27a9233a7cf613416ba882968 diff --git a/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-001.patch b/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-001.patch deleted file mode 100644 index d1eee9cc..00000000 --- a/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-001.patch +++ /dev/null @@ -1,198 +0,0 @@ -From 7278dd07b7ba923a5c768baaf39334c420e53fa0 Mon Sep 17 00:00:00 2001 -From: Benoit Dolez <bdolez@exosec.fr> -Date: Mon, 27 Jan 2014 10:31:05 +0100 -Subject: [PATCH 1/2] FEATURE: livestatus: Add regex matching of comment list - entries - ---- - livestatus/src/DownCommColumn.cc | 19 +++++++++++++++++++ - livestatus/src/DownCommColumn.h | 1 + - livestatus/src/ListColumn.cc | 8 ++++++++ - livestatus/src/ListColumn.h | 1 + - livestatus/src/ListColumnFilter.cc | 38 +++++++++++++++++++++++++++++++++----- - livestatus/src/ListColumnFilter.h | 6 ++++++ - 6 files changed, 68 insertions(+), 5 deletions(-) - -diff --git a/livestatus/src/DownCommColumn.cc b/livestatus/src/DownCommColumn.cc -index 96948ea..77033d3 100644 ---- a/livestatus/src/DownCommColumn.cc -+++ b/livestatus/src/DownCommColumn.cc -@@ -104,6 +104,25 @@ bool DownCommColumn::isNagiosMember(void *data, void *member) - ( dt->_service == (service *)data || (dt->_service == 0 && dt->_host == (host *)data)); - } - -+bool DownCommColumn::isNagiosMatch(void *data, void *member) -+{ -+ TableDownComm *table = _is_downtime ? g_table_downtimes : g_table_comments; -+ for (map<pair<unsigned long, bool>, DowntimeOrComment *>::iterator it = table->entriesIteratorBegin(); -+ it != table->entriesIteratorEnd(); -+ ++it) -+ { -+ DowntimeOrComment *dt = it->second; -+ if ((void *)dt->_service == data || -+ (dt->_service == 0 && dt->_host == data)) -+ { -+ logger(LG_INFO, "find for member (%s,%s): %s", dt->_host?dt->_host->name:"", dt->_service?dt->_service->description:"", dt->_comment); -+ if (regexec((regex_t*)member, dt->_comment, 0, 0, 0) == 0) -+ return true; -+ } -+ } -+ return false; -+} -+ - bool DownCommColumn::isEmpty(void *data) - { - if (!data) return true; -diff --git a/livestatus/src/DownCommColumn.h b/livestatus/src/DownCommColumn.h -index f4b0719..e4473a6 100644 ---- a/livestatus/src/DownCommColumn.h -+++ b/livestatus/src/DownCommColumn.h -@@ -46,6 +46,7 @@ public: - void *getNagiosObject(char *name); - bool isEmpty(void *data); - bool isNagiosMember(void *data, void *member); -+ bool isNagiosMatch(void *data, void *member); - }; - - -diff --git a/livestatus/src/ListColumn.cc b/livestatus/src/ListColumn.cc -index 87250b3..e9b38b8 100644 ---- a/livestatus/src/ListColumn.cc -+++ b/livestatus/src/ListColumn.cc -@@ -22,6 +22,7 @@ - // to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, - // Boston, MA 02110-1301 USA. - -+#include "logger.h" - #include "ListColumn.h" - #include "ListColumnFilter.h" - -@@ -30,3 +31,10 @@ Filter *ListColumn::createFilter(int opid, char *value) - { - return new ListColumnFilter(this, opid, value); - } -+ -+bool ListColumn::isNagiosMatch(void *data, void *member) -+{ -+ logger(LG_INFO, "Sorry, Operator ~~ for lists not implemented."); -+ return (false); -+} -+ -diff --git a/livestatus/src/ListColumn.h b/livestatus/src/ListColumn.h -index 3b7d449..bbf4979 100644 ---- a/livestatus/src/ListColumn.h -+++ b/livestatus/src/ListColumn.h -@@ -38,6 +38,7 @@ public: - virtual void *getNagiosObject(char *name) = 0; - virtual bool isNagiosMember(void *data, void *member) = 0; - virtual bool isEmpty(void *data) = 0; -+ virtual bool isNagiosMatch(void *data, void *member); - Filter *createFilter(int opid, char *value); - }; - -diff --git a/livestatus/src/ListColumnFilter.cc b/livestatus/src/ListColumnFilter.cc -index 4d2c51a..6dea8c7 100644 ---- a/livestatus/src/ListColumnFilter.cc -+++ b/livestatus/src/ListColumnFilter.cc -@@ -23,18 +23,45 @@ - // Boston, MA 02110-1301 USA. - - #include <stdlib.h> -+#include <strings.h> - #include <string.h> - #include "logger.h" - #include "opids.h" - #include "ListColumnFilter.h" - #include "ListColumn.h" -+#include "OutputBuffer.h" - - ListColumnFilter::ListColumnFilter(ListColumn *column, int opid, char *value) - : _column(column) - , _opid(opid) - , _empty_ref(!value[0]) -+ , _regex(0) - { -- _ref_member = _column->getNagiosObject(value); -+ if (_opid == OP_REGEX || _opid == OP_REGEX_ICASE) { -+ if (strchr(value, '{') || strchr(value, '}')) { -+ setError(RESPONSE_CODE_INVALID_HEADER, "disallowed regular expression '%s': must not contain { or }", value); -+ } -+ else { -+ _regex = new regex_t(); -+ if (0 != regcomp(_regex, value, REG_EXTENDED | REG_NOSUB | (_opid == OP_REGEX_ICASE ? REG_ICASE : 0))) -+ { -+ setError(RESPONSE_CODE_INVALID_HEADER, "invalid regular expression '%s'", value); -+ delete _regex; -+ _regex = 0; -+ } -+ } -+ } -+ else { -+ _ref_member = _column->getNagiosObject(value); -+ } -+} -+ -+ListColumnFilter::~ListColumnFilter() -+{ -+ if (_regex) { -+ regfree(_regex); -+ delete _regex; -+ } - } - - bool ListColumnFilter::accepts(void *data) -@@ -42,19 +69,20 @@ bool ListColumnFilter::accepts(void *data) - data = _column->shiftPointer(data); - if (!data) - return false; -- bool is_member = _column->isNagiosMember(data, _ref_member); - switch (_opid) { - case -OP_LESS: /* !< means >= means 'contains' */ -- return is_member; -+ return _column->isNagiosMember(data, _ref_member); - case OP_LESS: -- return !is_member; -+ return !_column->isNagiosMember(data, _ref_member); - case OP_EQUAL: - case -OP_EQUAL: - if (_empty_ref) - return _column->isEmpty(data) == (_opid == OP_EQUAL); - logger(LG_INFO, "Sorry, equality for lists implemented only for emptyness"); - return false; -- -+ case OP_REGEX: -+ case OP_REGEX_ICASE: -+ return _regex != 0 && _column->isNagiosMatch(data, _regex); - default: - logger(LG_INFO, "Sorry, Operator %s for lists not implemented.", op_names_plus_8[_opid]); - return true; -diff --git a/livestatus/src/ListColumnFilter.h b/livestatus/src/ListColumnFilter.h -index a0a7a87..dca656c 100644 ---- a/livestatus/src/ListColumnFilter.h -+++ b/livestatus/src/ListColumnFilter.h -@@ -27,6 +27,10 @@ - - #include "config.h" - -+#include <sys/types.h> -+#include <regex.h> -+#include <string> -+ - #include "Filter.h" - class ListColumn; - -@@ -36,9 +40,11 @@ class ListColumnFilter : public Filter - void *_ref_member; - int _opid; - bool _empty_ref; // distinct from unknown ref -+ regex_t *_regex; - - public: - ListColumnFilter(ListColumn *column, int opid, char *value); -+ ~ListColumnFilter(); - bool accepts(void *data); - void *indexFilter(const char *columnname); - }; --- -1.8.4.rc3 - diff --git a/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-002.patch b/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-002.patch deleted file mode 100644 index 4f4c11f6..00000000 --- a/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-002.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 2e25a6c3d91baf37f76804e03acbc6285edaf810 Mon Sep 17 00:00:00 2001 -From: Julien Thomas <jthomas@exosec.fr> -Date: Mon, 27 Jan 2014 10:34:25 +0100 -Subject: [PATCH 2/2] FEATURE: livestatus: Add regex matching of servicegroup - list entries - ---- - livestatus/src/ServicegroupsColumn.cc | 16 ++++++++++++++++ - livestatus/src/ServicegroupsColumn.h | 1 + - 2 files changed, 17 insertions(+) - -diff --git a/livestatus/src/ServicegroupsColumn.cc b/livestatus/src/ServicegroupsColumn.cc -index e782169..0529ad5 100644 ---- a/livestatus/src/ServicegroupsColumn.cc -+++ b/livestatus/src/ServicegroupsColumn.cc -@@ -72,6 +72,22 @@ bool ServicegroupsColumn::isNagiosMember(void *data, void *nagobject) - return false; - } - -+bool ServicegroupsColumn::isNagiosMatch(void *data, void *member) -+{ -+ // data is already shifted -+ objectlist *list = *(objectlist **)((char *)data + _offset); -+ servicegroup *sg; -+ -+ while (list) { -+ sg = (servicegroup *)list->object_ptr; -+ if (regexec((regex_t*)member, sg->group_name, 0, 0, 0) == 0) -+ return true; -+ list = list->next; -+ } -+ -+ return false; -+} -+ - bool ServicegroupsColumn::isEmpty(void *data) - { - objectlist *list = *(objectlist **)((char *)data + _offset); -diff --git a/livestatus/src/ServicegroupsColumn.h b/livestatus/src/ServicegroupsColumn.h -index 7c1de26..c022ab5 100644 ---- a/livestatus/src/ServicegroupsColumn.h -+++ b/livestatus/src/ServicegroupsColumn.h -@@ -41,6 +41,7 @@ public: - void *getNagiosObject(char *name); // return pointer to service group - bool isEmpty(void *data); - bool isNagiosMember(void *data, void *nagobject); -+ bool isNagiosMatch(void *data, void *member); - private: - objectlist *getData(void *); - }; --- -1.8.4.rc3 - diff --git a/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-003.patch b/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-003.patch deleted file mode 100644 index 89e00307..00000000 --- a/net-analyzer/mk-livestatus/files/1.2.2_p3-list-regex-match-003.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 364ce9301898dc20649d7adeacff0e7eba2a3bef Mon Sep 17 00:00:00 2001 -From: Julien Thomas <jthomas@exosec.fr> -Date: Mon, 3 Feb 2014 19:06:59 +0100 -Subject: [PATCH] FEATURE: mk-livestatus: Support regex match of hostgroup list - entries - ---- - livestatus/src/HostgroupsColumn.cc | 16 ++++++++++++++++ - livestatus/src/HostgroupsColumn.h | 1 + - 2 files changed, 17 insertions(+) - -diff --git a/livestatus/src/HostgroupsColumn.cc b/livestatus/src/HostgroupsColumn.cc -index 59efe62..9cfbcb2 100644 ---- a/livestatus/src/HostgroupsColumn.cc -+++ b/livestatus/src/HostgroupsColumn.cc -@@ -77,6 +77,22 @@ bool HostgroupsColumn::isNagiosMember(void *data, void *nagobject) - return false; - } - -+bool HostgroupsColumn::isNagiosMatch(void *data, void *member) -+{ -+ // data is already shifted -+ objectlist *list = *(objectlist **)((char *)data + _offset); -+ hostgroup *hg; -+ -+ while (list) { -+ hg = (hostgroup *)list->object_ptr; -+ if (regexec((regex_t *)member, hg->group_name, 0, 0, 0) == 0) -+ return true; -+ list = list->next; -+ } -+ -+ return false; -+} -+ - bool HostgroupsColumn::isEmpty(void *data) - { - objectlist *list = *(objectlist **)((char *)data + _offset); -diff --git a/livestatus/src/HostgroupsColumn.h b/livestatus/src/HostgroupsColumn.h -index 60b22d4..7112cd9 100644 ---- a/livestatus/src/HostgroupsColumn.h -+++ b/livestatus/src/HostgroupsColumn.h -@@ -40,6 +40,7 @@ public: - void output(void *, Query *); - void *getNagiosObject(char *name); // return pointer to host group - bool isNagiosMember(void *data, void *nagobject); -+ bool isNagiosMatch(void *data, void *member); - bool isEmpty(void *data); - private: - objectlist *getData(void *); --- -1.8.4.rc3 - diff --git a/net-analyzer/mk-livestatus/files/mk-livestatus-1.2.2_p3-no-strip.diff b/net-analyzer/mk-livestatus/files/mk-livestatus-1.2.2_p3-no-strip.diff deleted file mode 100644 index a3f81a50..00000000 --- a/net-analyzer/mk-livestatus/files/mk-livestatus-1.2.2_p3-no-strip.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- src/Makefile.am 2013-08-20 14:24:46.000000000 +0200 -+++ src/Makefile.am 2013-08-20 14:25:20.000000000 +0200 -@@ -54,9 +54,9 @@ - - livecheck$(EXEEXT): livecheck.c strutil.c check_icmp.c - if HAVE_DIET -- diet -v $(CC) -Wno-deprecated-declarations $(CFLAGS) $(LDFLAGS) -I.. -s -o $@ $^ -+ diet -v $(CC) -Wno-deprecated-declarations $(CFLAGS) $(LDFLAGS) -I.. -o $@ $^ - else -- $(CC) -x c -Wno-deprecated-declarations $(CFLAGS) $(LDFLAGS) -I.. -s -o $@ $^ -+ $(CC) -x c -Wno-deprecated-declarations $(CFLAGS) $(LDFLAGS) -I.. -o $@ $^ - endif - - livestatus_so_CXXFLAGS = -I$(top_srcdir)/nagios -fPIC -@@ -64,7 +64,7 @@ - - livestatus.o: $(livestatus_so_OBJECTS) $(livestatus_so_DEPENDENCIES) - -rm -f plugin.so -- $(CXX) $(LDFLAGS) -s -fPIC -shared $(livestatus_so_OBJECTS) -o $@ -lpthread -lstdc++ -+ $(CXX) $(LDFLAGS) -fPIC -shared $(livestatus_so_OBJECTS) -o $@ -lpthread -lstdc++ - - all-local: livestatus.o - diff --git a/net-analyzer/mk-livestatus/files/mk-livestatus-1.2.2_p3-test-RequireRcsKeywords.diff b/net-analyzer/mk-livestatus/files/mk-livestatus-1.2.2_p3-test-RequireRcsKeywords.diff deleted file mode 100644 index 95b2830f..00000000 --- a/net-analyzer/mk-livestatus/files/mk-livestatus-1.2.2_p3-test-RequireRcsKeywords.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- ./api/perl/t/perlcriticrc 2013-08-21 22:37:57.791099241 +0200 -+++ ./api/perl/t/perlcriticrc 2013-08-21 22:38:02.943210061 +0200 -@@ -133,8 +133,6 @@ severity = 3 - [Perl::Critic::Policy::Miscellanea::ProhibitTies] - severity = 4 - --[-Perl::Critic::Policy::Miscellanea::RequireRcsKeywords] -- - [Perl::Critic::Policy::Modules::ProhibitAutomaticExportation] - severity = 4 - -@@ -283,4 +281,4 @@ severity = 5 - severity = 5 - - [Perl::Critic::Policy::Variables::RequireNegativeIndices] --severity = 4 -\ No newline at end of file -+severity = 4 diff --git a/net-analyzer/mk-livestatus/metadata.xml b/net-analyzer/mk-livestatus/metadata.xml deleted file mode 100644 index 6f49eba8..00000000 --- a/net-analyzer/mk-livestatus/metadata.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> -<pkgmetadata> -<!-- maintainer-needed --> -</pkgmetadata> diff --git a/net-analyzer/mk-livestatus/mk-livestatus-1.2.2_p3.ebuild b/net-analyzer/mk-livestatus/mk-livestatus-1.2.2_p3.ebuild deleted file mode 100644 index 30c11cb6..00000000 --- a/net-analyzer/mk-livestatus/mk-livestatus-1.2.2_p3.ebuild +++ /dev/null @@ -1,130 +0,0 @@ -# Copyright 1999-2016 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -EAPI=5 - -GENTOO_DEPEND_ON_PERL=no -PERL_EXPORT_PHASE_FUNCTIONS=no -PYTHON_COMPAT=( python2_7 ) - -inherit autotools perl-module python-r1 eutils - -MY_PV="${PV/_p/p}" -MY_P="${PN}-${MY_PV}" - -DESCRIPTION="Nagios/Icinga event broker that allows quick/direct access to your status data" -HOMEPAGE="http://mathias-kettner.de/checkmk_livestatus.html" -SRC_URI="http://mathias-kettner.de/download/${MY_P}.tar.gz" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~amd64 ~ppc ~x86" -IUSE="examples perl python test" - -RDEPEND="perl? ( - dev-lang/perl:0 - virtual/perl-Digest-MD5:0 - virtual/perl-Scalar-List-Utils:0 - >=virtual/perl-Thread-Queue-2.11:0 - virtual/perl-Encode:0 - dev-perl/JSON-XS:0 - )" -DEPEND="${RDEPEND} - perl? ( - dev-perl/Module-Install:0 - virtual/perl-ExtUtils-MakeMaker:0 - virtual/perl-File-Path:0 - virtual/perl-File-Spec:0 - virtual/perl-File-Temp:0 - test? ( - dev-perl/File-Copy-Recursive:0 - dev-perl/Test-Pod:0 - dev-perl/Test-Perl-Critic:0 - dev-perl/Test-Pod-Coverage:0 - dev-perl/Perl-Critic:0 - dev-perl/Perl-Critic-Policy-Dynamic-NoIndirect:0 - dev-perl/Perl-Critic-Deprecated:0 - dev-perl/Perl-Critic-Nits:0 - ) - )" - -# For perl test -SRC_TEST="parallel" - -S="${WORKDIR}/${MY_P}" - -src_prepare() { - # Use system Module::Install instead, it will be copied to $S by - # Module::install itself. - rm -rf api/perl/inc - - if use perl; then - perl-module_src_prepare - fi - - epatch "${FILESDIR}/${P}-no-strip.diff" - epatch "${FILESDIR}/${P}-test-RequireRcsKeywords.diff" - - epatch "${FILESDIR}/${PV}-list-regex-match-001.patch" - epatch "${FILESDIR}/${PV}-list-regex-match-002.patch" - epatch "${FILESDIR}/${PV}-list-regex-match-003.patch" - - # Script too old - rm -f missing - - eautoreconf -} - -src_configure() { - econf - - if use perl; then - cd api/perl/ - perl-module_src_configure - fi -} - -src_compile() { - emake - - if use perl; then - cd api/perl - perl-module_src_compile - fi -} - -src_test() { - if use perl; then - cd api/perl - - export TEST_AUTHOR="Test Author" - perl-module_src_test - fi -} - -src_install() { - emake -C src/ DESTDIR="${ED}" install-binPROGRAMS install-data-local - - if use perl; then - cd api/perl - perl-module_src_install - cd "${S}" - - if use examples; then - docinto examples/ - dodoc api/perl/examples/dump.pl - fi - fi - - if use python; then - python_foreach_impl python_domodule api/python/livestatus.py - - if use examples; then - newdoc api/python/README README.python - - docinto examples/ - dodoc api/python/{example,example_multisite,make_nagvis_map}.py - fi - fi -} |