first ebuilds

This commit is contained in:
Jörg Deckert 2020-05-30 20:07:13 +02:00
parent 0d71d581c5
commit 991533fa16
21 changed files with 645 additions and 1 deletions

View File

@ -1,4 +1,20 @@
## unitas-zabbix ## Gentoo Overlay unitas-zabbix
Gentoo repository for Zabbix Gentoo repository for Zabbix
Das ist ein Gentoo Portage Overlay der Unitas Network GmbH.
Dieses enthält überwiegend Ebuilds für unsere interne Nutzung,
es wird keinerlei Garantie für die Fehlerfreiheit übernommen.
Nutzung
-------
Die Installation erfolgt z.B. mittels:
```
# emerge -av layman
# cd /etc/layman/overlays
# wget https://dev.unitas-network.de/raw/Gentoo/unitas-zabbix.git/master/unitas-zabbix-overlay.xml
# layman -L
# layman -a unitas-zabbix
```

1
metadata/layout.conf Normal file
View File

@ -0,0 +1 @@
masters = gentoo

View File

@ -0,0 +1,2 @@
DIST l2dm-lldp-1.4.el7.x86_64.tar.gz 340041 BLAKE2B 7532a57e2cc52b63764a5e8c41052d15906be044f17b55416643338d67a033d71ddcb257760d19ecdcbafe9856f76b508540258c5705928e5bcba46153d8d73e SHA512 4cd312c6e321659bf801467b4ce1389f7138c70bb2ea39fdb8b23cf79691c506eae0b83845f1a2207b97ef57a83ddbd212a844296b712ac7a9fd6b0efc80baae
EBUILD l2dm-lldp-1.4.ebuild 933 BLAKE2B 1ca870f0bccb723e8420c64664ae229e9b4a6267f44060a10f7d15f03299722c1988ac8d7e440bca84acf740857044e0757ad2cdb531d240d97f48192ce7c107 SHA512 f8db8314a538991185af7d6875183475ddd6c8b7c6cf772983c02bfb5f54992c2be854710cc89a8ab08b8a2f0c88fe374515d0c2e49fe531c2c2c9698c71c840

View File

