Update pgmon

This commit is contained in:
James Campbell 2025-05-14 00:20:19 -04:00
parent 4b070698d2
commit e6d8cba14e
Signed by: james
GPG Key ID: 2287C33A40DC906A
8 changed files with 75 additions and 253 deletions

View File

@ -1,8 +1,4 @@
AUX pgmon.cfg 1094 SHA256 58ae6c49c5eb1563fc80276796bd52d69cdb625069d2f62ca0ca924bca7550a7 SHA512 363729b074967ecf055213918686e44edb389aa91a1e9c75398ae18819b4e836e4b772514a5d18d115fc31282c2f7ace9ae54c366c6e493bf92644fd8c5d1813 WHIRLPOOL d547d9426f6c013c15f0441b515a1275b756b641c4b8a1896ddf3e4cca570e405ceeae2a2883f4a380467398e33532086f7baa1cee5768ae59c3c1dd65606899
AUX pgmon.logrotate 116 SHA256 d7cc697cc640f661ec0019363b8a411e0df62cbe63b97c5fca0ad4f533803154 SHA512 50cb5530a36cff24d0ba7c19b1aa05862f7aa3e82ccd6a9e7029a53e00c579dbb9eb310210508ad9c8b26a8462c038519230edd1d0295c6b73fab269357c57c7 WHIRLPOOL 043e68161bb9056e5c0eb9bdc883f181d4f43d45b3dd9eaffd20e94fad48072762d29e18124489c5ce7229f62fb9763335c5908509c0a2d552061cc6f56ee8d5
AUX pgmon.openrc 829 SHA256 bbfd3ec3834e0f04539696715c6529099a4329d7dbce8fe045974b220e123f73 SHA512 bfeb3b9417a32019b20e0147eeb7489551da206409c43d14d683685affafafcdee943493bca1d4d3b0d092eb909ac61764e8898798a737b38edacdb72d021fd7 WHIRLPOOL a0825737f9becd8079f784b5bdc5aab8548c5330ddae815404607fbb52c722d08bf32dd50f8c5dca3c6452d6201f45576c4a072960c42ea736a4939ab394edcf
AUX pgmon_userparameter.conf 90 SHA256 72ac9abc29908206a57b084f029fce6d662633cac5988c1d79a8628687b7a912 SHA512 1dcf74ebca08ddc077ee35212cdc084a14faa717433f9fb5e2a994863cbf6d9ca7be81f8533df9d1afdcea46b7b0afb3c1182f059774fb5704ccebaae446c24b WHIRLPOOL 8d6dc97519d9c62419a65e201e012d823076156b972ed3da193d6d5e5d01e1a2adb8c60910dd954c096fadc5d772707974467270707ceb70aac80eef3723eb90
DIST pgmon-1.0.0.tar.gz 37417 SHA256 0c49f78684d9ed555217c321bc8008e735da0764217f904be39e58a16885dc75 SHA512 954f1d010326d3161070f7a99caedf0cd6946e944777b461c1401000240493faf7a878a42f9a62fd07e8a47e0382f4f57f00c83e022369982f8443a89b298c5c WHIRLPOOL cd3ddd468323c2b1adc58d24216e54e5fe6ecdc9a345b7c82c9f3a585092ba14dc18dce485700af16915f12ac8e7a0dcf703d8f32b545bb70469c6a013f5c18e DIST pgmon-1.0.0.tar.gz 37417 SHA256 0c49f78684d9ed555217c321bc8008e735da0764217f904be39e58a16885dc75 SHA512 954f1d010326d3161070f7a99caedf0cd6946e944777b461c1401000240493faf7a878a42f9a62fd07e8a47e0382f4f57f00c83e022369982f8443a89b298c5c WHIRLPOOL cd3ddd468323c2b1adc58d24216e54e5fe6ecdc9a345b7c82c9f3a585092ba14dc18dce485700af16915f12ac8e7a0dcf703d8f32b545bb70469c6a013f5c18e
EBUILD pgmon-0.0.1.ebuild 1493 SHA256 0f8623c016ea2b15a3343cf83abf022e17652b3bbab78b200afff7857fc3f12e SHA512 ce2f13e66b960481ede10542788129fadc46de3d95d19ff1e4317c381624fcca35d00be8c11d74b55274f86b618754bcff71ae10aecdb39133ef0111bb3aa2cd WHIRLPOOL 5c38382e171d20d84fba360e39b7854e32c5d108564695ce25f537a55702eeff3f5df169b8ffc501f27e82f1c49dfa7328c96bcd93d0a9ddca9110de4b044bd9 DIST pgmon-1.0.1.tar.gz 10324 SHA256 b88307cc5b0cfc884535e54e8876f5cda819f1c224cf478d07da4ae9cf47e0d3 SHA512 8276da1512c2de8e9abbf02980f78a55fa4885519655791755a83d0860336d7ba544beb2f853d1e42df49682acf07b453a81f2c28d05ec433eed195e4f1d3b12 WHIRLPOOL 7db1acb58a195637a702c5ab185db2a7a86b006276c017e2bc5c23649652efa4f50aec51ef3a54d875e5905019291649c9701aa463637005dac9cd4767c6ca68
EBUILD pgmon-0.0.2.ebuild 1499 SHA256 4753b7c82f12814843c795110347b74a16e1c9abafd3590be4dad954ad65110e SHA512 25a8309c33d819a099fcbfdc4c6428497f40658dee2db053caaeb437715fd6680df4ac0c0f36b079b69db8561bf8870e28a67e3ecc660fc7abbe547a61b84003 WHIRLPOOL b4069127dd8a303c2926fbeb7fa8f3c1689d03012c1ac3bdbaa7faa1fb76282e9f0115741f2b1cc15d82ff4452188dbac835c202082907ab5712881afe2689e9
EBUILD pgmon-1.0.0.ebuild 1428 SHA256 e571e9f50a40ff37bf1c068521b49d39abee84f83f72a2c6ddb920b8b3fa9259 SHA512 6497cd07f912167c9fedf9569c6972651a2fcbedf354b42f3de5eb0a413e58d86c19c22eee80edea171a4cc9497f0f9ded20f7484a912369ac7580dfe2d00727 WHIRLPOOL 54f4e3675eef379e468a3795e4e9fd8e01048b8a5d94c314d5d40ab90a24f52af39734ce0299d7228acf4d91e2caf97e20ae2965424f65073c801e787410aabb EBUILD pgmon-1.0.0.ebuild 1428 SHA256 e571e9f50a40ff37bf1c068521b49d39abee84f83f72a2c6ddb920b8b3fa9259 SHA512 6497cd07f912167c9fedf9569c6972651a2fcbedf354b42f3de5eb0a413e58d86c19c22eee80edea171a4cc9497f0f9ded20f7484a912369ac7580dfe2d00727 WHIRLPOOL 54f4e3675eef379e468a3795e4e9fd8e01048b8a5d94c314d5d40ab90a24f52af39734ce0299d7228acf4d91e2caf97e20ae2965424f65073c801e787410aabb
EBUILD pgmon-1.0.1.ebuild 1428 SHA256 e571e9f50a40ff37bf1c068521b49d39abee84f83f72a2c6ddb920b8b3fa9259 SHA512 6497cd07f912167c9fedf9569c6972651a2fcbedf354b42f3de5eb0a413e58d86c19c22eee80edea171a4cc9497f0f9ded20f7484a912369ac7580dfe2d00727 WHIRLPOOL 54f4e3675eef379e468a3795e4e9fd8e01048b8a5d94c314d5d40ab90a24f52af39734ce0299d7228acf4d91e2caf97e20ae2965424f65073c801e787410aabb

