Packages that need to be installed
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 (省略安装)
Pg_monz Installation
1. Download Pg_monz Monitor Template
https://github.com/pg-monz/pg_monz/releases/tag/2.1
(1) Deployment configuration file
#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 #数据库的连接地址
pgport=5432 #数据库的连接端口
Pgrole=postgres #数据库的用户
Pgdatabase=postgres #数据库的名称
Export Pgpassfile=/usr/local/etc/pgpass #数据库的密码文件路径 (This step can be omitted if the login database does not require a password)
#echo "127.0.0.1:5432:*:p ostgres:somepassword" >/usr/local/etc/pgpass your password file, somepassword the password for the database you want to connect to
#chmod 600/usr/local/etc/pgpass to authorize 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) Deploying the Zabbix Agent parameter configuration file
#/bin/cp pg_monz-2.1/pg_monz/zabbix_agentd.d/userparameter_pgsql.conf/etc/zabbix/zabbix_agentd.d/
Also, add the include settings to zabbix_agentd.conf to load the above file.
(You need to restart the Zabbix agent to apply the settings)
include=/etc/zabbix/zabbix_agentd.conf.d/
Install Zabbix Sender (remember to install it)
Installing on the 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
Installing the Zabbix_sender on the 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
Installing the Zabbix_sender on the 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
Importing a PostgreSQL monitoring template
Log in to the Zabbix Web interface and use the following steps to import the template:
Select the Configuration-Templates tab and display a list of templates.
Click Import in the upper-right corner, and then import all the XML files sequentially, including the Pg_monz package.
If successful, the imported template is added to the list of templates.
To modify a macro for a template
Next is to add the host and apply the imported template, this step is omitted.
Additional knowledge:
Zabbix monitoring PostgreSQL database via Pg_monz template