{"id":560,"date":"2021-06-28T11:30:31","date_gmt":"2021-06-28T03:30:31","guid":{"rendered":"https:\/\/twocups.cn\/?p=560"},"modified":"2021-06-28T19:19:11","modified_gmt":"2021-06-28T11:19:11","slug":"42","status":"publish","type":"post","link":"https:\/\/twocups.cn\/index.php\/2021\/06\/28\/42\/","title":{"rendered":"\u3010Zabbix\u7cfb\u5217\u3011\u7b2c\u4e94\u7ae0\uff1a\u4f7f\u7528Elasticsearch\u4f5c\u4e3aZabbix\u540e\u7aef\u6570\u636e\u5e93"},"content":{"rendered":"\n<p><img width=\"80\" src=\"https:\/\/twocups.cn\/wp-content\/uploads\/2019\/12\/logo%E6%A8%AA.png\" alt=\"\">\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff1a<a href=\"https:\/\/twocups.cn\/index.php\/2021\/06\/28\/42\/\">https:\/\/twocups.cn\/index.php\/2021\/06\/28\/42\/<\/a><\/p>\n\n\n\n<p class=\"has-text-align-left\"><strong>Zabbix \u5b98\u65b9\u914d\u7f6e\uff1a<a href=\"https:\/\/www.zabbix.com\/documentation\/5.0\/zh\/manual\/appendix\/install\/elastic_search_setup\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.zabbix.com\/documentation\/5.0\/zh\/manual\/appendix\/install\/elastic_search_setup<\/a><\/strong><\/p>\n\n\n\n<h2>\u4e8b\u5148\u51c6\u5907<\/h2>\n\n\n\n<p>\u6ca1\u6709\u88c5\u597d Elasticsearch\uff08\u4ee5\u4e0b\u7b80\u79f0 es\uff09\u7684\u53ef\u4ee5\u53bb\u770b\u4e0b\u6211\u4e4b\u524d\u7684<a href=\"https:\/\/twocups.cn\/index.php\/2021\/02\/20\/24\/\">Elastic Stack\u7cfb\u5217<\/a>\uff0c\u91cc\u9762\u6709\u8bb2\u5230 es \u662f\u5982\u4f55\u5b89\u88c5\u5e76\u90e8\u7f72\u7684\u3002es \u7684\u9ed8\u8ba4\u7aef\u53e3\u662f9200\uff0c\u4f46\u662f\u6211\u662f\u5728\u516c\u53f8\u7684\u6d4b\u8bd5\u73af\u5883\u91cc\u90e8\u7f72\u7684\uff0c\u5e76\u4e14\u53c8\u60f3\u80fd\u5728\u529e\u516c\u684c\u9762\u76f4\u63a5\u8bbf\u95ee\u5230 es\uff0c\u6240\u4ee5\u628a es \u7684\u7aef\u53e3\u6539\u6210\u4e868080\u3002\u4e0d\u540c\u516c\u53f8\u7684\u5185\u90e8\u6d4b\u8bd5\u4e91\u73af\u5883\u90fd\u662f\u4e0d\u540c\u7684\uff0c\u963f\u91cc\u4e91\u53eb\u5b64\u5c9b\uff0c\u817e\u8baf\u53eb DevCloud\u3002\u8fd9\u7c7b\u73af\u5883\u662f\u4e13\u95e8\u7528\u4e8e\u6d4b\u8bd5\u7684\uff0c\u548c\u6b63\u5f0f\u7684\u7ebf\u4e0a\u73af\u5883\u5f88\u50cf\uff0c\u4e0d\u8fc7\u4f1a\u653e\u66f4\u591a\u7684\u6743\u9650\u7ed9\u5f00\u53d1\u8005\u7528\u4e8e\u8c03\u8bd5\u3002\u8fd9\u4e9b\u73af\u5883\u90fd\u4e0d\u80fd\u76f4\u63a5\u8bbf\u95ee\uff0c\u90fd\u9700\u8981\u5148\u767b\u9646\u4ee3\u7406\uff0c\u7136\u540e\u901a\u8fc7\u4ee3\u7406\u53bb\u8bbf\u95ee\u3002\u8fd9\u5c31\u5bfc\u81f4\u4e86\u5728\u529e\u516c\u684c\u9762\u662f\u65e0\u6cd5\u76f4\u63a5\u8bbf\u95ee\u5230\u6d4b\u8bd5\u73af\u5883\u91cc\u7684\u7aef\u53e3\uff0c\u4f46\u6709\u51e0\u4e2a\u7aef\u53e3\u662f\u88ab\u653e\u51fa\u6765\u7684\uff0c\u6bd4\u5982\u6211\u5c06 es \u90e8\u7f72\u5230\u76848080\u7aef\u53e3\u3002es \u4fee\u6539\u7aef\u53e3\u7684\u65b9\u6cd5\u6211\u5728 <a href=\"https:\/\/twocups.cn\/index.php\/2021\/02\/22\/26\/\">es \u90e8\u7f72<\/a>\u90a3\u4e00\u7ae0\u63d0\u5230\u8fc7\uff0c\u5982\u679c es \u8fd8\u6ca1\u6709\u90e8\u7f72\u597d\u7684\uff0c\u53ef\u4ee5\u79fb\u6b65\u53bb\u770b\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>Eticsearch \u7248\u672c\uff1a7.13.1\uff0c\u7aef\u53e3\uff1a8080<\/p>\n\n\n\n<p>Zabbix \u7248\u672c\uff1a5.0 LTS\uff0c\u7aef\u53e3\uff1a80\/zabbix<\/p>\n\n\n\n<h2>Elasticsearch\u4e2d\u7684\u6570\u636e\u5b58\u50a8<\/h2>\n\n\n\n<p>\u539f\u6765\u6211\u4eec Zabbix \u7684\u6570\u636e\u662f\u5b58\u50a8\u5728 MariaDB \u4e2d\u7684\uff0c\u6309\u7167\u6570\u636e\u683c\u5f0f\u7684\u4e0d\u540c\u5206\u522b\u5b58\u50a8\u7684\u4e94\u4e2a\u8868\u4e2d\uff1ahistory\u3001history_uint\u3001history_str\u3001history_log\u3001history_text\u3002\u8fd9\u4e94\u4e2a\u8868\u548c es \u4e2d\u76f8\u5bf9\u5e94\u7684\u7d22\u5f15\u5173\u7cfb\u5982\u4e0b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>\u6570\u636e\u7c7b\u578b<\/th><th>zabbix\u6570\u636e\u5e93\u8868<\/th><th>es\u7d22\u5f15\u7c7b\u578b<\/th><\/tr><\/thead><tbody><tr><td>\u6570\u5b57\uff08\u65e0\u7b26\u53f7\uff09<\/td><td>history_uint<\/td><td>uint<\/td><\/tr><tr><td>\u6570\u5b57\uff08\u6d6e\u70b9\u578b\uff09<\/td><td>history<\/td><td>dbl<\/td><\/tr><tr><td>\u5b57\u7b26<\/td><td>history_str<\/td><td>str<\/td><\/tr><tr><td>\u65e5\u5fd7<\/td><td>history_log<\/td><td>log<\/td><\/tr><tr><td>\u6587\u672c<\/td><td>history_text<\/td><td>text<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u7b80\u5355\u89e3\u91ca\u4e00\u4e0b\uff0c\u5b57\u7b26\u5c31\u662f\u77ed\u7684\u8bcd\u8bed\uff0c\u6587\u672c\u5c31\u662f\u957f\u7684\u53e5\u5b50\uff0c\u65e5\u5fd7\u662f\u6570\u636e\u672c\u8eab\u6709\u4e0d\u540c\u5c5e\u6027\uff0c\u53ef\u4ee5\u88ab\u76f4\u63a5\u4e00\u5217\u4e00\u5217\u5c55\u793a\u51fa\u6765\u7684\u3002<\/p>\n\n\n\n<p>\u5f53\u6211\u4eec\u628a Zabbix \u7684\u6570\u636e\u5b58\u50a8\u5230 es \u4e4b\u540e\uff0c\u539f\u6765\u7684 MariaDB \u4e2d\u7684\u8fd9\u4e94\u4e2a\u6570\u636e\u5e93\u8868\u5c31\u4e0d\u518d\u5199\u5165\u65b0\u7684\u6570\u636e\u4e86\u3002<\/p>\n\n\n\n<h2>\u5728Elasticsearch\u4e2d\u521b\u5efa\u7d22\u5f15<\/h2>\n\n\n\n<p>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5728 es \u4e2d\u521b\u5efa Zabbix \u9700\u8981\u7684\u7d22\u5f15\u7528\u4ee5\u63a5\u53d7\u6570\u636e\uff0c\u8fd9\u662f\u5fc5\u987b\u8981\u7b2c\u4e00\u6b65\u505a\u7684\u3002\u5426\u5219\u5982\u679c\u6211\u4eec\u5148\u5728 Zabbix \u90a3\u8fb9\u8bbe\u7f6e\u597d\u8fde\u5165 es\uff0c\u90a3\u4e48 Zabbix \u81ea\u7136\u5c31\u4f1a\u53d1\u73b0 es \u4e2d\u6ca1\u6709\u76f8\u5e94\u7684\u7d22\u5f15\uff0c\u5c31\u4f1a\u76f4\u63a5\u5728 es \u4e2d\u521b\u5efa\u76f8\u5e94\u7684\u7d22\u5f15\u3002\u5728\u8fd9\u4e2a\u81ea\u52a8\u521b\u5efa\u7684\u7d22\u5f15\u4e2d\uff0c\u6570\u636e\u7684 clock \u662f Unix \u65f6\u95f4\uff0c\u6211\u4eec\u540e\u7eed\u7684 Kibana \u548c Zabbix Web \u662f\u65e0\u6cd5\u6b63\u5e38\u663e\u793a\u7684\u3002<\/p>\n\n\n\n<p>\u6240\u4ee5\uff0c\u6211\u4eec\u7b2c\u4e00\u6b65\u5fc5\u987b\u5148\u5728 es \u4e2d\u624b\u52a8\u521b\u5efa\u76f8\u5e94\u7684\u7d22\u5f15\u3002\u5982\u679c\u521b\u5efa\u7d22\u5f15\u7684\u65f6\u5019\u62a5\u9519\u8bf4\u7d22\u5f15\u5df2\u7ecf\u5b58\u5728\u4e86\uff0c\u90a3\u53ef\u80fd\u662f Zabbix \u5df2\u7ecf\u5148\u4e00\u6b65\u521b\u5efa\u4e86\u3002\u8fd9\u65f6\u5019\u5c31\u5148\u505c\u6b62 Zabbix \u670d\u52a1\uff0c\u7136\u540e\u624b\u52a8\u5220\u9664\u8fd9\u4e94\u4e2a\u7d22\u5f15\uff0c\u7136\u540e\u518d\u6309\u7167\u4e0b\u9762\u7684 shell \u6307\u4ee4\u6dfb\u52a0\u4e94\u4e2a\u7d22\u5f15\uff0c\u4e4b\u540e\u8bbe\u7f6e\u597d Zabbix \u76f8\u5173\u914d\u7f6e\uff0c\u518d\u542f\u52a8 Zabbix\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e9b shell \u6307\u4ee4\u76f4\u63a5\u6253\u8fdb\u547d\u4ee4\u884c\u5c31\u884c\uff0c\u987a\u5e8f\u65e0\u5148\u540e\uff0c\u6ce8\u610f\u662f\u8981\u5728\u90e8\u7f72\u4e86 es \u7684\u90a3\u53f0\u673a\u5668\u4e0a\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u6dfb\u52a0\u6570\u5b57\uff08\u65e0\u7b26\u53f7\uff09\u7c7b\u578b\u7684\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -X PUT \\<br> http:\/\/localhost:8080\/uint \\<br> -H 'content-type:application\/json' \\<br> -d '{<br> &nbsp; \"settings\": {<br> &nbsp; &nbsp;  \"index\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_replicas\": 1,<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_shards\": 5<br> &nbsp; &nbsp;  }<br> &nbsp; },<br> &nbsp; \"mappings\": {<br> &nbsp; &nbsp;  \"properties\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"itemid\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"long\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"clock\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"format\": \"epoch_second\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"date\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"value\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"long\"<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp;  }<br> &nbsp; }<br>}'<\/pre>\n\n\n\n<p>\u6dfb\u52a0\u6570\u5b57\uff08\u6d6e\u70b9\u578b\uff09\u7c7b\u578b\u7684\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -X PUT \\<br> http:\/\/localhost:8080\/dbl \\<br> -H 'content-type:application\/json' \\<br> -d '{<br> &nbsp; \"settings\": {<br> &nbsp; &nbsp;  \"index\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_replicas\": 1,<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_shards\": 5<br> &nbsp; &nbsp;  }<br> &nbsp; },<br> &nbsp; \"mappings\": {<br> &nbsp; &nbsp;  \"properties\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"itemid\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"long\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"clock\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"format\": \"epoch_second\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"date\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"value\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"double\"<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp;  }<br> &nbsp; }<br>}'<\/pre>\n\n\n\n<p>\u6dfb\u52a0\u5b57\u7b26\u7c7b\u578b\u7684\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -X PUT \\<br> http:\/\/localhost:8080\/str \\<br> -H 'content-type:application\/json' \\<br> -d '{<br> &nbsp; \"settings\": {<br> &nbsp; &nbsp;  \"index\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_replicas\": 1,<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_shards\": 5<br> &nbsp; &nbsp;  }<br> &nbsp; },<br> &nbsp; \"mappings\": {<br> &nbsp; &nbsp;  \"properties\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"itemid\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"long\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"clock\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"format\": \"epoch_second\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"date\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"value\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"fields\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \"analyzed\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"index\": true,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"text\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"analyzer\": \"standard\"<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"index\": false,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"text\"<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp;  }<br> &nbsp; }<br>}'<\/pre>\n\n\n\n<p>\u6dfb\u52a0\u65e5\u5fd7\u7c7b\u578b\u7684\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -X PUT \\<br> http:\/\/localhost:8080\/log \\<br> -H 'content-type:application\/json' \\<br> -d '{<br> &nbsp; \"settings\": {<br> &nbsp; &nbsp;  \"index\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_replicas\": 1,<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_shards\": 5<br> &nbsp; &nbsp;  }<br> &nbsp; },<br> &nbsp; \"mappings\": {<br> &nbsp; &nbsp;  \"properties\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"itemid\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"long\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"clock\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"format\": \"epoch_second\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"date\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"value\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"fields\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \"analyzed\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"index\": true,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"text\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"analyzer\": \"standard\"<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"index\": false,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"text\"<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp;  }<br> &nbsp; }<br>}'<\/pre>\n\n\n\n<p>\u6dfb\u52a0\u6587\u672c\u7c7b\u578b\u7684\u7d22\u5f15\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -X PUT \\<br> http:\/\/localhost:8080\/text \\<br> -H 'content-type:application\/json' \\<br> -d '{<br> &nbsp; \"settings\": {<br> &nbsp; &nbsp;  \"index\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_replicas\": 1,<br> &nbsp; &nbsp; &nbsp; &nbsp; \"number_of_shards\": 5<br> &nbsp; &nbsp;  }<br> &nbsp; },<br> &nbsp; \"mappings\": {<br> &nbsp; &nbsp;  \"properties\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; \"itemid\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"long\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"clock\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"format\": \"epoch_second\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"date\"<br> &nbsp; &nbsp; &nbsp; &nbsp; },<br> &nbsp; &nbsp; &nbsp; &nbsp; \"value\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"fields\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \"analyzed\": {<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"index\": true,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"text\",<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"analyzer\": \"standard\"<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  },<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"index\": false,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  \"type\": \"text\"<br> &nbsp; &nbsp; &nbsp; &nbsp; }<br> &nbsp; &nbsp;  }<br> &nbsp; }<br>}'<\/pre>\n\n\n\n<h2>\u914d\u7f6eZabbix<\/h2>\n\n\n\n<p>es \u90a3\u8fb9\u914d\u7f6e\u597d\u4e86\uff0c\u6211\u4eec\u518d\u6765\u4fee\u6539 Zabbix \u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vim \/etc\/zabbix\/zabbix_server.conf<br>\u200b<br>HistoryStorageURL=127.0.0.1:8080<br>HistoryStorageTypes=uint,dbl,str,log,text<\/pre>\n\n\n\n<p>\u7531\u4e8e\u6211 Zabbix \u670d\u52a1\u7aef\u548c es \u662f\u90e8\u7f72\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u7684\uff0c\u6240\u4ee5\u53ef\u4ee5\u586b127.0.0.1\u3002\u5982\u679c\u4e0d\u5728\u540c\u4e00\u53f0\u673a\u5668\u4e0a\uff0c\u8fd9\u91cc\u586b es \u6240\u5728\u673a\u5668\u7684 ip \u5730\u5740\u3002\u540e\u9762\u8ddf\u7684 8080 \u662f\u56e0\u4e3a\u6211 es \u90e8\u7f72\u5728 8080 \u7aef\u53e3\u4e0a\uff0c\u5982\u679c\u4f60 es \u90e8\u7f72\u5728\u5176\u4ed6\u7aef\u53e3\u4e0a\uff0c\u8fd9\u91cc\u4e5f\u8981\u6539\u4e00\u4e0b\u3002<\/p>\n\n\n\n<p>\u4e4b\u540e\uff0c\u6211\u4eec\u518d\u914d\u7f6e Zabbix \u524d\u7aef\u6587\u4ef6\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vim \/etc\/zabbix\/web\/zabbix.conf.php<\/pre>\n\n\n\n<p>\u9996\u5148\u5728\u6587\u4ef6\u7684\u5f00\u5934\u5c06\u8be5\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u201c$DB\u201d\u548c\u201c$HISTORY\u201d\u8bbe\u7f6e\u4e3a\u5168\u5c40\u53c2\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&lt;?php<br>\/\/ Zabbix GUI configuration file.<br>global $DB, $HISTORY;<\/pre>\n\n\n\n<p>\u4e4b\u540e\uff0c\u4fee\u6539\u4e24\u4e2a\u201c$HISTORY\u201d\u7684\u503c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/ Elasticsearch url (can be string if same url is used for all types). <br>$HISTORY['url'] = 'http:\/\/127.0.0.1:8080';<br>\/\/ Value types stored in Elasticsearch. <br>$HISTORY['types'] = ['uint', 'text', 'log', 'str', 'dbl'];<\/pre>\n\n\n\n<p>\u5982\u679c\u60f3\u5728 Kibana \u4e0a\u770b\uff0c\u90a3\u4e48\u8fd8\u9700\u8981\u5728 Kibana \u4e0a\u521b\u5efa\u76f8\u5e94\u7684\u7d22\u5f15\uff08Configure an index pattern\uff09\uff0c\u65f6\u95f4\u8fc7\u6ee4\u5b57\u6bb5\uff08Time Filter field name\uff09\u586b\u5199\u201cclock\u201d\u3002\u8fd9\u4e9b Kibana \u90fd\u4f1a\u63d0\u793a\u4f60\u7684\u3002<\/p>\n\n\n\n<p>\u5230\u8fd9\u91cc\uff0c\u914d\u7f6e\u5c31\u5168\u90e8\u5b8c\u6210\u4e86\u3002\u6211\u4eec\u9700\u8981\u91cd\u542f zabbix-server \u548c Zabbix Web\uff08httpd\uff09\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl restart zabbix-server httpd<\/pre>\n\n\n\n<p>\u7a0d\u7b49\u4e00\u4f1a\u513f\u4e4b\u540e\uff0cKibana \u548c Zabbix Web \u4e0a\u7684\u6570\u636e\u548c\u56fe\u50cf\u5c31\u663e\u793a\u6b63\u5e38\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\uff1ahttps:\/\/twocups.cn\/index.php\/202 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":470,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[99],"tags":[105,123],"_links":{"self":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/posts\/560"}],"collection":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/comments?post=560"}],"version-history":[{"count":0,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/posts\/560\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/media\/470"}],"wp:attachment":[{"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/media?parent=560"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/categories?post=560"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/twocups.cn\/index.php\/wp-json\/wp\/v2\/tags?post=560"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}