diff --git a/dev-db/pgmon/files/pgmon.cfg b/dev-db/pgmon/files/pgmon.cfg index 1c3c2bd..3eaf6ab 100644 --- a/dev-db/pgmon/files/pgmon.cfg +++ b/dev-db/pgmon/files/pgmon.cfg @@ -38,10 +38,10 @@ ipc_socket=/run/pgmon/pgmon.sock ## # Log level for stderr logging (or 'off') -stderr_log_level=info +stderr_log_level=off # Log level for file logging (od 'off') -file_log_level=notice +file_log_level=info # Log file #log_file=pgmon.log @@ -67,4 +67,4 @@ file_log_level=notice # Metrics #metrics={} -include=pgmon-metrics.cfg +include=/etc/pgmon/pgmon-metrics.cfg diff --git a/dev-db/pgmon/files/pgmon.openrc b/dev-db/pgmon/files/pgmon.openrc index 1606d3f..df9c946 100644 --- a/dev-db/pgmon/files/pgmon.openrc +++ b/dev-db/pgmon/files/pgmon.openrc @@ -2,14 +2,19 @@ extra_started_commands="reload" -agent_name=${RC_SERVICE#pgmon.} +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/${agent_name}.log" +SOCKET="/var/run/${agent_name}.socket" + command="/usr/bin/pgmon" -command_args="--server --config /etc/pgmon/${agent_name}.cfg" +command_args="--server -c '$CONFIG_FILE' -l '$LOG_FILE' -p '$PID_FILE' -s '$SOCKET'" command_user="zabbix:zabbix" -pidfile="/run/pgmon/${agent_name}.pid" +pidfile="$PID_FILE" start_pre() { checkpath -d -m 0755 -o "${command_user}" "/run/pgmon" diff --git a/dev-db/pgmon/files/pgmon_userparameter.conf b/dev-db/pgmon/files/pgmon_userparameter.conf new file mode 100644 index 0000000..2f89cf6 --- /dev/null +++ b/dev-db/pgmon/files/pgmon_userparameter.conf @@ -0,0 +1 @@ +UserParameter=pgmon[*],/usr/bin/pgmon -s "/run/pgmon/$1.socket" "$2,$3,$4,$5,$6,$7,$8,$9" diff --git a/dev-db/pgmon/pgmon-0.0.1.ebuild b/dev-db/pgmon/pgmon-0.0.1.ebuild index 49b4606..8f50f02 100644 --- a/dev-db/pgmon/pgmon-0.0.1.ebuild +++ b/dev-db/pgmon/pgmon-0.0.1.ebuild @@ -50,7 +50,7 @@ src_install() { # Install Zabbix userparams file if use agent; then insinto /etc/zabbix/zabbix_agent.d - newins "${S}/pgmon_userparameter.conf" pgmon.conf + 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