Skip to main content

PostgreSQL Monitoring By Zabbix



Requirements:
1. Zabbix 3.0 Server
2. Zabbix agent installed Centos 7 Server
3.  PostgresSQL  DBUser for Monitoring.
4. Add permissions in pg_hba.conf and pg_ident.conf Files.

Install from source For PostgresSQL :

1.       Download and install the libpq development headers (typically libpq-dev or postgresql-devel)
Download the latest libzbxpgsql source tarball from the downloads page
URL :  http://cdn.cavaliercoder.com/libzbxpgsql/yum/zabbix30/rhel/7/x86_64/libzbxpgsql-1.1.0-1.el7.x86_64.rpm
2.       Extract, configure and compile the sources with:
$ tar -xzf libzbxpgsql-*.tar.gz
$ cd libzbxpgsql-*/
$ ./configure --with-zabbix=/usr/src/zabbix
$ make && sudo make install
The module will be installed to /usr/local/lib/libzbxpgsql.so
Copy or link the module into your Zabbix agent LoadModulePath directory (typically /var/lib/zabbix/modules)
$ sudo mkdir /var/lib/zabbix/modules
$ sudo ln -s /usr/local/lib/libzbxpgsql.so /var/lib/zabbix/modules/libzbxpgsql.so
3.       Add the module to your zabbix_agentd.conf file with:
LoadModule=libzbxpgsql.so
4.       Restart the Zabbix agent with


Validate installation :

If the module is loaded correctly, you will see the following line in your Zabbix agent log file (/var/log/zabbix/zabbix_agentd.log):
loaded modules: libzbxpgsql.so
Check the installed version with:
$ zabbix_agentd -t pg.modver
pg.modver          [s|libzbxpgsql 1.0.0, compiled for Zabbix 3.0.2]

Add Template to Host :

Link for template for Zabbix 3.0

Configure connection macros:

{$PG_CONN} - libpq compatible connection string. This includes the hostname, port, username, etc. required to connect to PostgreSQL

{$PG_CONN} => host=pgdb.local port=5432 user=zabbix connect_timeout=10

{$PG_DB} - database to connect to.

{$PG_DB} => postgres

Below Applications are monitoried by using this :


PostgreSQL Backend Connections
PostgreSQL Background Writer
PostgreSQL Configuration
PostgreSQL Database Backend Connections
PostgreSQL Database Capacity
PostgreSQL Database Disk IO
PostgreSQL Database Errors
PostgreSQL Database Performance
PostgreSQL Database Temp File Utilization
PostgreSQL Index Statistics
PostgreSQL MVCC
PostgreSQL Prepared Transactions
PostgreSQL Server
PostgreSQL Tablespace Statistics
PostgreSQL Table Statistics

Comments

Popular posts from this blog

How to remove zabbix-agent from Ubuntu 16.04 (Xenial Xerus)

Uninstall zabbix-agent To remove just zabbix-agent package itself from Ubuntu 16.04 (Xenial Xerus) execute on terminal: sudo apt-get remove zabbix-agent Uninstall zabbix-agent and it's dependent packages To remove the zabbix-agent package and any other dependant package which are no longer needed from Ubuntu Xenial. sudo apt-get remove --auto-remove zabbix-agent Purging zabbix-agent If you also want to delete configuration and/or data files of zabbix-agent from Ubuntu Xenial then this will work: sudo apt-get purge zabbix-agent To delete configuration and/or data files of zabbix-agent and it's dependencies from Ubuntu Xenial then execute: sudo apt-get purge --auto-remove zabbix-agent

Install Zabbix Agent on Suse Linux and Configure

Install taken from Suse –  http://software.opensuse.org/download/package?project=server:monitoring&package=zabbix-agent For SLE 12 SP1 run the following as root : zypper addrepo http://download.opensuse.org/repositories/server:monitoring/SLE_12_SP1/server:monitoring.repo zypper refresh zypper install zabbix-agent For SLE 12 run the following as root : zypper addrepo http://download.opensuse.org/repositories/server:monitoring/SLE_12/server:monitoring.repo zypper refresh zypper install zabbix-agent For SLE 11 SP4 run the following as root : zypper addrepo http://download.opensuse.org/repositories/server:monitoring/SLE_11_SP4/server:monitoring.repo zypper refresh zypper install zabbix-agent For SLE 11 SP3 run the following as root : zypper addrepo http://download.opensuse.org/repositories/server:monitoring/SLE_11_SP3/server:monitoring.repo zypper refresh zypper install zabbix-agent To configure the agent – Instructions t...

Zabbix alert Notification with Telegram

Zabbix Notifications with graphs in Telegram. Features  Graphs based on latest data are sent directly to your messenger  You can send messages both in private and group chats  Channels support  Saves chatid as a temporary file  Simple markdown and HTML are supported  Emoji in messages First of all : Nedd to install python (>3) on Cent os  # yum -y install python-pip # yum install -y https://centos7.iuscommunity.org/ius-release.rpm #  yum install -y python34u python34u-libs python34u-devel python34u-pi # yum -y install python-pip You need to install the  requests  module for python, this is required for operation! # pip install requests Put  zbxtg.py  in your  AlertScriptsPath  directory, the path is set inside your zabbix_server.conf (once confirm by zabbix server conf file ) Link to download ZBXTG.PY file  https://drive.google.com/open?i...