{"id":4672,"date":"2019-12-23T22:58:15","date_gmt":"2019-12-23T13:58:15","guid":{"rendered":"https:\/\/kumapress.com\/?p=4672"},"modified":"2019-12-23T22:58:28","modified_gmt":"2019-12-23T13:58:28","slug":"zabbix4-4%e3%81%a7postgresql%e3%82%92%e7%9b%a3%e8%a6%96%e3%81%99%e3%82%8bpg_monz","status":"publish","type":"post","link":"https:\/\/kumapress.com\/?p=4672","title":{"rendered":"Zabbix4.4\u3067PostgreSQL\u3092\u76e3\u8996\u3059\u308b(pg_monz)"},"content":{"rendered":"<p>\u3053\u306ezabbix\u30b5\u30fc\u30d0\u30fc\u3082\u305d\u3046\u306a\u3093\u3067\u3059\u304c\u3001\u79c1\u304c\u62c5\u5f53\u3059\u308bWeb\u30b5\u30fc\u30d3\u30b9\u306f\u3001\u6307\u5b9a\u304c\u306a\u3051\u308c\u3070PostgreSQL\u3067\u4f5c\u6210\u3092\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u308f\u3051\u3067\u3001\u6700\u521d\u304b\u3089PostgreSQL\u306e\u76e3\u8996\u306f\u4e88\u5b9a\u3092\u3057\u3066\u3044\u305f\u9805\u76ee\u3067\u3059\u3002<\/p>\n<p>Postgresql\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8(pg_monz)\u3092\u5229\u7528\u3057\u307e\u3059\uff01<\/p>\n<p>\u30db\u30b9\u30c8\u3068\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u4e21\u65b9\u306b\u8a2d\u5b9a\u304c\u5fc5\u8981\u3067\u3059\u306e\u3067\u3001\u5206\u3051\u3066\u89e3\u8aac\u3057\u307e\u3059(^^)<\/p>\n<p>\u53c2\u8003\uff1a<a href=\"http:\/\/pg-monz.github.io\/pg_monz\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span style=\"font-weight: 400;\">PostgreSQL monitoring template for Zabbix (pg_monz)<\/span><\/a><\/p>\n\n\n<h2 class=\"wp-block-heading\">\u6e96\u5099<\/h2>\n\n\n<p>\uff11\uff09<a href=\"https:\/\/github.com\/pg-monz\/pg_monz\" target=\"_blank\" rel=\"noopener noreferrer\">github<\/a>\u304b\u3089\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9<\/p>\n<p>\u203b\u3053\u308c\u306f\u3001\u30db\u30b9\u30c8\u3082\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3082\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>(\u4eca\u56de\u306fVer2.2)<br \/>\u8981\u4ef6<br \/>* Zabbix server, zabbix agent, zabbix sender 2.0 \u4ee5\u4e0a<br \/>* PostgreSQL 9.2 \u4ee5\u4e0a<br \/>* pgpool-II 3.4.0 \u4ee5\u4e0a<\/p>\n<p>\uff12\uff09\u89e3\u51cd\u3059\u308b\u3068\u4e0b\u8a18\u304c\u5c55\u958b\u3055\u308c\u308b<br \/>LICENSE<br \/>README-en.md<br \/>README.md<br \/>pg_monz<br \/>\u3000template\u3000\u3000\u3000 \uff1a\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u96c6<br \/>\u3000\u3000Template_App_PostgreSQL.xml\u3000\u3000\u3000\u3000\u3000\u3000 \uff1aPostgreSQL\u30b5\u30fc\u30d0\u5358\u4f53\u306e\u7a3c\u50cd\u76e3\u8996\u7528<br \/>\u3000\u3000Template_App_PostgreSQL_SR.xml\u3000\u3000\u3000\u3000\u3000\uff1aStreaming Replication\u7a3c\u50cd\u76e3\u8996\u7528<br \/>\u3000\u3000Template_App_PostgreSQL_SR_Cluster.xml\u3000\uff1aStreaming Replication\u306e\u30af\u30e9\u30b9\u30bf\u5168\u4f53\u3067\u306e\u7a3c\u50cd\u72b6\u6cc1\u76e3\u8996\u7528<br \/>\u3000\u3000Template_App_pgpool-II.xml\u3000\u3000\u3000\u3000\u3000\u3000\u3000\uff1apgpool-II (pgpool-II 3.5 \u4ee5\u524d) \u7a3c\u50cd\u76e3\u8996\u7528<br \/>\u3000\u3000Template_App_pgpool-II-36.xml\u3000\u3000\u3000\u3000\u3000 \uff1apgpool-II (pgpool-II 3.6 \u4ee5\u964d) \u7a3c\u50cd\u76e3\u8996\u7528<br \/>\u3000\u3000Template_App_pgpool-II_watchdog.xml\u3000\u3000 \uff1apgpool-II\u306e\u30af\u30e9\u30b9\u30bf\u5168\u4f53\u3067\u306e\u7a3c\u50cd\u72b6\u6cc1\u76e3\u8996\u7528<br \/>\u3000usr-local-bin\u3000\u3000\uff1a\/usr\/local\/bin\u306b\u30b3\u30d4\u30fc\u3059\u308b\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u51e6\u7406\u30b9\u30af\u30ea\u30d7\u30c8\u7fa4<br \/>\u3000usr-local-etc\u3000\u3000\uff1a\/usr\/local\/etc\u306b\u30b3\u30d4\u30fc\u3059\u308b\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u51e6\u7406\u7528\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u7fa4<br \/>\u3000\u3000pgpool_funcs.conf<br \/>\u3000\u3000pgsql_funcs.conf<br \/>\u3000zabbix_agentd.d\u3000\uff1aZabbixAgent\u306b\u8ffd\u52a0\u3059\u308bUserParameter\u5b9a\u7fa9\u30d5\u30a1\u30a4\u30eb<br \/>\u3000\u3000userparameter_pgsql.conf<br \/>quick-install.txt\u3000\uff1a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6848\u5185<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u30db\u30b9\u30c8\u5074\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n\n<p>Zabbix\u306eWeb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306b\u30ed\u30b0\u30a4\u30f3\u3057\u3001\u4ee5\u4e0b\u306e\u624b\u9806\u3067\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<\/p>\n<p>1)[\u8a2d\u5b9a] &#8211; [\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8]\u3092\u9078\u629e\u3057\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u4e00\u89a7\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>2)\u753b\u9762\u53f3\u4e0a\u306e[\u30a4\u30f3\u30dd\u30fc\u30c8]\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u8868\u793a\u3055\u308c\u308b\u753b\u9762\u3067\u3001xml\u30d5\u30a1\u30a4\u30eb\u3092\u9806\u756a\u306b\u30a4\u30f3\u30dd\u30fc\u30c8\u3057\u307e\u3059\u3002<br \/>\u3000\u5bfe\u8c61\u306exml\u30d5\u30a1\u30a4\u30eb\u306fpg-monz\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u300cTemplate\u300d\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u914d\u4e0b\u306b\u683c\u7d0d\u3055\u308c\u3066\u3044\u308b\u5168\u3066\u306exml\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<br \/>3)\u30a4\u30f3\u30dd\u30fc\u30c8\u306b\u6210\u529f\u3059\u308b\u3068\u3001\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u4e00\u89a7\u306bpgmonz\u306etemplate\u985e\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30de\u30af\u30ed\u306e\u8a2d\u5b9a<\/h3>\n\n\n\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30de\u30af\u30ed\u306e\u5024\u3092\u5fc5\u8981\u306b\u5fdc\u3058\u3066\u4fee\u6b63\u3057\u307e\u3059\u3002<br \/>Zabbix\u306eWeb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u306e[\u8a2d\u5b9a]\u2192[\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8]\u2192[\u30de\u30af\u30ed]\u3092\u9078\u629e\u3057\u3001\u5024\u3092\u4fee\u6b63\u5f8c\u3001[\u4fdd\u5b58]\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u30fbTemplate App PostgreSQL<\/p>\n<table style=\"border-collapse: collapse; width: 100%; height: 709px;\">\n<tbody>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; text-align: center; height: 53px;\"><strong>\u30de\u30af\u30ed<\/strong><\/td>\n<td style=\"width: 22.7778%; text-align: center; height: 53px;\"><strong>\u30c7\u30d5\u30a9\u30eb\u30c8\u5024<\/strong><\/td>\n<td style=\"width: 47.7777%; text-align: center; height: 53px;\"><strong>\u8aac\u660e<\/strong><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGCACHEHIT_THRESHOLD}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">90<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">\u30ad\u30e3\u30c3\u30b7\u30e5\u30d2\u30c3\u30c8\u7387\u30c8\u30ea\u30ac\u30fc\u95be\u5024\uff08%)<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGCHECKPOINTS_THRESHOLD}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">10<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">checkpoint\u767a\u751f\u983b\u5ea6\u30c8\u30ea\u30ac\u30fc\u95be\u5024\uff08\u56de\u6570\/\u76e3\u8996\u9593\u9694\uff09<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGCONNECTIONS_THRESHOLD}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">95<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u6570\u30c8\u30ea\u30ac\u30fc\u95be\u5024<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGDBSIZE_THRESHOLD} <\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">1073741824<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u30b5\u30a4\u30ba\u30c8\u30ea\u30ac\u30fc\u95be\u5024\uff08byte\uff09<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGDEADLOCK_THRESHOLD}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">0<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">\u30c7\u30c3\u30c9\u30ed\u30c3\u30af\u767a\u751f\u30c8\u30ea\u30ac\u30fc\u95be\u5024\uff08\u56de\u6570\uff09<\/span><\/td>\n<\/tr>\n<tr style=\"height: 73px;\">\n<td style=\"width: 29.4444%; height: 73px;\"><span style=\"font-size: 10pt;\">{$PGLOGDIR}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 73px;\"><span style=\"font-size: 10pt;\">\/usr\/local\/pgsql\/data\/pg_log<\/span><br \/><span style=\"font-size: 10pt;\">\u2192\/var\/log\/pgsql<\/span><\/td>\n<td style=\"width: 47.7777%; height: 73px;\"><span style=\"font-size: 10pt;\">PostgreSQL\u30ed\u30b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/span><br \/><span style=\"font-size: 10pt;\">\u79fb\u52d5\u3055\u305b\u307e\u3057\u305f(^^)<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGSCRIPTDIR}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">\/usr\/local\/bin<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">pg-monz\u30b9\u30af\u30ea\u30d7\u30c8\u914d\u7f6e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGSCRIPT_CONFDIR}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">\/usr\/local\/etc<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">pg-monz\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u914d\u7f6e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGSLOWQUERY_TIME_THRESHOLD}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">10<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">\u4f55\u79d2\u4ee5\u4e0a\u306e\u30af\u30a8\u30ea\u3092Slow_Query\u3068\u3059\u308b\u304b\uff08\u79d2\uff09<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGSLOWQUERY_COUNT_THRESHOLD}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">10<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">slow_query\u30c8\u30ea\u30ac\u30fc\u95be\u5024\uff08\u4ef6\u6570\uff09<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$PGTEMPBYTES_THRESHOLD}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">8388608<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">\u4e00\u6b21\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba\u30c8\u30ea\u30ac\u30fc\u95be\u5024\uff08byte\uff09<\/span><\/td>\n<\/tr>\n<tr style=\"height: 53px;\">\n<td style=\"width: 29.4444%; height: 53px;\"><span style=\"font-size: 10pt;\">{$ZABBIX_AGENTD_CONF}<\/span><\/td>\n<td style=\"width: 22.7778%; height: 53px;\"><span style=\"font-size: 10pt;\">\/etc\/zabbix\/zabbix_agentd.conf<\/span><\/td>\n<td style=\"width: 47.7777%; height: 53px;\"><span style=\"font-size: 10pt;\">zabbix_agentd.conf\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<h3 class=\"wp-block-heading\">\u30db\u30b9\u30c8\u306e\u4f5c\u6210<\/h3>\n\n\n<p>1) [\u8a2d\u5b9a] &#8211; [\u30db\u30b9\u30c8]\u3092\u9078\u629e\u3057\u3001\u30db\u30b9\u30c8\u4e00\u89a7\u3092\u8868\u793a\u3057\u307e\u3059\u3002<br \/>2) \u53f3\u4e0a\u306e[\u30db\u30b9\u30c8\u306e\u4f5c\u6210]\u3092\u30af\u30ea\u30c3\u30af\u3057PostgreSQL\u30b5\u30fc\u30d0\u306e\u30db\u30b9\u30c8\u540d\u7b49\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002<br \/>3) [\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8] &#8211; [\u65b0\u898f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u30ea\u30f3\u30af]\u3088\u308a\u3001\u9069\u7528\u3059\u308b\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8(\u203b\uff09\u3092\u691c\u7d22\u3057\u3066[\u8ffd\u52a0]\u3001[\u4fdd\u5b58]\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<br \/>\u3000\u203b\u300cTemplate App PostgreSQL\u300d\u304b\u300cTemplate App PostgreSQL SR\u300d\u306e\u3044\u305a\u308c\u304b<br \/>4) [\u8a2d\u5b9a] &#8211; [\u30db\u30b9\u30c8\u30b0\u30eb\u30fc\u30d7] &#8211; [\u30db\u30b9\u30c8\u30b0\u30eb\u30fc\u30d7\u306e\u4f5c\u6210]\u3092\u30af\u30ea\u30c3\u30af\u3057\u3001\u30b0\u30eb\u30fc\u30d7\u540d\u306b\u300cPostgreSQL\u300d\u3068\u3057\u307e\u3059\u3002<br \/>5) PostgreSQL\u30db\u30b9\u30c8\u3092\u8ffd\u52a0\u3057\u3001[\u4fdd\u5b58]\u3092\u30af\u30ea\u30c3\u30af\u3057\u307e\u3059\u3002<\/p>\n<p>\u5404\u30b0\u30eb\u30fc\u30d7\u306f{$HOST_GROUP} template macro\u3092\u4f7f\u3063\u3066\u3001<br \/>\u3000Template_App_PostgreSQL_SR_Cluster.xml<br \/>\u3000Template_App_pgpool-II_watchdog.xml<br \/>\u306b\u3088\u3063\u3066\u3001\u53c2\u7167\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>6)zabbix_agentd.conf\u306e\u30d5\u30a1\u30a4\u30eb\u30d1\u30b9\u3092\u78ba\u8a8d\u3059\u308b<br \/>zabbix_agentd.conf\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\/etc\/zabbix\/zabbix_agentd.conf\u3067\u306f\u306a\u3044\u5834\u5408\u3001<br \/>\u30db\u30b9\u30c8\u306e\u30de\u30af\u30ed\u306b{$ ZABBIX_AGENTD_CONF}\u30de\u30af\u30ed\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<\/p>\n<p>\uff03zabbix_agentd.conf\u30d1\u30b9\u306e\u5b9a\u7fa9\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30de\u30af\u30ed\u306b\u3042\u308a\u307e\u3059\u3002<br \/>{$ZABBIX_AGENTD_CONF} =&gt; \/etc\/zabbix\/zabbix_agentd.conf<\/p>\n\n\n<h2 class=\"wp-block-heading\">\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u5074\u306e\u8a2d\u5b9a<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6e96\u5099<\/h3>\n\n\n<p>\u3053\u3053\u306f\u3001\u30db\u30b9\u30c8\u5074\u3068\u540c\u3058\u3067\u3059\u3002<\/p>\n\n\n<h3 class=\"wp-block-heading\">\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n\n\n<p><strong>\uff11\uff09usr-local-etc\/* \u3092 \/usr\/local\/etc\u306b\u30b3\u30d4\u30fc\u3059\u308b<\/strong> <br \/>\u30fbpgsql_funcs.conf\u306e\u30c7\u30d5\u30a9\u30eb\u30c8<br \/>&#8212;-<br \/>PGHOST=127.0.0.1<br \/>PGPORT=5432<br \/>PGROLE=postgres<br \/>PGDATABASE=postgres<br \/>&#8212;-<\/p>\n<p>\u30fbpgpool_funcs.con\u306e\u30c7\u30d5\u30a9\u30eb\u30c8<br \/>&#8212;-<br \/>PGPOOLHOST=127.0.0.1<br \/>PGPOOLPORT=9999<br \/>PGPOOLROLE=postgres<br \/>PGPOOLDATABASE=postgres<br \/>PGPOOLCONF=\/usr\/local\/etc\/pgpool.conf<br \/>&#8212;-<br \/>\uff08*\uff09\u69cb\u6210\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5b9a\u7fa9\u306f\u3001tempalte\u30de\u30af\u30ed\u306b\u3042\u308a\u307e\u3059\u3002<br \/>{$PGSCRIPT_CONFDIR}<br \/>{$PGPOOLSCRIPTS_CONFDIR}<\/p>\n<p>\u25cbPostgreSQL \u306b\u63a5\u7d9a\u3059\u308b\u3068\u304d\u306b\u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5fc5\u8981\u306a\u5834\u5408\u306e\u51e6\u7406<br \/>\u30fb\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb pgsql_funcs.conf \u306b \u4ee5\u4e0b\u306e\u4e00\u884c\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>export PGPASSFILE=\/usr\/local\/etc\/pgpass<\/p>\n<p>\u30fb\u8a2d\u5b9a\u5185\u5bb9\u306b\u5408\u308f\u305b\u3066pgpass\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<br \/>127.0.0.1:5432:*:postgres:\u30d1\u30b9\u30ef\u30fc\u30c9<\/p>\n<p>\u30fbZabbix \u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u306e\u8d77\u52d5\u30e6\u30fc\u30b6\u306e\u307f\u306b\u6a29\u9650\u3092\u4ed8\u4e0e\u3057\u307e\u3059<br \/>chmod 600 \/usr\/local\/etc\/pgpass<\/p>\n<p><strong>\uff12\uff09usr-local-bin\/* \u3092 \/usr\/local\/bin\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059<\/strong><\/p>\n<p># cp usr-local-bin\/* \/usr\/local\/bin <br \/># chmod +x \/usr\/local\/bin\/*.sh<\/p>\n<p>*\uff09scripts\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5b9a\u7fa9\u306f\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30de\u30af\u30ed\u306b\u3042\u308a\u307e\u3059\u3002<br \/>{$PGSCRIPTDIR}<br \/>{$PGPOOLSCRIPTDIR}<\/p>\n<p><strong>\uff13\uff09userparameter_pgsql.conf\u3092\u914d\u7f6e\u3057\u307e\u3059<\/strong><\/p>\n<p>\u76e3\u8996\u5bfe\u8c61\u30b5\u30fc\u30d0\u4e0a\u306e\u6240\u5b9a\u306e\u5834\u6240\u306b\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<br \/>\u4f8b\u3048\u3070\u3001 Zabbix\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u304c \/etc\/zabbix\/\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u306f\u3001\u4ee5\u4e0b\u306e\u5834\u6240\u306b\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<br \/>\/etc\/zabbix\/zabbix_agentd.conf.d\/userparameter_pgsql.conf<\/p>\n<p>\u4e0a\u8a18\u30d5\u30a1\u30a4\u30eb\u304c\u8aad\u307f\u8fbc\u307e\u308c\u308b\u3088\u3046 zabbix_agentd.conf \u3067Include \u8a2d\u5b9a\u3092\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>\u203b\u8a2d\u5b9a\u306e\u53cd\u6620\u306b\u306f\u518d\u8d77\u52d5\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>Include=\/etc\/zabbix\/zabbix_agentd.conf.d\/<\/p>\n\n\n<h3 class=\"wp-block-heading\">\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u518d\u8d77\u52d5<\/h3>\n\n\n\n<p># systemctl restart zabbix-agent<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30c8\u30e9\u30d6\u30eb\u3067\u3059\uff01<\/h3>\n\n\n\n<p>\u3068\u3001\u3053\u3053\u307e\u3067\u306f\u6a19\u6e96\u7684\u306a\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u624b\u9806\u3002<br \/>\u3067\u52d5\u304b\u3057\u3066\u307f\u308b\u3068 \/var\/log\/zabbix\/zabbix_agent_log\u306b\u4e0b\u8a18\u306e\u30a8\u30e9\u30fc\u304c\u5c71\u76db\u308a\u3002\u3002\u3002<br \/>882:20191222:065250.767 active check &#8220;logrt[&#8220;\/var\/lib\/pgsql\/12\/data\/log\/postgresql-.*\\.log&#8221;,&#8221;PANIC|FATAL|ERROR|[Ee]rror&#8221;]&#8221; is not supported: Cannot obtain directory information: [13] Permission denied<\/p>\n<p>\u3088\u3046\u3059\u308b\u306b\u30ed\u30b0\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u30d1\u30fc\u30df\u30f3\u30b7\u30e7\u30f3\u304cNG\u3063\u3066\u3053\u3068\u3067\u3059\u306d\u3002<br \/>\u78ba\u8a8d\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p># ls -al \/var\/lib\/pgsql\/12\/data<br \/>drw&#8212;&#8212;- 2 postgres postgres 4096 12\u6708 23 00:00 log<\/p>\n<p># ls -al log<br \/>\u5408\u8a08 24<br \/>drw&#8212;&#8212;- 2 postgres postgres 4096 12\u6708 23 00:00 .<br \/>drwx&#8212;&#8212; 20 postgres postgres 4096 12\u6708 23 12:49 ..<br \/>-rw&#8212;&#8212;- 1 postgres postgres 984 12\u6708 20 17:06 postgresql-Fri.log<br \/>-rw&#8212;&#8212;- 1 postgres postgres 0 12\u6708 23 00:00 postgresql-Mon.log<br \/>-rw&#8212;&#8212;- 1 postgres postgres 6139 12\u6708 21 23:51 postgresql-Sat.log<br \/>-rw&#8212;&#8212;- 1 postgres postgres 0 12\u6708 22 00:00 postgresql-Sun.log<br \/>-rw&#8212;&#8212;- 1 postgres postgres 2062 12\u6708 19 23:20 postgresql-Thu.log<\/p>\n<p>\u3053\u308c\u3067\u306f\u30e6\u30fc\u30b6\u30fczabbix\u3067\u306f\u8aad\u307f\u51fa\u305b\u306a\u3044\u3067\u3059\u3002\u3002\u3002<br \/>\u5bfe\u7b56\u3068\u3057\u3066\u306f\uff12\u3064<br \/>\uff11\u3064\u3081\uff1a\u3053\u306e\u8a2d\u5b9a\u3067zabbix\u30e6\u30fc\u30b6\u30fc\u3067\u8aad\u307f\u51fa\u305b\u308b\u3088\u3046\u306b\u3059\u308b<br \/>\u3000\u6a29\u9650\u5909\u3048\u305f\u3089\u884c\u3051\u308b\u306e\u304b\u306a\uff1f\uff1f\uff1f<br \/>\uff12\u3064\u3081\uff1a\u305f\u3068\u3048\u3070\/var\/log\u4ee5\u4e0b\u306b\u30ed\u30b0\u3092\u79fb\u52d5\u3059\u308b\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4eca\u56de\u306f2\u3064\u76ee\u3092\u63a1\u7528\u3057\u307e\u3057\u305f\u3002<\/h4>\n\n\n<p>\u201c\/var\/log\/pgsql\u201d\u306b\u30ed\u30b0\u3092\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<p># mkdir \/var\/log\/pgsql<\/p>\n<p># vi \/var\/lib\/pgsql\/12\/data\/postgresql.conf<\/p>\n<p>log_director=\u2019log\u2019 <br \/>\u2192 log_director=\u2019\/var\/log\/pgsql\u2019<\/p>\n<p>log_file_mode=\u20190600\u2019<br \/>\u2192 log_file_mode=\u20190644\u2019<\/p>\n<p>\u203b\u76f8\u5bfe\u30d1\u30b9\u3060\u3068{PGDATA}\u914d\u4e0b\u306b\u8a2d\u7f6e\u3055\u308c\u3066\u3057\u307e\u3046<\/p>\n<p>\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306e{$PGLOGDIR}\u306e\u5024\u3092\u5909\u66f4\u3057\u307e\u3059\u3002<\/p>\n<p>\u30a8\u30fc\u30b8\u30a7\u30f3\u30c8\u3092\u518d\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n\n\n<h4 class=\"wp-block-heading\">\u3084\u3063\u3071\u308a\u306a\u3093\u304b\u8d77\u3053\u308a\u307e\u3059(^^;<\/h4>\n\n\n\n<p>\u300c\/ var \/ log \/ pgsql \/\u300d\u306e\u300cpostgresql-\u3002* \\\u3002log\u300d\u306b\u4e00\u81f4\u3059\u308b\u6700\u8fd1\u5909\u66f4\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n<p>\u306a\u3093\u304b\u3001\u30ed\u30b0\u3092\u51fa\u3059\u307e\u3067\u5909\u308f\u3089\u306a\u3044\u306e\u304b\u306a\u3041\u3002\u3002\u3002<\/p>\n<p>\u3063\u3066\u308f\u3051\u3067\u3001postgresql\u3092\u518d\u8d77\u52d5\u3057\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3089\u3001\u3067\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002\u3002\u3002<\/p>\n<p>\u306a\u3093\u3084\u3053\u308cww<\/p>\n<aside class=\"row veu_insertAds after\"><div class=\"col-md-6\"><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u7b2c 1 \u9762 - 2\uff08www.kumapress.com\uff09 -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-5987681888830890\"\r\n     data-ad-slot=\"5379270693\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script><\/div><div class=\"col-md-6\"><script async src=\"https:\/\/pagead2.googlesyndication.com\/pagead\/js\/adsbygoogle.js\"><\/script>\r\n<!-- \u7b2c 1 \u9762 - 1\uff08www.kumapress.com\uff09 -->\r\n<ins class=\"adsbygoogle\"\r\n     style=\"display:block\"\r\n     data-ad-client=\"ca-pub-5987681888830890\"\r\n     data-ad-slot=\"7353370294\"\r\n     data-ad-format=\"auto\"\r\n     data-full-width-responsive=\"true\"><\/ins>\r\n<script>\r\n     (adsbygoogle = window.adsbygoogle || []).push({});\r\n<\/script><\/div><\/aside>","protected":false},"excerpt":{"rendered":"<p>\u3053\u306ezabbix\u30b5\u30fc\u30d0\u30fc\u3082\u305d\u3046\u306a\u3093\u3067\u3059\u304c\u3001\u79c1\u304c\u62c5\u5f53\u3059\u308bWeb\u30b5\u30fc\u30d3\u30b9\u306f\u3001\u6307\u5b9a\u304c\u306a\u3051\u308c\u3070PostgreSQL\u3067\u4f5c\u6210\u3092\u3057\u3066\u3044\u307e\u3059\u3002 \u305d\u3093\u306a\u308f\u3051\u3067\u3001\u6700\u521d\u304b\u3089PostgreSQL\u306e\u76e3\u8996\u306f\u4e88\u5b9a\u3092\u3057\u3066\u3044\u305f\u9805\u76ee\u3067\u3059\u3002 Postgres [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vkexunit_cta_each_option":"","footnotes":""},"categories":[126],"tags":[48,158],"class_list":["post-4672","post","type-post","status-publish","format-standard","hentry","category-blog-memo","tag-postgresql","tag-zabbix"],"_links":{"self":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts\/4672","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4672"}],"version-history":[{"count":11,"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts\/4672\/revisions"}],"predecessor-version":[{"id":4683,"href":"https:\/\/kumapress.com\/index.php?rest_route=\/wp\/v2\/posts\/4672\/revisions\/4683"}],"wp:attachment":[{"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4672"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4672"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kumapress.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4672"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}