Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
postgresql
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
certo
postgresql
Commits
b70bac21
Commit
b70bac21
authored
Apr 28, 2025
by
Vladimir Bashkirtsev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User parameters for zabbix agent now live in separate file - /etc/zabbix_agentd.userparams.conf
parent
62728f3a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
24 deletions
+25
-24
Makefile
Makefile
+25
-24
No files found.
Makefile
View file @
b70bac21
...
@@ -38,30 +38,31 @@ all: postgresql-service
...
@@ -38,30 +38,31 @@ all: postgresql-service
sed
-i
"s/^#listen_addresses = .*/listen_addresses = '*'/"
/srv/pgsql/data/postgresql.conf
sed
-i
"s/^#listen_addresses = .*/listen_addresses = '*'/"
/srv/pgsql/data/postgresql.conf
sed
-i
"s/^#password_encryption = .*/password_encryption = scram-sha-256/"
/srv/pgsql/data/postgresql.conf
sed
-i
"s/^#password_encryption = .*/password_encryption = scram-sha-256/"
/srv/pgsql/data/postgresql.conf
echo
"host all all 0.0.0.0/0 scram-sha-256"
>>
/srv/pgsql/data/pg_hba.conf
echo
"host all all 0.0.0.0/0 scram-sha-256"
>>
/srv/pgsql/data/pg_hba.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.replication.status[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.replication.status.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=device.id,/usr/sbin/deviceid'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.replication.lag.sec[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.replication.lag.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.replication.status[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.replication.status.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.replication.recovery_role[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.replication.recovery_role.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.replication.lag.sec[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.replication.lag.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.replication.count[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -c "SELECT count(*) FROM pg_stat_replication"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.replication.recovery_role[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.replication.recovery_role.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.version[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -c "SELECT version();"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.replication.count[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -c "SELECT count(*) FROM pg_stat_replication"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.ping.time[*], LANG=C.UTF-8 psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.ping.time.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.version[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -c "SELECT version();"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.ping[*], pg_isready -h "$$1" -p "$$2"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.ping.time[*], LANG=C.UTF-8 psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.ping.time.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.db.size[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -c "SELECT pg_database_size('
$$
6
')"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.ping[*], pg_isready -h "$$1" -p "$$2"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.discovery.db[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.discovery.db.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.db.size[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -c "SELECT pg_database_size('
$$
6
')"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.frozenxid[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.frozenxid.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.discovery.db[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.discovery.db.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.scans[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.scans.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.frozenxid[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.frozenxid.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.cache.hit[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.cache.hit.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.scans[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.scans.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.uptime[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.uptime.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.cache.hit[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.cache.hit.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.queries[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -v tmax=$$6 -f "/var/lib/zabbix/postgresql/pgsql.query.time.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.uptime[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.uptime.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.locks[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.locks.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.queries[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -v tmax=$$6 -f "/var/lib/zabbix/postgresql/pgsql.query.time.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.wal.stat[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.wal.stat.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.locks[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.locks.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.config.hash[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.config.hash.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.wal.stat[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.wal.stat.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.transactions[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.transactions.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.config.hash[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.config.hash.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.dbstat[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.dbstat.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.transactions[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.transactions.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.dbstat.sum[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.dbstat.sum.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.dbstat[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.dbstat.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.connections.prepared[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.connections.prepared.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.dbstat.sum[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.dbstat.sum.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.connections[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.connections.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.connections.prepared[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.connections.prepared.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.connections.sum[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.connections.sum.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.connections[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.connections.sql"'
>>
/etc/zabbix_agentd.userparams.conf
sed
-e
'/^UserParameter=device\.product.*/a UserParameter=pgsql.bgwriter[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.bgwriter.sql"'
-i
/etc/zabbix_agentd.conf
echo
'UserParameter=pgsql.connections.sum[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.connections.sum.sql"'
>>
/etc/zabbix_agentd.userparams.conf
echo
'UserParameter=pgsql.bgwriter[*], psql -qtAX postgresql://"$$3":"$$4"@"$$1":"$$2"/"$$5" -f "/var/lib/zabbix/postgresql/pgsql.bgwriter.sql"'
>>
/etc/zabbix_agentd.userparams.conf
@
echo
"d /run/postgresql 0775 postgres postgres -"
>
/usr/lib/tmpfiles.d/postgresql.conf
@
echo
"d /run/postgresql 0775 postgres postgres -"
>
/usr/lib/tmpfiles.d/postgresql.conf
@
echo
"
$$
POSTGRESQL_SERVICE"
>
/lib/systemd/system/postgresql.service
@
echo
"
$$
POSTGRESQL_SERVICE"
>
/lib/systemd/system/postgresql.service
systemctl
enable
postgresql.service
systemctl
enable
postgresql.service
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment