2024-06-02 16:20:01 +00:00
|
|
|
# Copyright 2024 Gentoo Authors
|
|
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
|
|
EAPI=8
|
|
|
|
|
|
|
|
|
|
PYTHON_COMPAT=( python3_{6..11} )
|
|
|
|
|
|
|
|
|
|
inherit git-r3 python-r1
|
|
|
|
|
|
|
|
|
|
DESCRIPTION="PostgreSQL monitoring bridge"
|
|
|
|
|
HOMEPAGE="None"
|
|
|
|
|
|
|
|
|
|
LICENSE="BSD"
|
|
|
|
|
SLOT="0"
|
|
|
|
|
KEYWORDS="amd64"
|
|
|
|
|
|
2024-06-03 05:16:54 +00:00
|
|
|
EGIT_REPO_URI="https://code2.shh-dot-com.org/pgmon.git"
|
2024-06-02 16:20:01 +00:00
|
|
|
#EGIT_COMMIT=""
|
|
|
|
|
|
2024-06-03 05:10:45 +00:00
|
|
|
IUSE="+agent agent2"
|
|
|
|
|
|
2024-06-02 16:20:01 +00:00
|
|
|
DEPEND="
|
|
|
|
|
${PYTHON_DEPS}
|
|
|
|
|
dev-python/psycopg:2
|
2024-06-03 05:10:45 +00:00
|
|
|
acct-user/zabbix
|
|
|
|
|
acct-group/zabbix
|
|
|
|
|
agent? ( net-analyzer/zabbix[agent] )
|
|
|
|
|
agent2? ( net-analyzer/zabbix[agent2] )
|
|
|
|
|
app-admin/logrotate
|
2024-06-02 16:20:01 +00:00
|
|
|
"
|
|
|
|
|
RDEPEND="${DEPEND}"
|
|
|
|
|
BDEPEND=""
|
2024-06-03 05:10:45 +00:00
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
|
default
|
|
|
|
|
|
|
|
|
|
# Install init script
|
|
|
|
|
newinitd files/pgmon.openrc pgmon
|
|
|
|
|
|
|
|
|
|
# Install default config
|
|
|
|
|
diropts -o root -g zabbix -m 0755
|
|
|
|
|
insinto /etc/pgmon
|
|
|
|
|
doins "${FILESDIR}/pgmon.cfg"
|
|
|
|
|
doins "${S}/pgmon-metrics.cfg"
|
|
|
|
|
|
|
|
|
|
# Install Zabbix userparams file
|
|
|
|
|
if use agent; then
|
|
|
|
|
insinto /etc/zabbix/zabbix_agent.d
|
|
|
|
|
newins "${S}/pgmon_userparameter.conf" pgmon.conf
|
|
|
|
|
fperms 0644 /etc/zabbix/zabbix_agent.d/pgmon.conf
|
|
|
|
|
fowners root:zabbix /etc/zabbix/zabbix_agent.d/pgmon.conf
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if use agent2; then
|
|
|
|
|
insinto /etc/zabbix/zabbix_agent2.d
|
|
|
|
|
newins "${S}/pgmon_userparameter.conf" pgmon.conf
|
|
|
|
|
fperms 0644 /etc/zabbix/zabbix_agent2.d/pgmon.conf
|
|
|
|
|
fowners root:zabbix /etc/zabbix/zabbix_agent2.d/pgmon.conf
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Install logrotate config
|
|
|
|
|
insinto /etc/logrotate.d
|
|
|
|
|
newins "${FILESDIR}/pgmon.logrotate" pgmon
|
|
|
|
|
}
|