Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Zabbix monitors the postgresql database through pg_monz templates

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Need to install the software package pg_monz-2.1.tar.gz zabbix-sender-3.0.5-1.el7.x86_64.rpm zabbix-agent-3.0.17-1.el7.x86_64.rpm (omit installation) pg_monz installation

1. Download the pg_monz monitoring template

Https://github.com/pg-monz/pg_monz/releases/tag/2.1

(1) deployment profile

# tar zxf pg_monz-2.1.tar.gz

# cd pg_monz-2.1/pg_monz/

# cp usr-local-etc/* / usr/local/etc

# vim / usr/local/etc/pgsql_funcs.conf

PGHOST=127.0.0.1 # connection address of the database

PGPORT=5432 # connection port of the database

PGROLE=postgres # users of the database

Name of the PGDATABASE=postgres # database

The password file path of the export PGPASSFILE=/usr/local/etc/pgpass # database (if you do not need a password to log in to the database, this step can be omitted)

# echo "127.0.0.1:5432:*:postgres:somepassword" > / usr/local/etc/pgpass your password file, somepassword is the password of the database to which you want to connect

# chmod 600 / usr/local/etc/pgpass authorizes password files

(2) deployment script file

# / bin/cp pg_monz-2.1/pg_monz/usr-local-bin/ / usr/local/bin

# chmod + x / usr/local/bin/.sh

(3) deploy zabbix proxy parameter configuration file

# / bin/cp pg_monz-2.1/pg_monz/zabbix_agentd.d/userparameter_pgsql.conf / etc/zabbix/zabbix_agentd.d/

In addition, add the Include setting to zabbix_agentd.conf to load the above file.

(zabbix Agent needs to be restarted to apply settings)

Include=/etc/zabbix/zabbix_agentd.conf.d/

Install Zabbix Sender (remember to install it)

Install on centos5

Rpm-ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/5/x86_64/zabbix-sender-3.0.5-1.el5.x86_64.rpm

Install zabbix_sender on centos6

Rpm-ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/6/x86_64/zabbix-sender-3.0.5-1.el6.x86_64.rpm

Install zabbix_sender on centos7

Rpm-ivh http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/zabbix-sender-3.0.5-1.el7.x86_64.rpm

Import postgresql Monitoring Templat

Log in to the Zabbix Web interface and import the template using the following steps:

Select the [configuration]-[templates] tab and display a list of templates.

Click Import in the upper-right corner, and then import all xml files in order, including the pg_monz package.

If successful, the imported template is added to the list of templates.

Modify the macros of the template

The next step is to add the host and apply the imported template, which is omitted.

Additional knowledge:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report