View File

@ -1,68 +0,0 @@
##
# Misc agent settings
##
# Where to write/find the agent PID
#pid_file=
##
# Agent communication settings
##
# IPC socket
#ipc_socket=pgmon.sock
# IPC communication timeout (s)
#ipc_timeout=10
# Request processing timeout (s)
#request_timeout=10
# Max size of the request queue before it blocks
#request_queue_size=100
# Max time to wait when queueing a request (s)
#request_queue_timeout=2
##
# Agent resource settings
##
# Number of worker threads
#worker_count=4
##
# Logging settings
##
# Log level for stderr logging (or 'off')
stderr_log_level=off
# Log level for file logging (od 'off')
file_log_level=info
# Log file
#log_file=pgmon.log
##
# DB connection settings
#
# Each cluster entry is of the form:
# name:address:port:dbname:user:password
#
# Any element other than the name can be left empty to use the defaults
##
#cluster=local:/var/run/postgresql:5432:postgres:zbx_monitor:
# Default database to connect to when none is specified for a metric
#dbname=postgres
##
# Monitoring configuration
##
# Metrics
#metrics={}
include=/etc/pgmon/pgmon-metrics.cfg

View File

@ -1,10 +0,0 @@
/var/log/pgmon/*.log {
daily
missingok
rotate 7
compress
delaycompress
copytruncate
notifempty
maxsize 1G
}

View File

@ -1,32 +0,0 @@
#!/sbin/openrc-run
extra_started_commands="reload"
agent_name=${SVCNAME#pgmon.}
agent_name=${agent_name:-pgmon}
CONFIG_FILE="/etc/pgmon/${agent_name}.cfg"
PID_FILE="/run/pgmon/${agent_name}.pid"
LOG_FILE="/var/log/pgmon/${agent_name}.log"
SOCKET="/run/pgmon/${agent_name}.socket"
pidfile="$PID_FILE"
command="/usr/bin/pgmon"
command_args="--server -c '$CONFIG_FILE' -l '$LOG_FILE' -s '$SOCKET'"
command_background="true"
command_user="zabbix:zabbix"
output_log="/var/log/pgmon/${agent_name}-service.log"
error_log="/var/log/pgmon/${agent_name}-service.err"
start_pre() {
checkpath -d -m 0755 -o "${command_user}" "/run/pgmon"
checkpath -d -m 0755 -o "${command_user}" "/var/log/pgmon"
}
reload() {
ebegin "Reloading ${RC_SVCNAME}"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}

View File

@ -1 +0,0 @@
UserParameter=pgmon[*],/usr/bin/pgmon -s "/run/pgmon/$1.socket" "$2,$3,$4,$5,$6,$7,$8,$9"

View File

@ -1,68 +0,0 @@
# 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"
EGIT_REPO_URI="https://code2.shh-dot-com.org/james/pgmon.git"
#EGIT_COMMIT=""
IUSE="+agent agent2"
DEPEND="
${PYTHON_DEPS}
dev-python/psycopg:2
acct-user/zabbix
acct-group/zabbix
agent? ( net-analyzer/zabbix[agent] )
agent2? ( net-analyzer/zabbix[agent2] )
app-admin/logrotate
"
RDEPEND="${DEPEND}"
BDEPEND=""
src_install() {
default
# Install init script
newinitd "${FILESDIR}/pgmon.openrc" pgmon
# Install script
exeinto /usr/bin
newexe "${S}/pgmon.py" 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 "${FILESDIR}/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
}

View File

@ -1,68 +0,0 @@
# 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"
EGIT_REPO_URI="https://code2.shh-dot-com.org/james/pgmon.git"
EGIT_COMMIT="9fd03f5"
IUSE="+agent agent2"
DEPEND="
${PYTHON_DEPS}
dev-python/psycopg:2
acct-user/zabbix
acct-group/zabbix
agent? ( net-analyzer/zabbix[agent] )
agent2? ( net-analyzer/zabbix[agent2] )
app-admin/logrotate
"
RDEPEND="${DEPEND}"
BDEPEND=""
src_install() {
default
# Install init script
newinitd "${FILESDIR}/pgmon.openrc" pgmon
# Install script
exeinto /usr/bin
newexe "${S}/pgmon.py" 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 "${FILESDIR}/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
}

View File

@ -0,0 +1,73 @@
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{6..13} )
inherit python-single-r1 systemd
DESCRIPTION="PostgreSQL monitoring bridge"
HOMEPAGE="https://code2.shh-dot-com.org/james/pgmon"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64"
#SRC_URI="https://code2.shh-dot-com.org/james/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI="${P}.tar.gz"
DEPEND="
${PYTHON_DEPS}
dev-python/psycopg:2
dev-python/pyyaml
app-admin/logrotate
"
RDEPEND="${DEPEND}"
BDEPEND=""
IUSE="-systemd"
S="${WORKDIR}/${PN}"
pkg_nofetch() {
einfo "Please download"
einfo " - ${P}.tar.bz2"
einfo "from ${HOMEPAGE} and place it in your DISTDIR directory."
einfo "The file should be owned by portage:portage"
}
src_compile() {
true
}
src_install() {
# Don't run make install
#default
# Install init script
newinitd "openrc/pgmon.initd" pgmon
newconfd "openrc/pgmon.confd" pgmon
# Install systemd unit
if use systemd ; then
systemd_dounit "systemd/pgmon.service"
fi
# Install script
python_scriptinto /usr/bin
python_newscript src/pgmon.py pgmon
# Install default config
diropts -o root -g root -m 0755
insinto /etc/pgmon
doins "sample-config/pgmon.yml"
doins "sample-config/pgmon-metrics.yml"
# Install logrotate config
insinto /etc/logrotate.d
newins "logrotate/pgmon.logrotate" pgmon
# Install man page
doman manpages/pgmon.1
}