Compare commits

..

No commits in common. "55b9b16deb0abde3fd2b38cde9542bf85fd35ecc" and "295d1d63105b765b5726d770fdcf9af3d3a8888e" have entirely different histories.

6 changed files with 20 additions and 52 deletions

View File

@ -74,12 +74,12 @@ install-common:
# Set up directories # Set up directories
mkdir -p $(DESTDIR)/etc/$(PACKAGE_NAME) mkdir -p $(DESTDIR)/etc/$(PACKAGE_NAME)
mkdir -p ${DESTDIR}/etc/logrotate.d mkdir -p ${DESTDIR}/etc/logrotate.d
mkdir -p $(DESTDIR)/usr/bin mkdir -p $(DESTDIR)/usr/local/bin
mkdir -p $(DESTDIR)/usr/share/man/man1 mkdir -p $(DESTDIR)/usr/share/man/man1
# Install script # Install script
cp $(SCRIPT) $(DESTDIR)/usr/bin/$(PACKAGE_NAME) cp $(SCRIPT) $(DESTDIR)/usr/local/bin/$(PACKAGE_NAME)
chmod 755 $(DESTDIR)/usr/bin/$(PACKAGE_NAME) chmod 755 $(DESTDIR)/usr/local/bin/$(PACKAGE_NAME)
# Install manpage # Install manpage
cp manpages/* $(DESTDIR)/usr/share/man/man1/ cp manpages/* $(DESTDIR)/usr/share/man/man1/
@ -113,7 +113,6 @@ install-openrc:
# Install init script # Install init script
cp openrc/pgmon.initd $(DESTDIR)/etc/init.d/pgmon cp openrc/pgmon.initd $(DESTDIR)/etc/init.d/pgmon
chmod 755 $(DESTDIR)/etc/init.d/pgmon
# Install init script config file # Install init script config file
cp openrc/pgmon.confd $(DESTDIR)/etc/conf.d/pgmon cp openrc/pgmon.confd $(DESTDIR)/etc/conf.d/pgmon

View File

@ -28,7 +28,7 @@ make -C /src install-systemd DESTDIR=%{buildroot}
/etc/pgmon/pgmon-service.conf /etc/pgmon/pgmon-service.conf
/lib/systemd/system/pgmon.service /lib/systemd/system/pgmon.service
/lib/systemd/system/pgmon@.service /lib/systemd/system/pgmon@.service
/usr/bin/pgmon /usr/local/bin/pgmon
/usr/share/man/man1/pgmon.1.gz /usr/share/man/man1/pgmon.1.gz
%post %post

View File

@ -28,7 +28,7 @@ make -C /src install-systemd DESTDIR=%{buildroot}
/etc/pgmon/pgmon-service.conf /etc/pgmon/pgmon-service.conf
/lib/systemd/system/pgmon.service /lib/systemd/system/pgmon.service
/lib/systemd/system/pgmon@.service /lib/systemd/system/pgmon@.service
/usr/bin/pgmon /usr/local/bin/pgmon
/usr/share/man/man1/pgmon.1.gz /usr/share/man/man1/pgmon.1.gz
%post %post

View File

@ -22,7 +22,7 @@ metrics:
max_frozen_age: max_frozen_age:
type: row type: row
query: query:
0: SELECT max(age(datfrozenxid)) AS xid_age, max(mxid_age(datminmxid)) AS mxid_age FROM pg_database 0: SELECT max(age(datfrozenxid)), max(mxid_age(datminmxid)) FROM pg_database
# Per-database metrics # Per-database metrics
db_stats: db_stats:
@ -47,6 +47,12 @@ metrics:
test_args: test_args:
repid: 127.0.0.1_test_rep repid: 127.0.0.1_test_rep
# Debugging
sleep:
type: value
query:
0: SELECT now(), pg_sleep(5);
# Per-slot metrics # Per-slot metrics
slot_stats: slot_stats:
type: row type: row

View File

@ -7,7 +7,7 @@ After=network.target
[Service] [Service]
EnvironmentFile=/etc/pgmon/%i-service.conf EnvironmentFile=/etc/pgmon/%i-service.conf
User=${SERVICE_USER:-postgres} User=${SERVICE_USER:-postgres}
ExecStart=/usr/bin/pgmon -c /etc/pgmon/%i.yml ExecStart=/usr/local/bin/pgmon -c /etc/pgmon/%i.yml
ExecReload=kill -HUP $MAINPID ExecReload=kill -HUP $MAINPID
Restart=on-failure Restart=on-failure
Type=exec Type=exec

View File

@ -11,44 +11,6 @@ zabbix_export:
groups: groups:
- name: 'My Templates' - name: 'My Templates'
items: items:
- uuid: cc4a50ca681b4c4fb8c1c98f4bc81c96
name: 'Max Frozen MXID Age'
type: DEPENDENT
key: pgmon.age.mxid
delay: '0'
history: 90d
description: 'Maximum age of any frozen MXID in any database'
preprocessing:
- type: JSONPATH
parameters:
- $.mxid_age
- type: MATCHES_REGEX
parameters:
- '^[0-9]+$'
master_item:
key: 'pgmon[max_frozen_age]'
tags:
- tag: Application
value: PostgreSQL
- uuid: 2fa86d8c4a3a481e856a9414c5c70216
name: 'Max Frozen XID Age'
type: DEPENDENT
key: pgmon.age.xid
delay: '0'
history: 90d
description: 'Maximum age of any frozen XID in any database'
preprocessing:
- type: JSONPATH
parameters:
- $.xid_age
- type: MATCHES_REGEX
parameters:
- '^[0-9]+$'
master_item:
key: 'pgmon[max_frozen_age]'
tags:
- tag: Application
value: PostgreSQL
- uuid: de1fa757395440118026f4c7a7c4ebbe - uuid: de1fa757395440118026f4c7a7c4ebbe
name: 'PostgreSQL latest supported version' name: 'PostgreSQL latest supported version'
type: DEPENDENT type: DEPENDENT
@ -109,14 +71,15 @@ zabbix_export:
- tag: Application - tag: Application
value: PostgreSQL value: PostgreSQL
- uuid: 8706eccb7edc4fa394f552fc31f401a9 - uuid: 8706eccb7edc4fa394f552fc31f401a9
name: 'PostgreSQL ID Age Info' name: 'Max Frozen XID Age'
type: HTTP_AGENT type: HTTP_AGENT
key: 'pgmon[max_frozen_age]' key: 'pgmon[max_frozen_age]'
delay: 5m history: 90d
history: '0' description: 'Maximum age of any frozen XID in any database'
value_type: TEXT preprocessing:
trends: '0' - type: MATCHES_REGEX
description: 'Maximum age of any frozen XID and MXID in any database' parameters:
- '^[0-9]+$'
url: 'http://localhost:{$AGENT_PORT}/max_frozen_age' url: 'http://localhost:{$AGENT_PORT}/max_frozen_age'
tags: tags:
- tag: Application - tag: Application