天天看點

Zabbix監控PostgreSQL

環境: 

CentOS6.8 

Zabbix3.2.1 

PostgreSQL9.5.6

根據官方文檔進行安裝即可。 

<a href="http://cavaliercoder.com/libzbxpgsql/documentation/module-installation/" target="_blank">http://cavaliercoder.com/libzbxpgsql/documentation/module-installation/</a>

<a href="https://s5.51cto.com/wyfs02/M02/8E/5C/wKiom1i-aY_hmZxtAAB_2n7Qs2Y345.png" target="_blank"></a>

建立一個使用者,開放你所要監控的資料庫隻讀權限給它,為了安全,把權限做到最小化。 

我用的pgpool-II。

使用建立的使用者能登入檢視相應資料庫,則可進行下一步。

模闆在Github上有: 

<a href="https://github.com/cavaliercoder/libzbxpgsql/tree/master/templates" target="_blank">https://github.com/cavaliercoder/libzbxpgsql/tree/master/templates</a>

5. 主機連結模闆,設定宏變量

<a href="https://s5.51cto.com/wyfs02/M01/8E/5C/wKiom1i-aZ6QdrN5AAB-yrm0VAE937.png" target="_blank"></a>

<a href="https://s3.51cto.com/wyfs02/M01/8E/5A/wKioL1i-aa3zryYfAAB46Qvnf1Q196.png" target="_blank"></a>

<code>{$PG_CONN} =&gt; host=localhost port=54321 user=monitoring connect_timeout=10</code>  <code>{$PG_DB} =&gt; wiseucmsg</code>

<a href="https://s4.51cto.com/wyfs02/M00/8E/5C/wKiom1i-ac6A-Sd3AAKf9g2ginI969.png" target="_blank"></a>

有圖形出現,則監控成功。

本文轉自 ygqygq2 51CTO部落格,原文連結:http://blog.51cto.com/ygqygq2/1903989,如需轉載請自行聯系原作者