Gentoo Archives: gentoo-commits

From: Ian Stakenvicius <axs@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-analyzer/check_mk_agent/
Date: Wed, 01 Feb 2017 21:35:44
Message-Id: 1485984864.ddf3132d1f534e5a98484aceb4393f9f3478a1cc.axs@gentoo
1 commit: ddf3132d1f534e5a98484aceb4393f9f3478a1cc
2 Author: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 24 23:06:54 2017 +0000
4 Commit: Ian Stakenvicius <axs <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 1 21:34:24 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ddf3132d
7
8 net-analyzer/check_mk_agent: split agent from otherwise hard-to-update check_mk
9
10 Package-Manager: portage-2.3.0
11
12 net-analyzer/check_mk_agent/Manifest | 1 +
13 .../check_mk_agent/check_mk_agent-1.2.8_p16.ebuild | 95 ++++++++++++++++++++++
14 net-analyzer/check_mk_agent/metadata.xml | 25 ++++++
15 3 files changed, 121 insertions(+)
16
17 diff --git a/net-analyzer/check_mk_agent/Manifest b/net-analyzer/check_mk_agent/Manifest
18 new file mode 100644
19 index 00000000..ce6cf56
20 --- /dev/null
21 +++ b/net-analyzer/check_mk_agent/Manifest
22 @@ -0,0 +1 @@
23 +DIST check_mk-1.2.8p16.tar.gz 16298683 SHA256 b161d4e37b4313696c93b9272626bcc367c90f4be1798bd283c3b581795e1747 SHA512 601c76b2b62de9176122c69b011b5f7ac6b71650d1b3e411c103f5e9c3e91256ce8d3db6fcd1edc2a11f86dcba4e8ea18ec5a1f9f3eae5b25a4bb3ba712341eb WHIRLPOOL 7ef193c4e9087866ae635e198b2028abb1c245914dcf81240b6939c76a83ab5a4389de7d0e363239bbf12467cd276790d9c85553354ad10a7da1612054438fea
24
25 diff --git a/net-analyzer/check_mk_agent/check_mk_agent-1.2.8_p16.ebuild b/net-analyzer/check_mk_agent/check_mk_agent-1.2.8_p16.ebuild
26 new file mode 100644
27 index 00000000..d0c26c8
28 --- /dev/null
29 +++ b/net-analyzer/check_mk_agent/check_mk_agent-1.2.8_p16.ebuild
30 @@ -0,0 +1,95 @@
31 +# Copyright 1999-2017 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI=6
36 +
37 +inherit systemd
38 +
39 +DESCRIPTION="Agent to report data to Check_MK for monitoring"
40 +HOMEPAGE="http://mathias-kettner.de/check_mk.html"
41 +
42 +MY_PV="${PV/_p/p}"
43 +MY_P="check_mk-${MY_PV}"
44 +
45 +LICENSE="GPL-2"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~x86"
48 +IUSE="apache_status logwatch mysql nfsexports oracle postgres smart +xinetd zypper"
49 +
50 +RDEPEND="!!net-analyzer/check_mk
51 + app-shells/bash:*
52 + xinetd? ( || ( sys-apps/xinetd sys-apps/systemd ) )
53 + "
54 +DEPEND="${RDEPEND}"
55 +
56 +SRC_URI="http://mathias-kettner.de/download/${MY_P}.tar.gz"
57 +
58 +src_unpack() {
59 + # check_mk is a tarball containing tarballs
60 + unpack ${A}
61 + mkdir -p "${S}" || die
62 + cd "${S}" || die
63 + unpack "${WORKDIR}"/${MY_P}/agents.tar.gz
64 + mkdir -p "${S}"/doc || die
65 + cd "${S}"/doc || die
66 + unpack "${WORKDIR}"/${MY_P}/doc.tar.gz
67 +}
68 +
69 +src_prepare() {
70 + cat <<EOF >Makefile
71 +all: waitmax
72 +
73 +waitmax: waitmax.c
74 + \$(CC) \$(CFLAGS) \$< -o \$@ \$(LDFLAGS)
75 +
76 +EOF
77 +
78 + if [[ -f waitmax ]]; then
79 + rm waitmax || die "Couldn't delete precompiled waitmax file"
80 + fi
81 +
82 + default
83 +}
84 +
85 +src_compile() {
86 + # compile waitmax
87 + emake CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC="$(tc-getCC)"
88 +}
89 +
90 +src_install() {
91 + # Install agent related files
92 + newbin check_mk_agent.linux check_mk_agent
93 + dobin waitmax
94 +
95 + keepdir /usr/lib/check_mk_agent/local
96 + dodir /usr/lib/check_mk_agent/plugins
97 + dodir /etc/check_mk
98 +
99 + dodoc doc/{AUTHORS,COPYING,ChangeLog}
100 + docompress
101 +
102 + if use xinetd; then
103 + insinto /etc/xinetd.d
104 + newins cfg_examples/xinetd.conf check_mk
105 + systemd_dounit cfg_examples/systemd/check_mk{.socket,@.service}
106 + fi
107 +
108 + # Install the check_mk_agent logwatch plugin
109 + if use logwatch; then
110 + insinto /etc/check_mk
111 + doins cfg_examples/logwatch.cfg
112 + exeinto /usr/lib/check_mk_agent/plugins
113 + doexe plugins/mk_logwatch
114 + fi
115 +
116 + # Install any other useflag-enabled agent plugins
117 + exeinto /usr/lib/check_mk_agent/plugins
118 + use smart && doexe plugins/smart
119 + use mysql && doexe plugins/mk_mysql
120 + use postgres && doexe plugins/mk_postgres
121 + use apache_status && doexe plugins/apache_status
122 + use zypper && doexe plugins/mk_zypper
123 + use oracle && doexe plugins/mk_oracle
124 + use nfsexports && doexe plugins/nfsexports
125 +}
126
127 diff --git a/net-analyzer/check_mk_agent/metadata.xml b/net-analyzer/check_mk_agent/metadata.xml
128 new file mode 100644
129 index 00000000..8cdfbbe
130 --- /dev/null
131 +++ b/net-analyzer/check_mk_agent/metadata.xml
132 @@ -0,0 +1,25 @@
133 +<?xml version="1.0" encoding="UTF-8"?>
134 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
135 +<pkgmetadata>
136 + <maintainer type="person">
137 + <email>axs@g.o</email>
138 + <name>Ian Stakenvicius (_AxS_)</name>
139 + </maintainer>
140 + <longdescription lang="en">
141 + The agent, to gather and report system and other monitoring data to Check_MK enabled
142 + Nagios/Icigna centralized monitoring servers.
143 + </longdescription>
144 + <use>
145 + <flag name="logwatch">Install check_mk-agent logwatch plugin.</flag>
146 + <flag name="smart">Install check_mk-agent S.M.A.R.T plugin.</flag>
147 + <flag name="mysql">Install check_mk-agent mysql plugin.</flag>
148 + <flag name="postgres">Install check_mk-agent postgres plugin.</flag>
149 + <flag name="apache_status">Install check_mk-agent apache-status plugin.</flag>
150 + <flag name="nfsexports">Install check_mk-agent nfsexports plugin.</flag>
151 + <flag name="zypper">Install check_mk-agent zypper plugin.</flag>
152 + </use>
153 + <upstream>
154 + <changelog>http://mathias-kettner.com/check_mk_download.html</changelog>
155 + <doc>http://mathias-kettner.com/checkmk.html</doc>
156 + </upstream>
157 +</pkgmetadata>