summaryrefslogtreecommitdiff
path: root/net-analyzer
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-07-10 03:04:33 -0500
committerroot <root@alpha.trunkmasters.com>2026-07-10 03:04:33 -0500
commited2e0f29bf24219e96271574d9c99c971dff3698 (patch)
treeaa4cdcbf1a9384d5495104e034018b2d6fadcaac /net-analyzer
parenta96a971c845e2cd3ffad3b8f63558c6408897f0a (diff)
downloadbaldeagleos-repo-ed2e0f29bf24219e96271574d9c99c971dff3698.tar.gz
baldeagleos-repo-ed2e0f29bf24219e96271574d9c99c971dff3698.tar.xz
baldeagleos-repo-ed2e0f29bf24219e96271574d9c99c971dff3698.zip
Adding metadata
Diffstat (limited to 'net-analyzer')
-rw-r--r--net-analyzer/nagios-check_multiple/files/github-pr-2.patch172
-rw-r--r--net-analyzer/nagios-check_multiple/nagios-check_multiple-0.0.1-r5.ebuild48
2 files changed, 220 insertions, 0 deletions
diff --git a/net-analyzer/nagios-check_multiple/files/github-pr-2.patch b/net-analyzer/nagios-check_multiple/files/github-pr-2.patch
new file mode 100644
index 000000000000..ebf2b6a5ad1a
--- /dev/null
+++ b/net-analyzer/nagios-check_multiple/files/github-pr-2.patch
@@ -0,0 +1,172 @@
+Most of https://github.com/clarkbox/check_multiple/pull/2, without the
+version bump or changed to README.md. Waited as long as I could, but
+we need this for python-3.14.
+
+diff --git a/bin/check_multiple b/bin/check_multiple
+deleted file mode 100755
+index e43a800..0000000
+--- a/bin/check_multiple
++++ /dev/null
+@@ -1,30 +0,0 @@
+-#!/usr/bin/python3
+-import argparse
+-import sys
+-
+-from check_multiple.check_multiple import (MODE_BEST,
+- MODE_WORST,
+- process_results,
+- run_commands)
+-
+-
+-parser = argparse.ArgumentParser(
+- description='Run multiple Nagios checks and combine the results.')
+-parser.add_argument(
+- "--mode",
+- default='worst',
+- choices=['worst', 'best'],
+- help="which individual check result should be the overall result; "
+- "either the \"worst\" one or the \"best\" one (default: worst)")
+-parser.add_argument(
+- "command",
+- nargs="+",
+- help="check to run, enclosed in quotes")
+-
+-args = parser.parse_args()
+-mode = MODE_WORST
+-if args.mode == "best":
+- mode = MODE_BEST
+-exitcode,output = process_results(run_commands(args.command), mode)
+-print(output)
+-sys.exit(exitcode)
+diff --git a/lib/check_multiple/__main__.py b/lib/check_multiple/__main__.py
+new file mode 100644
+index 0000000..f2ae908
+--- /dev/null
++++ b/lib/check_multiple/__main__.py
+@@ -0,0 +1,40 @@
++import sys
++
++def main():
++ import argparse
++
++ from check_multiple.check_multiple import (
++ MODE_BEST,
++ MODE_WORST,
++ process_results,
++ run_commands
++ )
++
++
++ parser = argparse.ArgumentParser(
++ description='Run multiple Nagios checks and combine the results.'
++ )
++ parser.add_argument(
++ "--mode",
++ default='worst',
++ choices=['worst', 'best'],
++ help="which individual check result should be the overall result; "
++ "either the \"worst\" one or the \"best\" one (default: worst)"
++ )
++ parser.add_argument(
++ "command",
++ nargs="+",
++ help="check to run, enclosed in quotes"
++ )
++
++ args = parser.parse_args()
++ mode = MODE_WORST
++ if args.mode == "best":
++ mode = MODE_BEST
++ exitcode,output = process_results(run_commands(args.command), mode)
++ print(output)
++ return exitcode
++
++
++if __name__ == '__main__':
++ sys.exit(main())
+diff --git a/lib/check_multiple/check_multiple.py b/lib/check_multiple/check_multiple.py
+index 7670690..e27401e 100644
+--- a/lib/check_multiple/check_multiple.py
++++ b/lib/check_multiple/check_multiple.py
+@@ -55,15 +55,7 @@ def run_command(c):
+
+ Returns a single CompletedProcess instance.
+ """
+- # The "capture_output=True" keyword argument that we would like to
+- # pass to run() doesn't exist before python-3.7. Likewise, the
+- # "universal_newlines" argument has been renamed to "text", but
+- # only in python 3.7.
+- return subprocess.run(c,
+- shell=True,
+- stdout=subprocess.PIPE,
+- stderr=subprocess.PIPE,
+- universal_newlines=True)
++ return subprocess.run(c, shell=True, capture_output=True, text=True)
+
+
+ def run_commands(command_list):
+diff --git a/pyproject.toml b/pyproject.toml
+new file mode 100644
+index 0000000..a6d4d0b
+--- /dev/null
++++ b/pyproject.toml
+@@ -0,0 +1,30 @@
++[build-system]
++requires = ["setuptools >= 61.0"]
++build-backend = "setuptools.build_meta"
++
++[project]
++name = "nagios-check_multiple"
++version = "0.0.1"
++description = "Run multiple Nagios checks and combine the results"
++requires-python = ">=3.9"
++license = "MIT"
++classifiers = [
++ 'Environment :: Console',
++ 'Intended Audience :: System Administrators'
++]
++
++[project.readme]
++content-type = "text/markdown"
++file = "README.md"
++
++[project.scripts]
++check_multiple = "check_multiple.__main__:main"
++
++[project.urls]
++Homepage = "https://github.com/clarkbox/check_multiple"
++Documentation = "https://github.com/clarkbox/check_multiple/blob/master/README.md"
++Repository = "https://github.com/clarkbox/check_multiple.git"
++Issues = "https://github.com/clarkbox/check_multiple/issues"
++
++[tool.setuptools.packages.find]
++where = ["lib"]
+diff --git a/setup.py b/setup.py
+deleted file mode 100644
+index 8034e65..0000000
+--- a/setup.py
++++ /dev/null
+@@ -1,23 +0,0 @@
+-from distutils.core import setup
+-
+-setup(
+- name = 'nagios-check_multiple',
+- version = '0.0.1',
+- maintainer = 'Clark A',
+- maintainer_email = 'clarka@gmail.com',
+- url = 'https://github.com/clarkbox/check_multiple',
+- scripts = ['bin/check_multiple'],
+- packages = ['check_multiple'],
+- package_dir = {'check_multiple': 'lib/check_multiple'},
+- description = 'Run multiple Nagios checks and combine the results',
+- long_description=open('README.md').read(),
+- classifiers = [
+- 'Programming Language :: Python :: 3.5',
+- 'Programming Language :: Python :: 3.6',
+- 'Programming Language :: Python :: 3.7',
+- 'Programming Language :: Python :: 3.8',
+- 'Environment :: Console',
+- 'Intended Audience :: System Administrators',
+- 'License :: OSI Approved :: MIT License',
+- ]
+-)
diff --git a/net-analyzer/nagios-check_multiple/nagios-check_multiple-0.0.1-r5.ebuild b/net-analyzer/nagios-check_multiple/nagios-check_multiple-0.0.1-r5.ebuild
new file mode 100644
index 000000000000..87859255dc97
--- /dev/null
+++ b/net-analyzer/nagios-check_multiple/nagios-check_multiple-0.0.1-r5.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{13..14} )
+DISTUTILS_USE_PEP517=setuptools
+inherit distutils-r1
+
+MY_PN="check_multiple"
+DESCRIPTION="A Nagios plugin to execute multiple checks in parallel"
+HOMEPAGE="https://github.com/clarkbox/check_multiple"
+SRC_URI="https://github.com/clarkbox/check_multiple/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+S="${WORKDIR}/${MY_PN}-${PV}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~riscv"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+PATCHES=( "${FILESDIR}/github-pr-2.patch" )
+
+src_install() {
+ distutils-r1_src_install
+
+ local nagiosplugindir="/usr/$(get_libdir)/nagios/plugins"
+ dodir "${nagiosplugindir}"
+
+ # Create a symlink from the nagios plugin directory to the /usr/bin
+ # location. The "binary" in /usr/bin should also be a symlink, since
+ # the python machinery allows the user to switch out the
+ # interpreter. We don't want to mess with any of that, so we just
+ # point to whatever the system would use if the user executed
+ # ${MY_PN}.
+ #
+ # The relative symlink is preferred so that if the package is
+ # installed e.g. while in a chroot, the symlink will never point
+ # outside of that chroot.
+ #
+ dosym "../../../bin/${MY_PN}" "${nagiosplugindir}/${MY_PN}"
+}
+
+python_test() {
+ "${EPYTHON}" -m unittest -v lib/check_multiple/check_multiple.py \
+ || die "test suite failed"
+}