@ -0,0 +1,43 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
DESCRIPTION=""
HOMEPAGE="https://share.zabbix.com/network_devices/l2-discovery-module-for-lldp"
SRC_URI="https://share.zabbix.com/index.php?option=com_mtree&task=att_download&link_id=1359&cf_id=45 -> l2dm-lldp-1.4.el7.x86_64.tar.gz"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="amd64 x86"
COMMON_DEPEND="
net-analyzer/zabbix
"
DEPEND="
app-portage/gentoolkit
${COMMON_DEPEND}
"
RDEPEND="
${COMMON_DEPEND}
"
S=${WORKDIR}/${P}.el7.x86_64
src_compile() {
cd source/modules
sed 's#^INCLUDES.*$#INCLUDES = -I/usr/include/zabbix/#' Malefile > Makefile
emake
}
src_install() {
exeinto /usr/$(get_libdir)/zabbix
doexe source/modules/lldp_get.so
insinto /usr/share/snmp/mibs
doins mibs/lldp-mibs/*
docompress -x /usr/share/doc/${PF}/{templates,value_mapping}
dodoc -r data/zabbix3.0/*
dodoc ChangeLog INSTALL README
}

View File

@ -0,0 +1,15 @@
AUX zabbix-3.0.30-security-disable-PidFile.patch 1378 BLAKE2B c1efdfd0b223987c9d9bf1a3f7731f0bdfeb42d1641bbf4387d70ece757f5cb2fb88bafb87f6938a5efbec091f73d5fde0450e8aa0edc3143d589df5efbe5d19 SHA512 854b198b980e4b58dc6149e285bfa6361ab2a10b83a6d8f07b46754316d6764669e68da8018b402b59317ed95b50a13d25f68f28c4c33d76f0ef1e8dedc8da99
AUX zabbix-4.0.18-modulepathfix.patch 330 BLAKE2B 99b3f1082e220ff842e4c4c86e8fcf57666443dd1e124412f167548ab886352077e1f0548e49cf77f28a51d20cc37dc980448eb87c9e7814ac73dcbfe43388e0 SHA512 75330dddde2f47553ac6a6f71d6f2383ab34c0d64ac5dbe45dd31707d8797d1400215d698072df3a0f0eaf862f00509791a6a0eaa43a0f686657d885c03465b5
AUX zabbix-agentd.init 507 BLAKE2B 6d5f0e631639e766d6857304d205acbdf4d07b59deb43be2735d8caf1b3d9d156dfc3c54236b435383d0182869b8f5eb6cb45499a6dac010f5ea497f4533f80b SHA512 7dbdb94dee4bef1c5771ea02169b7f4d0a21e9d2c4ce44db1376562309e1a24455beb16e65a4bb049a1e713cb51bf38ed39ba48da5cf3c8969b6860bcbe74fc5
AUX zabbix-agentd.service 277 BLAKE2B 9665032fdbc73e044ce1e897b205358209777440826b899db020ca34e659cf2f0f54696367b939fa544509bad2558e74af734cf7fdf8535458bb523b839799e3 SHA512 fd973db67986a1fcebf170dd108c6d4d21e2cdbf79ac624a202039ffe13b6ecf22f5ba774c3052b3b0282a4b485fef8998671ffbffd3c77d117878c98c8e45c0
AUX zabbix-agentd.tmpfiles 35 BLAKE2B 98e917ef03bd6dc5d73e5cbdb140c7e115c7593d5cebf2df9bf3d15713b16c6a44b165a3f68fd36a9119163144a2761457d16ce318bd094ed76ae6040c8b09df SHA512 3c63a2791e6ac77cb3144eb47a275cc8748f5c8943a076052300d6964994b95b18d60f504584fdcb683739dc514261402895e3f30ae2fbdb218acbc42c3d72df
AUX zabbix-jmx-proxy.conf 432 BLAKE2B 188737819d39b9e8ec8913237ff048a68ef19f2ec8849bab6c62bea612ac927d00a6c7042ba87261297ff580ef9976618d6acbd24c7fda8f6eb26b2b3dc891bb SHA512 0d68b9681528256131e35b5115053242f8558f5ad06254e61a16ab14f6530048551f0b777fa81d4afe07cc6282c31a6204fd0ee2e56e0e792ed3252222212250
AUX zabbix-jmx-proxy.init 849 BLAKE2B 14a312911a11d765210f3bd86d38c8ce3a2f230c821a03d2dd3b2a2aaf05a86cf64a59ea283ad0f11b62fe17a81936cef03463e5cee6535f1a51558b7bad790a SHA512 79a1966405546899b2e6eb4cb53f0ea1ec70575cbf97ff0f9de16d662c5750f8bf276bf8eadaf00cb69ffa078b79e9144eb9824eec6a23df6b2cd315b79b05d8
AUX zabbix-proxy.init 487 BLAKE2B b094521d1ec12ea27f1dec78a858ff3b78acde6a0473a2f8a53cbf46c75c3b0f72a1f44f24dc5294b7157576b06abc631dfed469dcf1a1c7b8c4609a9c81b2b8 SHA512 55f1df96d7d7e6ec16d16162e37a7a494131f4dd53d5988b28663b82a6bbe17b16e901a8f4870f14fd2e1c7dd96a84fe6aa5cd9e6a745462af7b83b3f0455839
AUX zabbix-proxy.service 275 BLAKE2B 19b594aa010bea3320de1d90277881b0c42ae1ea7f787bd4a456d8960401b0dd0ea4bde21b683e27c84123fefd681fe4f64b81dd9771273b4b6199f4af17d045 SHA512 2522b68c725e80b98655b9ff8cfc97b51add9f095e77422a275b3a30cb34d58e107ee03fdcc293b4ef37c60bd5d9ca2271aef48b727c91da44d507a888578c18
AUX zabbix-proxy.tmpfiles 35 BLAKE2B 98e917ef03bd6dc5d73e5cbdb140c7e115c7593d5cebf2df9bf3d15713b16c6a44b165a3f68fd36a9119163144a2761457d16ce318bd094ed76ae6040c8b09df SHA512 3c63a2791e6ac77cb3144eb47a275cc8748f5c8943a076052300d6964994b95b18d60f504584fdcb683739dc514261402895e3f30ae2fbdb218acbc42c3d72df
AUX zabbix-server.init 494 BLAKE2B e58063bfdb0bcb6ea70325d31bff4ffebab2686b7063916619aaabc5b39b1ff5d960b968e382615f84b18531465cf0ad0eab5ffa171c0b4b1797e70d58ed3450 SHA512 7dd55ffe8062bee9104218bf673aeeeea56a4a332ef6a5676b83e7f026a2b6ebc70446c63d6116b684ad16abd95de355cdbdf07c81a51daf1424b3fd8d627c74
AUX zabbix-server.service 429 BLAKE2B 1727ad52441b8e1ef31ee0f7faaa9d9964ee4ca5e2ef61de4715c25b0e0c97a627e6735a67c4114484950f0334fffa344d94f9192ada63887a21b617122eaf0d SHA512 d20fa4aa3a545d2f36388d7cac78c70c5610f5e7529348447e6fa6bacc33f42dd6e1c37c50b1c2711900a3f29bbbbb0ebc7c54f04d3de717aadad48e18c46e28
AUX zabbix-server.tmpfiles 35 BLAKE2B 98e917ef03bd6dc5d73e5cbdb140c7e115c7593d5cebf2df9bf3d15713b16c6a44b165a3f68fd36a9119163144a2761457d16ce318bd094ed76ae6040c8b09df SHA512 3c63a2791e6ac77cb3144eb47a275cc8748f5c8943a076052300d6964994b95b18d60f504584fdcb683739dc514261402895e3f30ae2fbdb218acbc42c3d72df
DIST zabbix-5.0.0.tar.gz 18519888 BLAKE2B 028fc41d4ce250c558130a631aaf385b0a944885a820f63aa3052738f767092ce71dfd65e52750dd61276b6171caa739eee5a5dea0002828a12035cc51a6f2d7 SHA512 056aee99d19def2f673813e29bb7869fa7906abe6956fddbeac359195167abe06add21ef08baf68a5ad6e256323a797e604cdd7828f34be2762daf7b31923984
EBUILD zabbix-5.0.0.ebuild 9151 BLAKE2B ac3106772df6b2dff15dbeeac3ff9e21bf6bbefafe8776374e086672f68f87b67fc1f78c6cf0712714792fa9df0650d5cfbc21b9defc1c99ae6ed24e1cbeeae4 SHA512 2511d9f06ef42767a40c0106dc9a110a0b991cd220acf018f105e99cd07ad30a75c9b56c4426ffbf5030c091c36a3782100f8afea8853a80d41f35ab36845530

View File

@ -0,0 +1,49 @@
diff --git a/conf/zabbix_agentd.conf b/conf/zabbix_agentd.conf
index b73bd45..c10daca 100644
--- a/conf/zabbix_agentd.conf
+++ b/conf/zabbix_agentd.conf
@@ -5,6 +5,7 @@
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/conf/zabbix_proxy.conf b/conf/zabbix_proxy.conf
index 082f14e..de0284d 100644
--- a/conf/zabbix_proxy.conf
+++ b/conf/zabbix_proxy.conf
@@ -109,6 +109,7 @@ LogFile=/tmp/zabbix_proxy.log
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/conf/zabbix_server.conf b/conf/zabbix_server.conf
index 9f754ca..3999196 100644
--- a/conf/zabbix_server.conf
+++ b/conf/zabbix_server.conf
@@ -62,6 +62,7 @@ LogFile=/tmp/zabbix_server.log
### Option: PidFile
# Name of PID file.
+# THIS PARAMETER IS IGNORED IN GENTOO FOR SECURITY REASONS (https://bugs.gentoo.org/629884)
#
# Mandatory: no
# Default:
diff --git a/src/libs/zbxnix/pid.c b/src/libs/zbxnix/pid.c
index baa8415..04c7e0c 100644
--- a/src/libs/zbxnix/pid.c
+++ b/src/libs/zbxnix/pid.c
@@ -26,6 +26,8 @@ static int fdpid = -1;
int create_pid_file(const char *pidfile)
{
+ return SUCCEED;
+
int fd;
zbx_stat_t buf;
struct flock fl;

View File

@ -0,0 +1,11 @@
--- zabbix-4.0.1/configure 2018-10-29 10:36:05.000000000 -0700
+++ zfx/configure 2018-11-07 16:59:28.015968345 -0800
@@ -12510,7 +12510,7 @@
CURL_SSL_CERT_LOCATION="${datadir}/zabbix/ssl/certs"
CURL_SSL_KEY_LOCATION="${datadir}/zabbix/ssl/keys"
-LOAD_MODULE_PATH="${libdir}/modules"
+LOAD_MODULE_PATH="${libdir}/zabbix"

View File

@ -0,0 +1,20 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/zabbix_agentd"
command_args="--foreground --config /etc/zabbix/zabbix_agentd.conf"
command_background="true"
command_user="zabbix:zabbix"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
provide zabbix-agent
use zabbix-server
}
start_pre() {
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
}

View File

@ -0,0 +1,12 @@
[Unit]
Description=Zabbix agent
Documentation=https://zabbix.com/manuals
After=network.target network-online.target
[Service]
User=zabbix
Group=zabbix
ExecStart=/usr/sbin/zabbix_agentd --foreground --config /etc/zabbix/zabbix_agentd.conf
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /run/zabbix 0755 zabbix zabbix -

View File

@ -0,0 +1,12 @@
# Configuration variables for the zabbix jmx proxy
# LISTEN_IP="0.0.0.0"
# LISTEN_PORT=10052
# START_POLLERS=5
# TIMEOUT=3
# uncomment to enable remote monitoring of the standard JMX objects on the Zabbix Java Gateway itself
# JAVA_OPTIONS="$JAVA_OPTIONS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=12345
# -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"

View File

@ -0,0 +1,33 @@
#!/sbin/openrc-run
LISTEN_IP=${LISTEN_IP:-127.0.0.1}
LISTEN_PORT=${LISTEN_PORT:-10052}
START_POLLERS=${START_POLLERS:-5}
TIMEOUT=${TIMEOUT:-3}
PID_FILE="/run/zabbix-jmx-proxy"
start() {
ZABBIX_OPTIONS="-Dzabbix.pidFile=$PID_FILE \
-Dzabbix.listenIP=$LISTEN_IP \
-Dzabbix.listenPort=$LISTEN_PORT \
-Dzabbix.startPollers=$START_POLLERS \
-Dzabbix.timeout=$TIMEOUT \
-Dsun.rmi.transport.tcp.responseTimeout=${TIMEOUT}000"
JAVA_OPTIONS="-server $JAVA_OPTIONS -Dlogback.configurationFile=logback-console.xml"
cd /opt/zabbix_java
CLASSPATH="lib"
for jar in lib/*.jar bin/*.jar; do
CLASSPATH="$CLASSPATH:$jar"
done
start-stop-daemon -m --background --pidfile $PID_FILE -- java $JAVA_OPTIONS -classpath $CLASSPATH $ZABBIX_OPTIONS com.zabbix.gateway.JavaGateway
}
stop() {
start-stop-daemon --stop --pidfile $PID_FILE
}

View File

@ -0,0 +1,20 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/zabbix_proxy"
command_args="--foreground --config /etc/zabbix/zabbix_proxy.conf"
command_background="true"
command_user="zabbix:zabbix"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
provide zabbix-proxy
}
start_pre() {
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
}

View File

@ -0,0 +1,12 @@
[Unit]
Description=Zabbix proxy
Documentation=https://zabbix.com/manuals
After=network.target network-online.target
[Service]
User=zabbix
Group=zabbix
ExecStart=/usr/sbin/zabbix_proxy --foreground --config /etc/zabbix/zabbix_proxy.conf
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /run/zabbix 0755 zabbix zabbix -

View File

@ -0,0 +1,19 @@
#!/sbin/openrc-run
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
command="/usr/sbin/zabbix_server"
command_args="--foreground --config /etc/zabbix/zabbix_server.conf"
command_background="true"
command_user="zabbix:zabbix"
pidfile="/run/${RC_SVCNAME}.pid"
depend() {
need net
use mysql postgresql
}
start_pre() {
checkpath -q -d -m 0750 -o root:zabbix /etc/zabbix
checkpath -q -f -m 0640 -o root:zabbix /etc/zabbix/*.conf
}

View File

@ -0,0 +1,15 @@
[Unit]
Description=Zabbix server
Documentation=https://zabbix.com/manuals
After=syslog.target syslog.service network.target network-online.target postgresql.service
After=postgresql-9.6.service postgresql-10.service
After=postgresql-11.service postgresql-12.service
[Service]
User=zabbix
Group=zabbix
ExecStart=/usr/sbin/zabbix_server --foreground --config /etc/zabbix/zabbix_server.conf
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1 @@
d /run/zabbix 0755 zabbix zabbix -

View File

@ -0,0 +1,350 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
# needed to make webapp-config dep optional
WEBAPP_OPTIONAL="yes"
inherit flag-o-matic webapp java-pkg-opt-2 user systemd toolchain-funcs
DESCRIPTION="ZABBIX is software for monitoring of your applications, network and servers"
HOMEPAGE="https://www.zabbix.com/"
MY_P=${P/_/}
MY_PV=${PV/_/}
SRC_URI="https://cdn.zabbix.com/${PN}/sources/stable/$(ver_cut 1-2)/${P}.tar.gz"
LICENSE="GPL-2"
SLOT="0"
WEBAPP_MANUAL_SLOT="yes"
KEYWORDS="~amd64 ~x86"
IUSE="+agent java curl frontend ipv6 ldap libxml2 mysql openipmi oracle +postgres proxy server ssh ssl snmp sqlite odbc static"
REQUIRED_USE="|| ( agent frontend proxy server )
proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) )
server? ( ^^ ( mysql oracle postgres odbc ) )
static? ( !oracle !snmp )"
COMMON_DEPEND="
curl? ( net-misc/curl )
java? ( >=virtual/jdk-1.8:* )
ldap? (
=dev-libs/cyrus-sasl-2*
net-libs/gnutls
net-nds/openldap
)
libxml2? ( dev-libs/libxml2 )
mysql? ( dev-db/mysql-connector-c )
odbc? ( dev-db/unixODBC )
openipmi? ( sys-libs/openipmi )
oracle? ( dev-db/oracle-instantclient-basic )
postgres? ( dev-db/postgresql:* )
proxy? ( sys-libs/zlib )
server? (
dev-libs/libevent
sys-libs/zlib
)
snmp? ( net-analyzer/net-snmp )
sqlite? ( dev-db/sqlite )
ssh? ( net-libs/libssh2 )
ssl? ( dev-libs/openssl:=[-bindist] )
"
RDEPEND="${COMMON_DEPEND}
java? ( >=virtual/jre-1.8:* )
mysql? ( virtual/mysql )
proxy? ( net-analyzer/fping[suid] )
server? (
app-admin/webapp-config
dev-libs/libevent
dev-libs/libpcre
net-analyzer/fping[suid]
)
frontend? (
app-admin/webapp-config
dev-lang/php:*[bcmath,ctype,sockets,gd,truetype,xml,session,xmlreader,xmlwriter,nls,sysvipc,unicode]
media-libs/gd[png]
virtual/httpd-php:*
mysql? ( dev-lang/php[mysqli] )
odbc? ( dev-lang/php[odbc] )
oracle? ( dev-lang/php[oci8-instant-client] )
postgres? ( dev-lang/php[postgres] )
sqlite? ( dev-lang/php[sqlite] )
)
"
DEPEND="${COMMON_DEPEND}
static? (
curl? ( net-misc/curl[static-libs] )
ldap? (
=dev-libs/cyrus-sasl-2*[static-libs]
net-libs/gnutls[static-libs]
net-nds/openldap[static-libs]
)
libxml2? ( dev-libs/libxml2[static-libs] )
mysql? ( dev-db/mysql-connector-c[static-libs] )
odbc? ( dev-db/unixODBC[static-libs] )
postgres? ( dev-db/postgresql:*[static-libs] )
sqlite? ( dev-db/sqlite[static-libs] )
ssh? ( net-libs/libssh2 )
)
"
BDEPEND="
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}/${PN}-4.0.18-modulepathfix.patch"
"${FILESDIR}/${PN}-3.0.30-security-disable-PidFile.patch"
)
S=${WORKDIR}/${MY_P}
ZABBIXJAVA_BASE="opt/zabbix_java"
pkg_setup() {
if use oracle; then
if [ -z "${ORACLE_HOME}" ]; then
eerror
eerror "The environment variable ORACLE_HOME must be set"
eerror "and point to the correct location."
eerror "It looks like you don't have Oracle installed."
eerror
die "Environment variable ORACLE_HOME is not set"
fi
if has_version 'dev-db/oracle-instantclient-basic'; then
ewarn
ewarn "Please ensure you have a full install of the Oracle client."
ewarn "dev-db/oracle-instantclient* is NOT sufficient."
ewarn
fi
fi
if use frontend; then
webapp_pkg_setup
fi
enewgroup zabbix
enewuser zabbix -1 -1 /var/lib/zabbix/home zabbix
java-pkg-opt-2_pkg_setup
}
src_prepare() {
default
}
src_configure() {
econf \
$(use_enable agent) \
$(use_enable ipv6) \
$(use_enable java) \
$(use_enable proxy) \
$(use_enable server) \
$(use_enable static) \
$(use_with curl libcurl) \
$(use_with ldap) \
$(use_with libxml2) \
$(use_with mysql) \
$(use_with odbc unixodbc) \
$(use_with openipmi openipmi) \
$(use_with oracle) \
$(use_with postgres postgresql) \
$(use_with snmp net-snmp) \
$(use_with sqlite sqlite3) \
$(use_with ssh ssh2) \
$(use_with ssl openssl)
}
src_compile() {
if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
emake AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)"
fi
}
src_install() {
local dirs=(
/etc/zabbix
/var/lib/zabbix
/var/lib/zabbix/home
/var/lib/zabbix/scripts
/var/lib/zabbix/alertscripts
/var/lib/zabbix/externalscripts
/var/log/zabbix
)
for dir in "${dirs[@]}"; do
dodir "${dir}"
keepdir "${dir}"
done
insinto /usr/include/zabbix
doins include/*.h
if use server; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_server.conf
fperms 0640 /etc/zabbix/zabbix_server.conf
fowners root:zabbix /etc/zabbix/zabbix_server.conf
newinitd "${FILESDIR}"/zabbix-server.init zabbix-server
dosbin src/zabbix_server/zabbix_server
insinto /usr/share/zabbix
doins -r "${S}"/database/
systemd_dounit "${FILESDIR}"/zabbix-server.service
systemd_newtmpfilesd "${FILESDIR}"/zabbix-server.tmpfiles zabbix-server.conf
fi
if use proxy; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_proxy.conf
fperms 0640 /etc/zabbix/zabbix_proxy.conf
fowners root:zabbix /etc/zabbix/zabbix_proxy.conf
newinitd "${FILESDIR}"/zabbix-proxy.init zabbix-proxy
dosbin src/zabbix_proxy/zabbix_proxy
insinto /usr/share/zabbix
doins -r "${S}"/database/
systemd_dounit "${FILESDIR}"/zabbix-proxy.service
systemd_newtmpfilesd "${FILESDIR}"/zabbix-proxy.tmpfiles zabbix-proxy.conf
fi
if use agent; then
insinto /etc/zabbix
doins "${S}"/conf/zabbix_agentd.conf
fperms 0640 /etc/zabbix/zabbix_agentd.conf
fowners root:zabbix /etc/zabbix/zabbix_agentd.conf
newinitd "${FILESDIR}"/zabbix-agentd.init zabbix-agentd
dosbin src/zabbix_agent/zabbix_agentd
dobin \
src/zabbix_sender/zabbix_sender \
src/zabbix_get/zabbix_get
systemd_dounit "${FILESDIR}"/zabbix-agentd.service
systemd_newtmpfilesd "${FILESDIR}"/zabbix-agentd.tmpfiles zabbix-agentd.conf
fi
fowners root:zabbix /etc/zabbix
fowners zabbix:zabbix \
/var/lib/zabbix \
/var/lib/zabbix/home \
/var/lib/zabbix/scripts \
/var/lib/zabbix/alertscripts \
/var/lib/zabbix/externalscripts \
/var/log/zabbix
fperms 0750 \
/etc/zabbix \
/var/lib/zabbix \
/var/lib/zabbix/home \
/var/lib/zabbix/scripts \
/var/lib/zabbix/alertscripts \
/var/lib/zabbix/externalscripts \
/var/log/zabbix
dodoc README INSTALL NEWS ChangeLog \
conf/zabbix_agentd.conf \
conf/zabbix_proxy.conf \
conf/zabbix_agentd/userparameter_examples.conf \
conf/zabbix_agentd/userparameter_mysql.conf \
conf/zabbix_server.conf
if use frontend; then
webapp_src_preinst
cp -R ui/* "${D}/${MY_HTDOCSDIR}"
webapp_configfile \
"${MY_HTDOCSDIR}"/include/db.inc.php \
"${MY_HTDOCSDIR}"/include/config.inc.php
webapp_src_install
fi
if use java; then
dodir \
/${ZABBIXJAVA_BASE} \
/${ZABBIXJAVA_BASE}/bin \
/${ZABBIXJAVA_BASE}/lib
keepdir /${ZABBIXJAVA_BASE}
exeinto /${ZABBIXJAVA_BASE}/bin
doexe src/zabbix_java/bin/zabbix-java-gateway-${MY_PV}.jar
exeinto /${ZABBIXJAVA_BASE}/lib
doexe \
src/zabbix_java/lib/logback-classic-0.9.27.jar \
src/zabbix_java/lib/logback-console.xml \
src/zabbix_java/lib/logback-core-0.9.27.jar \
src/zabbix_java/lib/logback.xml \
src/zabbix_java/lib/android-json-4.3_r3.1.jar \
src/zabbix_java/lib/slf4j-api-1.6.1.jar
newinitd "${FILESDIR}"/zabbix-jmx-proxy.init zabbix-jmx-proxy
newconfd "${FILESDIR}"/zabbix-jmx-proxy.conf zabbix-jmx-proxy
fi
}
pkg_postinst() {
if use server || use proxy ; then
elog
elog "You may need to configure your database for Zabbix"
elog "if you have not already done so."
elog
zabbix_homedir=$(egethome zabbix)
if [ -n "${zabbix_homedir}" ] && \
[ "${zabbix_homedir}" != "/var/lib/zabbix/home" ]; then
ewarn
ewarn "The user 'zabbix' should have his homedir changed"
ewarn "to /var/lib/zabbix/home if you want to use"
ewarn "custom alert scripts."
ewarn
ewarn "A real homedir might be needed for configfiles"
ewarn "for custom alert scripts."
ewarn
ewarn "To change the homedir use:"
ewarn " usermod -d /var/lib/zabbix/home zabbix"
ewarn
fi
fi
if use server; then
elog
elog "For distributed monitoring you have to run:"
elog
elog "zabbix_server -n <nodeid>"
elog
elog "This will convert database data for use with Node ID"
elog "and also adds a local node."
elog
fi
elog "--"
elog
elog "You may need to add these lines to /etc/services:"
elog
elog "zabbix-agent 10050/tcp Zabbix Agent"
elog "zabbix-agent 10050/udp Zabbix Agent"
elog "zabbix-trapper 10051/tcp Zabbix Trapper"
elog "zabbix-trapper 10051/udp Zabbix Trapper"
elog
if use server || use proxy ; then
# check for fping
fping_perms=$(stat -c %a /usr/sbin/fping 2>/dev/null)
case "${fping_perms}" in
4[157][157][157])
;;
*)
ewarn
ewarn "If you want to use the checks 'icmpping' and 'icmppingsec',"
ewarn "you have to make /usr/sbin/fping setuid root and executable"
ewarn "by everyone. Run the following command to fix it:"
ewarn
ewarn " chmod u=rwsx,g=rx,o=rx /usr/sbin/fping"
ewarn
ewarn "Please be aware that this might impose a security risk,"
ewarn "depending on the code quality of fping."
ewarn
;;
esac
fi
}

1
profiles/repo_name Normal file
View File

@ -0,0 +1 @@
unitas-zabbix

10
unitas-zabbix-overlay.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<layman>
<overlay type="git" src="http://dev.unitas-network.de/r/Gentoo/unitas-zabbix.git" name="unitas-zabbix" status="unofficial" contact="admin@unitas-network.de">
<description>Gentoo Portage Overlay for Zabbix.
It contains ebuilds mainly for internal use without any
warranty.</description>
<link>https://www.unitas-network.de</link>
</overlay>
</layman>