{"id":2954,"date":"2025-11-21T15:34:19","date_gmt":"2025-11-21T07:34:19","guid":{"rendered":"https:\/\/linuxjk.cn\/?p=2954"},"modified":"2025-11-23T10:25:24","modified_gmt":"2025-11-23T02:25:24","slug":"zabbix%e9%83%a8%e7%bd%b2%e6%96%87%e6%a1%a3","status":"publish","type":"post","link":"https:\/\/linuxjk.cn\/?p=2954","title":{"rendered":"zabbix\u90e8\u7f72\u6587\u6863"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#Zabbix_50_%E5%AE%8C%E6%95%B4%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3%EF%BC%88%E9%BE%99%E8%9C%A5810_MySQL%EF%BC%89\" >Zabbix 5.0 \u5b8c\u6574\u90e8\u7f72\u6587\u6863\uff08\u9f99\u8725810 + MySQL\uff09<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87%EF%BC%9A\" >\u73af\u5883\u51c6\u5907\uff1a<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E9%85%8D%E7%BD%AE%E6%97%B6%E9%97%B4%E5%90%8C%E6%AD%A5%E6%97%B6%E5%8C%BA\" >\u914d\u7f6e\u65f6\u95f4\u540c\u6b65\/\u65f6\u533a<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E7%AC%AC%E4%B8%80%E9%83%A8%E5%88%86%EF%BC%9A%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%83%A8%E7%BD%B2_1000112\" >\u7b2c\u4e00\u90e8\u5206\uff1a\u670d\u52a1\u7aef\u90e8\u7f72 (10.0.0.112)<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#zabbix_50%E7%89%88%E6%9C%AC%E5%9F%BA%E6%9C%AC%E8%A6%81%E6%B1%82\" >zabbix 5.0\u7248\u672c\u57fa\u672c\u8981\u6c42<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E5%AE%89%E8%A3%85_MySQL_Server%EF%BC%88%E6%9C%AC%E6%96%87574%EF%BC%89\" >\u5b89\u88c5 MySQL Server\uff08\u672c\u65875.7.4\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#1_%E5%AE%89%E8%A3%85zabbix\" >1. \u5b89\u88c5zabbix<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#2_%E5%88%9B%E5%BB%BAZabbix%E6%95%B0%E6%8D%AE%E5%BA%93\" >2. \u521b\u5efaZabbix\u6570\u636e\u5e93<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#3_%E6%9F%A5%E6%89%BE%E5%B9%B6%E5%AF%BC%E5%85%A5Zabbix_SQL%E8%84%9A%E6%9C%AC\" >3. \u67e5\u627e\u5e76\u5bfc\u5165Zabbix SQL\u811a\u672c<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#4_%E5%A6%82%E6%9E%9C%E6%89%BE%E4%B8%8D%E5%88%B0SQL%E8%84%9A%E6%9C%AC%EF%BC%8C%E6%89%8B%E5%8A%A8%E5%A4%84%E7%90%86\" >4. \u5982\u679c\u627e\u4e0d\u5230SQL\u811a\u672c\uff0c\u624b\u52a8\u5904\u7406<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#5_%E9%85%8D%E7%BD%AEZabbix%E6%9C%8D%E5%8A%A1%E7%AB%AF\" >5. \u914d\u7f6eZabbix\u670d\u52a1\u7aef<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#6_%E5%AE%89%E8%A3%85Web%E5%89%8D%E7%AB%AF%E7%BB%84%E4%BB%B6\" >6. \u5b89\u88c5Web\u524d\u7aef\u7ec4\u4ef6<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#7_%E9%85%8D%E7%BD%AEPHP\" >7. \u914d\u7f6ePHP<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#8_%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1\" >8. \u542f\u52a8\u670d\u52a1<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E7%AC%AC%E4%BA%8C%E9%83%A8%E5%88%86%EF%BC%9A%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%83%A8%E7%BD%B2_1000113\" >\u7b2c\u4e8c\u90e8\u5206\uff1a\u5ba2\u6237\u7aef\u90e8\u7f72 (10.0.0.113)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E7%AC%AC%E4%B8%89%E9%83%A8%E5%88%86%EF%BC%9AWeb%E7%95%8C%E9%9D%A2%E9%85%8D%E7%BD%AE\" >\u7b2c\u4e09\u90e8\u5206\uff1aWeb\u754c\u9762\u914d\u7f6e<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#1_%E8%AE%BF%E9%97%AEWeb%E5%AE%89%E8%A3%85%E5%90%91%E5%AF%BC\" >1. \u8bbf\u95eeWeb\u5b89\u88c5\u5411\u5bfc<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#2_%E6%8C%89%E6%AD%A5%E9%AA%A4%E5%AE%8C%E6%88%90%E5%AE%89%E8%A3%85\" >2. \u6309\u6b65\u9aa4\u5b8c\u6210\u5b89\u88c5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#3_%E7%99%BB%E5%BD%95%E7%B3%BB%E7%BB%9F\" >3. \u767b\u5f55\u7cfb\u7edf<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#4_%E5%BC%80%E5%A7%8B%E4%BD%BF%E7%94%A8\" >4. \u5f00\u59cb\u4f7f\u7528<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E6%B7%BB%E5%8A%A0%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%B8%BB%E6%9C%BA%EF%BC%9A%E9%85%8D%E7%BD%AE%E2%86%92%E4%B8%BB%E6%9C%BA%E2%86%92%E5%88%9B%E5%BB%BA%E4%B8%BB%E6%9C%BA\" >\u6dfb\u52a0\u5ba2\u6237\u7aef\u4e3b\u673a\uff1a\u914d\u7f6e\u2192\u4e3b\u673a\u2192\u521b\u5efa\u4e3b\u673a<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E7%AC%AC%E5%9B%9B%E9%83%A8%E5%88%86%EF%BC%9A%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3\" >\u7b2c\u56db\u90e8\u5206\uff1a\u5e38\u89c1\u95ee\u9898\u89e3\u51b3<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E5%9B%BE%E5%BD%A2%E9%A1%B5%E9%9D%A2%E4%B9%B1%E7%A0%81%EF%BC%88%E4%B8%8D%E8%83%BD%E6%AD%A3%E5%B8%B8%E6%98%BE%E7%A4%BA%E4%B8%AD%E6%96%87%EF%BC%89\" >\u56fe\u5f62\u9875\u9762\u4e71\u7801\uff08\u4e0d\u80fd\u6b63\u5e38\u663e\u793a\u4e2d\u6587\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E5%A6%82%E6%9E%9C%E6%89%BE%E4%B8%8D%E5%88%B0SQL%E8%84%9A%E6%9C%AC%EF%BC%8C%E5%8F%AF%E4%BB%A5%EF%BC%9A\" >\u5982\u679c\u627e\u4e0d\u5230SQL\u811a\u672c\uff0c\u53ef\u4ee5\uff1a<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5%E9%97%AE%E9%A2%98%E6%8E%92%E6%9F%A5\" >\u6570\u636e\u5e93\u8fde\u63a5\u95ee\u9898\u6392\u67e5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E6%9C%8D%E5%8A%A1%E7%8A%B6%E6%80%81%E6%A3%80%E6%9F%A5\" >\u670d\u52a1\u72b6\u6001\u68c0\u67e5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/linuxjk.cn\/?p=2954\/#%E6%8E%92%E6%9F%A5%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%83%BD%E5%90%A6%E6%AD%A3%E5%B8%B8%E8%BF%9E%E6%8E%A5\" >\u6392\u67e5\u5ba2\u6237\u7aef\u80fd\u5426\u6b63\u5e38\u8fde\u63a5<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Zabbix_50_%E5%AE%8C%E6%95%B4%E9%83%A8%E7%BD%B2%E6%96%87%E6%A1%A3%EF%BC%88%E9%BE%99%E8%9C%A5810_MySQL%EF%BC%89\"><\/span>Zabbix 5.0 \u5b8c\u6574\u90e8\u7f72\u6587\u6863\uff08\u9f99\u8725810 + MySQL\uff09<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%8E%AF%E5%A2%83%E5%87%86%E5%A4%87%EF%BC%9A\"><\/span><strong>\u73af\u5883\u51c6\u5907\uff1a<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>server 10.0.0.112\nclient 10.0.0.113<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u73af\u5883<\/th><th>\u7248\u672c\u53f7<\/th><\/tr><\/thead><tbody><tr><td>zabbix<\/td><td>5.0.47<\/td><\/tr><tr><td>mysql<\/td><td>5.7.44<\/td><\/tr><tr><td>php<\/td><td>7.2.24<\/td><\/tr><tr><td>httpd\uff08apache\uff09<\/td><td>2.4.37<\/td><\/tr><tr><td>chrony<\/td><td>4.5<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E9%85%8D%E7%BD%AE%E6%97%B6%E9%97%B4%E5%90%8C%E6%AD%A5%E6%97%B6%E5%8C%BA\"><\/span>\u914d\u7f6e\u65f6\u95f4\u540c\u6b65\/\u65f6\u533a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5b89\u88c5 chrony\nyum -y install chrony\n\n# \u542f\u52a8\u5e76\u542f\u7528\u670d\u52a1\nsystemctl start chronyd\nsystemctl enable chronyd\n\n# \u914d\u7f6e\u65f6\u95f4\u670d\u52a1\u5668\uff08\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\uff09\nvi \/etc\/chrony.conf\n\n# \u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6dfb\u52a0\u6216\u4fee\u6539\u670d\u52a1\u5668\uff0c\u4f8b\u5982\uff1a\n# server ntp.aliyun.com iburst\n# server ntp1.aliyun.com iburst\n\n# \u91cd\u542f\u670d\u52a1\nsystemctl restart chronyd\n\n# \u624b\u52a8\u540c\u6b65\u65f6\u95f4\nchronyc -a makestep\n\n# \u67e5\u770b\u65f6\u95f4\u540c\u6b65\u72b6\u6001\nchronyc sources -v\nchronyc tracking\n\n#\u65f6\u533a\u540c\u6b65\n#\u8bbe\u5b9a\u65f6\u533a\uff1a\ntimedatectl set-timezone \"Asia\/Shanghai\"\nmv \/etc\/localtime \/etc\/localtime.bak\nln -s \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AC%AC%E4%B8%80%E9%83%A8%E5%88%86%EF%BC%9A%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%83%A8%E7%BD%B2_1000112\"><\/span>\u7b2c\u4e00\u90e8\u5206\uff1a\u670d\u52a1\u7aef\u90e8\u7f72 (10.0.0.112)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"zabbix_50%E7%89%88%E6%9C%AC%E5%9F%BA%E6%9C%AC%E8%A6%81%E6%B1%82\"><\/span>zabbix 5.0\u7248\u672c\u57fa\u672c\u8981\u6c42<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>1\u3001zabbix 5.0\u540e \u7248\u672c\u540e \u5bf9php\u7248\u672c\u81f3\u5c117.0<\/p>\n\n\n\n<p>2\u30012G2\u6838<\/p>\n\n\n\n<p>3\u3001zabbix-server\u670d\u52a1\u7aef\u5b89\u88c5<\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%89%E8%A3%85_MySQL_Server%EF%BC%88%E6%9C%AC%E6%96%87574%EF%BC%89\"><\/span>\u5b89\u88c5 MySQL Server\uff08\u672c\u65875.7.4\uff09<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p><strong><a href=\"https:\/\/blog.csdn.net\/qq_45610596\/article\/details\/132199642\">CentOS8\u5b89\u88c5mysql5.7\u8be6\u7ec6\u53ef\u7528\u6559\u7a0b-CSDN\u535a\u5ba2<\/a><\/strong><\/p>\n\n\n\n<p>1.\u83b7\u53d6\u5b89\u88c5\u5305<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>wget http:\/\/dev.mysql.com\/get\/mysql57-community-release-el7-11.noarch.rpm<\/code><\/pre>\n\n\n\n<p>2.\u5f00\u59cb\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum localinstall mysql57-community-release-el7-11.noarch.rpm<\/code><\/pre>\n\n\n\n<p>\u68c0\u67e5mysql\u6e90\u662f\u5426\u5b89\u88c5\u6210\u529f\uff1a\u5982\u679c\u6ca1\u6210\u529f\u91cd\u65b0\u4e0a\u4e00\u6b65<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum repolist enabled | grep \"mysql.*.community.*\"<\/code><\/pre>\n\n\n\n<p>\u518d\u4f9d\u6b21\u6267\u884c\u4e0b\u9762\u4e24\u6761\u8bed\u53e5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>yum module disable mysql\nyum -y install mysql-community-server<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u663e\u793aGPG-check\u6709\u95ee\u9898\u7684\u53ef\u4ee5\u6267\u884c\u4e0b\u4e0b\u9762\u8fd9\u4e2a\u8bed\u53e5\uff1a<strong>(\u6ca1\u95ee\u9898\u7684\u53ef\u4ee5\u4e0d\u6267\u884c)<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rpm --import https:\/\/repo.mysql.com\/RPM-GPG-KEY-mysql-2022\nyum clean packages\n#\u6216\u8005\u4e34\u65f6\u7981\u7528gpg\u68c0\u67e5\nyum -y install mysql-community-server --nogpgcheck<\/code><\/pre>\n\n\n\n<p>4.\u542f\u52a8MySQL<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl start mysqld.service<\/code><\/pre>\n\n\n\n<p>5.\u67e5\u770b\u72b6\u6001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl status mysqld.service\n\n# \u5982\u679c\u51fa\u73b0\u5982\u4e0b\u62a5\u9519\uff0c\u8bf7\u6362\u6210 service mysqld status \u8fd9\u6761\u547d\u4ee4\nUnit mysql.service could not be found.<\/code><\/pre>\n\n\n\n<p>6.\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl enable mysqld\nsystemctl daemon-reload<\/code><\/pre>\n\n\n\n<p>7.\u67e5\u770b\u5f00\u673a\u542f\u52a8\u72b6\u6001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>systemctl list-unit-files | grep mysqld<\/code><\/pre>\n\n\n\n<p>8.\u83b7\u53d6\u521d\u59cb\u5bc6\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>grep 'temporary password' \/var\/log\/mysqld.log<\/code><\/pre>\n\n\n\n<p>9.\u767b\u5f55mysql\u4fee\u6539\u5bc6\u7801\uff0c\u5e76\u5f00\u542f\u8fdc\u7a0b\u8bbf\u95ee<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p<\/code><\/pre>\n\n\n\n<p>\u8bbe\u7f6e\u65b0\u5bc6\u7801\u4e0e\u8fdc\u7a0b\u8bbf\u95ee\uff1a\uff08\u9ed8\u8ba4\u5bc6\u7801\u9700\u8981\u5f3a\u5bc6\u7801\uff0c\u5927\u5c0f\u5199+\u6570\u5b57+\u5b57\u7b26\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u8bbe\u7f6e\u65b0\u5bc6\u7801\uff08\u9700\u8981\u5927\u5199\u3001\u5c0f\u5199\u3001\u6570\u5b57\u3001\u7b26\u53f7\uff09\nset password for 'root'@'localhost'='\u4f60\u7684\u65b0\u5bc6\u7801';\n\n# \u8bbe\u7f6e\u8fdc\u7a0b\u8bbf\u95ee\nGRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '\u4f60\u7684\u65b0\u5bc6\u7801'  WITH GRANT OPTION;\n\n# \u5237\u65b0\u4f7f\u914d\u7f6e\u751f\u6548\nflush privileges;<\/code><\/pre>\n\n\n\n<p>\u5230\u6b64\uff0c\u5927\u529f\u544a\u6210\uff0c\u8bb0\u5f97\u53bb\u628a <strong>3306<\/strong> \u7aef\u53e3\u7684\u9632\u706b\u5899\u653e\u5f00!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u6d4b\u8bd5\u73af\u5883\u5173\u95ed\u9632\u706b\u5899\nsystemctl disable --now  firewalld<\/code><\/pre>\n\n\n\n<p>\u4ee5\u4e0a\u914d\u7f6e\u540e\u5982\u679c\u51fa\u73b0\u65e0\u6cd5\u767b\u5f55mysql\u7684\u95ee\u9898\u53ef\u4ee5\u6267\u884c\u4e0b\u9762\u6b65\u9aa4\u91cd\u65b0\u5b89\u88c5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5378\u8f7d\u73b0\u6709MySQL\nsudo yum remove mysql mysql-server\n\n# \u6e05\u7406\u6b8b\u7559\u6587\u4ef6\nsudo rm -rf \/var\/lib\/mysql\nsudo rm -rf \/etc\/my.cnf\n\n# \u91cd\u65b0\u5b89\u88c5\nsudo yum install mysql-server\nsudo systemctl start mysqld\n\nyum -y install mysql-community-server --nogpgcheck<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E5%AE%89%E8%A3%85zabbix\"><\/span>1. \u5b89\u88c5zabbix<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u83b7\u53d6zabbix\u5b98\u65b9\u6e90\nyum install -y https:\/\/mirrors.aliyun.com\/zabbix\/zabbix\/5.0\/rhel\/8\/x86_64\/zabbix-release-5.0-1.el8.noarch.rpm\n#\u4fee\u6539\u914d\u7f6e\u6e90\u6587\u4ef6\nsed -i 's#http:\/\/repo.zabbix.com#https:\/\/mirrors.aliyun.com\/zabbix#' \/etc\/yum.repos.d\/zabbix.repo\n#yum\u6e90\u521d\u59cb\u5316\nyum clean all &amp;&amp; yum makecache\n#\u5b89\u88c5zabbix-agent2\u6216zabbix-agent\nyum install zabbix-agent2 -y\n#\u542f\u52a8zabbix-agent2\nsystemctl enable --now zabbix-agent2.service\n#\u68c0\u67e5\u542f\u52a8\u72b6\u6001\nss -lntup | grep zabbix\n#\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\nvim  \/etc\/zabbix\/zabbix_agent2.conf\n#\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\negrep -v '^$|#' \/etc\/zabbix\/zabbix_agent2.conf\nLogFile=\/var\/log\/zabbix\/zabbix_agent2.log\nLogFileSize=0\nServer=127.0.0.1,10.0.0.112           # zabbix-server\u670d\u52a1\u7aefIP\nServerActive=127.0.0.1,10.0.0.112    \nHostname=10.0.0.112                   # zabbix server\u672c\u673a\u5730\u5740           \nInclude=\/etc\/zabbix\/zabbix_agent2.d\/*.conf\nControlSocket=\/tmp\/agent.sock\n#\u91cd\u65b0\u542f\u52a8\uff08\u751f\u6548\u914d\u7f6e\u6587\u4ef6\uff09\nsystemctl restart zabbix-agent2.service \n#\u68c0\u67e5\u542f\u52a8\u72b6\u6001\nss -lntup | grep 10050<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%E5%88%9B%E5%BB%BAZabbix%E6%95%B0%E6%8D%AE%E5%BA%93\"><\/span>2. \u521b\u5efaZabbix\u6570\u636e\u5e93<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u767b\u5f55MySQL\nmysql -u root -p\n\n# \u521b\u5efaZabbix\u6570\u636e\u5e93\u548c\u7528\u6237\nCREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;\nCREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'zabbixPASSWORD123.';\nGRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';\nFLUSH PRIVILEGES;\nexit<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_%E6%9F%A5%E6%89%BE%E5%B9%B6%E5%AF%BC%E5%85%A5Zabbix_SQL%E8%84%9A%E6%9C%AC\"><\/span>3. \u67e5\u627e\u5e76\u5bfc\u5165Zabbix SQL\u811a\u672c<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u67e5\u627eSQL\u811a\u672c\u4f4d\u7f6e\nfind \/ -name \"*.sql.gz\" | grep zabbix\n\n# \u5982\u679c\u627e\u5230\uff0c\u5bfc\u5165\u6570\u636e\u5e93\uff08\u65f6\u95f4\u53ef\u80fd\u4f1a\u6162\uff09\n# \u4f8b\u5982\uff0c\u5982\u679c\u8def\u5f84\u662f \/usr\/share\/doc\/zabbix-server-mysql\/create.sql.gz\nzcat \/usr\/share\/doc\/zabbix-server-mysql\/create.sql.gz | mysql -uzabbix -p zabbix<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_%E5%A6%82%E6%9E%9C%E6%89%BE%E4%B8%8D%E5%88%B0SQL%E8%84%9A%E6%9C%AC%EF%BC%8C%E6%89%8B%E5%8A%A8%E5%A4%84%E7%90%86\"><\/span>4. \u5982\u679c\u627e\u4e0d\u5230SQL\u811a\u672c\uff0c\u624b\u52a8\u5904\u7406<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u68c0\u67e5\u5df2\u5b89\u88c5\u7684Zabbix\u76f8\u5173\u5305\nrpm -qa | grep zabbix\n\n# \u67e5\u770bzabbix-server-mysql\u5305\u5b89\u88c5\u7684\u6587\u4ef6\nrpm -ql zabbix-server-mysql-5.0.47\n\n# \u6216\u8005\u4ece\u60a8\u4e4b\u524d\u4e0b\u8f7d\u597d\u7684\u4f4d\u7f6e\u5bfc\u5165\n# \u5047\u8bbe\u60a8\u4e0b\u8f7d\u7684Zabbix 5.0\u6e90\u7801\u5305\u5728\u67d0\u4e2a\u4f4d\u7f6e\ncd \/path\/to\/your\/zabbix-5.0.47\/database\/mysql\n\n# \u6309\u987a\u5e8f\u5bfc\u5165SQL\u6587\u4ef6\nmysql -uzabbix -p zabbix &lt; schema.sql\nmysql -uzabbix -p zabbix &lt; images.sql\nmysql -uzabbix -p zabbix &lt; data.sql<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_%E9%85%8D%E7%BD%AEZabbix%E6%9C%8D%E5%8A%A1%E7%AB%AF\"><\/span>5. \u914d\u7f6eZabbix\u670d\u52a1\u7aef<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7f16\u8f91\u914d\u7f6e\u6587\u4ef6\nvim \/etc\/zabbix\/zabbix_server.conf<\/code><\/pre>\n\n\n\n<p>\u786e\u4fdd\u4ee5\u4e0b\u914d\u7f6e\u6b63\u786e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DBHost=localhost\nDBName=zabbix\nDBUser=zabbix\nDBPassword=zabbixPASSWORD123.\n\nLogFile=\/var\/log\/zabbix\/zabbix_server.log\nLogFileSize=0\nPidFile=\/var\/run\/zabbix\/zabbix_server.pid\nSocketDir=\/var\/run\/zabbix\nSNMPTrapperFile=\/var\/log\/snmptrap\/snmptrap.log\nTimeout=4\nAlertScriptsPath=\/usr\/lib\/zabbix\/alertscripts\nExternalScripts=\/usr\/lib\/zabbix\/externalscripts\nLogSlowQueries=3000\nStatsAllowedIP=127.0.0.1<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_%E5%AE%89%E8%A3%85Web%E5%89%8D%E7%AB%AF%E7%BB%84%E4%BB%B6\"><\/span>6. \u5b89\u88c5Web\u524d\u7aef\u7ec4\u4ef6<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5b89\u88c5Zabbix Web\u524d\u7aef\nyum install -y zabbix-web-mysql zabbix-apache-conf\n\n# \u5b89\u88c5Apache\u548cPHP\nyum install -y httpd php php-mysqlnd php-gd php-bcmath php-mbstring php-xml<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_%E9%85%8D%E7%BD%AEPHP\"><\/span>7. \u914d\u7f6ePHP<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u7f16\u8f91PHP\u914d\u7f6e\u6587\u4ef6\nvim \/etc\/php.ini<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539\u4ee5\u4e0b\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>date.timezone = Asia\/Shanghai\nmax_execution_time = 300\nmemory_limit = 128M\npost_max_size = 16M\nupload_max_filesize = 2M\nmax_input_time = 300<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"8_%E5%90%AF%E5%8A%A8%E6%9C%8D%E5%8A%A1\"><\/span>8. \u542f\u52a8\u670d\u52a1<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u542f\u52a8Zabbix\u670d\u52a1\nsystemctl start zabbix-server\nsystemctl enable zabbix-server\n\n# \u542f\u52a8Apache\nsystemctl start httpd\nsystemctl enable httpd\n\n#\u5982\u679c\u542f\u52a8\u5931\u8d25\u68c0\u67e580\u7aef\u53e3\u662f\u5426\u88ab\u5360\u7528\nss -lntup | grep 80<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AC%AC%E4%BA%8C%E9%83%A8%E5%88%86%EF%BC%9A%E5%AE%A2%E6%88%B7%E7%AB%AF%E9%83%A8%E7%BD%B2_1000113\"><\/span>\u7b2c\u4e8c\u90e8\u5206\uff1a\u5ba2\u6237\u7aef\u90e8\u7f72 (10.0.0.113)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u83b7\u53d6zabbix\u5b98\u65b9\u6e90\nyum install -y https:\/\/mirrors.aliyun.com\/zabbix\/zabbix\/5.0\/rhel\/8\/x86_64\/zabbix-release-5.0-1.el8.noarch.rpm\n#\u4fee\u6539\u914d\u7f6e\u6e90\u6587\u4ef6\nsed -i 's#https:\/\/repo.zabbix.com#https:\/\/mirrors.aliyun.com\/zabbix#' \/etc\/yum.repos.d\/zabbix.repo\n#yum\u6e90\u521d\u59cb\u5316\nyum clean all &amp;&amp; yum makecache\n#\u5b89\u88c5zabbix-agent2\u6216zabbix-agent\nyum install zabbix-agent2 -y\n#\u542f\u52a8zabbix-agent2\nsystemctl enable --now zabbix-agent2.service\n#\u68c0\u67e5\u542f\u52a8\u72b6\u6001\nss -lntup | grep zabbix\n#\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\nvim  \/etc\/zabbix\/zabbix_agent2.conf\n#\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\negrep -v '^$|#' \/etc\/zabbix\/zabbix_agent2.conf\nLogFile=\/var\/log\/zabbix\/zabbix_agent2.log\nLogFileSize=0              \nServer=10.0.0.112                        # zabbix-server\u670d\u52a1\u7aefIP\nServerActive=10.0.0.112\nHostname=zabbix-client-113                 # \u663e\u793a\u5728web\u9875\u9762\u7684\u4e3b\u673a\u540d\nInclude=\/etc\/zabbix\/zabbix_agent2.d\/*.conf\nControlSocket=\/tmp\/agent.sock\n#\u91cd\u65b0\u542f\u52a8\uff08\u751f\u6548\u914d\u7f6e\u6587\u4ef6\uff09\nsystemctl restart zabbix-agent2.service \n#\u68c0\u67e5\u542f\u52a8\u72b6\u6001\nss -lntup | grep 10050<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AC%AC%E4%B8%89%E9%83%A8%E5%88%86%EF%BC%9AWeb%E7%95%8C%E9%9D%A2%E9%85%8D%E7%BD%AE\"><\/span>\u7b2c\u4e09\u90e8\u5206\uff1aWeb\u754c\u9762\u914d\u7f6e<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_%E8%AE%BF%E9%97%AEWeb%E5%AE%89%E8%A3%85%E5%90%91%E5%AF%BC\"><\/span>1. \u8bbf\u95eeWeb\u5b89\u88c5\u5411\u5bfc<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>http:&#47;&#47;10.0.0.112\/zabbix<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_%E6%8C%89%E6%AD%A5%E9%AA%A4%E5%AE%8C%E6%88%90%E5%AE%89%E8%A3%85\"><\/span>2. \u6309\u6b65\u9aa4\u5b8c\u6210\u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p><strong>\u7b2c\u4e00\u6b65\uff1a\u6b22\u8fce\u9875\u9762<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u68c0\u67e5\u6240\u6709\u524d\u63d0\u6761\u4ef6\u662f\u5426\u4e3a&#8221;OK&#8221;<\/li>\n\n\n\n<li><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153259069.png\" alt=\"zabbix1\"><\/li>\n\n\n\n<li><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153302493.png\" alt=\"zabbix2\"><\/li>\n<\/ul>\n\n\n\n<p><strong>\u7b2c\u4e8c\u6b65\uff1a\u914d\u7f6e\u6570\u636e\u5e93\u8fde\u63a5<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6570\u636e\u5e93\u7c7b\u578b: MySQL\n\u6570\u636e\u5e93\u4e3b\u673a: localhost\n\u6570\u636e\u5e93\u7aef\u53e3: 3306\n\u6570\u636e\u5e93\u540d\u79f0: zabbix\n\u7528\u6237: zabbix\n\u5bc6\u7801: zabbixPASSWORD123.<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153305823.png\" alt=\"zabbix3\"\/><\/figure>\n\n\n\n<p><strong>\u7b2c\u4e09\u6b65\uff1aZabbix\u670d\u52a1\u5668\u8be6\u60c5<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u670d\u52a1\u5668\u540d\u79f0: Zabbix Server 112\n\u65f6\u533a: Asia\/Shanghai<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153309236.png\" alt=\"zabbix4\"\/><\/figure>\n\n\n\n<p><strong>\u7b2c\u56db\u6b65\uff1a\u9884\u89c8\u8bbe\u7f6e<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u786e\u8ba4\u914d\u7f6e\u4fe1\u606f\u6b63\u786e<\/li>\n\n\n\n<li><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153312453.png\" alt=\"zabbix5\"><\/li>\n<\/ul>\n\n\n\n<p><strong>\u7b2c\u4e94\u6b65\uff1a\u5b8c\u6210\u5b89\u88c5<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153326464.png\" alt=\"\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_%E7%99%BB%E5%BD%95%E7%B3%BB%E7%BB%9F\"><\/span>3. \u767b\u5f55\u7cfb\u7edf<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7528\u6237\u540d: <code>Admin<\/code><\/li>\n\n\n\n<li>\u5bc6\u7801: <code>zabbix<\/code><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153330883.png\" alt=\"zabbix7\"\/><\/figure>\n\n\n\n<p><strong>\u66f4\u6539web\u8bed\u8a00<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153333842.png\" alt=\"zabbix8\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_%E5%BC%80%E5%A7%8B%E4%BD%BF%E7%94%A8\"><\/span>4. \u5f00\u59cb\u4f7f\u7528<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<h5 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%B7%BB%E5%8A%A0%E5%AE%A2%E6%88%B7%E7%AB%AF%E4%B8%BB%E6%9C%BA%EF%BC%9A%E9%85%8D%E7%BD%AE%E2%86%92%E4%B8%BB%E6%9C%BA%E2%86%92%E5%88%9B%E5%BB%BA%E4%B8%BB%E6%9C%BA\"><\/span>\u6dfb\u52a0\u5ba2\u6237\u7aef\u4e3b\u673a\uff1a\u914d\u7f6e\u2192\u4e3b\u673a\u2192\u521b\u5efa\u4e3b\u673a<span class=\"ez-toc-section-end\"><\/span><\/h5>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153337349.png\" alt=\"image-20251105170420921\"\/><\/figure>\n\n\n\n<p>\u8f93\u5165\u5ba2\u6237\u7aef\u4e3b\u673a\u540d\uff08\u5ba2\u6237\u7aef\u914d\u7f6e\u6587\u4ef6\u4e2dHostname\u7684\u503c\uff0c\u5fc5\u987b\u5b8c\u5168\u4e00\u6837\uff09<\/p>\n\n\n\n<p>ip\u5730\u5740\uff1a10.0.0.113<\/p>\n\n\n\n<p>\u7aef\u53e3\uff1a10050<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153341590.png\" alt=\"image-20251105170517793\"\/><\/figure>\n\n\n\n<p>\u6dfb\u52a0\u6a21\u677fTemplate App Zabbix Server\uff0cTemplate OS Linux by Zabbix agent<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153345293.png\" alt=\"image-20251105170821697\"\/><\/figure>\n\n\n\n<p>\u6dfb\u52a0\u6210\u529f\u63d0\u793a\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153348767.png\" alt=\"image-20251105170941336\"\/><\/figure>\n\n\n\n<p>\u663e\u793a\u4e0e112\u7684\u76f8\u540c\u5373\u53ef<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/typora-zp.oss-cn-shanghai.aliyuncs.com\/typora20251121153353221.png\" alt=\"image-20251105171112007\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E7%AC%AC%E5%9B%9B%E9%83%A8%E5%88%86%EF%BC%9A%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3\"><\/span>\u7b2c\u56db\u90e8\u5206\uff1a\u5e38\u89c1\u95ee\u9898\u89e3\u51b3<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%9B%BE%E5%BD%A2%E9%A1%B5%E9%9D%A2%E4%B9%B1%E7%A0%81%EF%BC%88%E4%B8%8D%E8%83%BD%E6%AD%A3%E5%B8%B8%E6%98%BE%E7%A4%BA%E4%B8%AD%E6%96%87%EF%BC%89\"><\/span>\u56fe\u5f62\u9875\u9762\u4e71\u7801\uff08\u4e0d\u80fd\u6b63\u5e38\u663e\u793a\u4e2d\u6587\uff09<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># 1\u3001\u5b89\u88c5\u4e2d\u6587\u5b57\u4f53\nyum -y install wqy-microhei-fonts\n\n#2\u3001\u5c06\u4e0b\u8f7d\u597d\u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u590d\u5236\u5230\u6307\u5b9a\u8def\u5f84\u4e0b\ncp \/usr\/share\/fonts\/wqy-microhei\/wqy-microhei.ttc \/usr\/share\/fonts\/dejavu\/DejaVuSans.ttf<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%A6%82%E6%9E%9C%E6%89%BE%E4%B8%8D%E5%88%B0SQL%E8%84%9A%E6%9C%AC%EF%BC%8C%E5%8F%AF%E4%BB%A5%EF%BC%9A\"><\/span>\u5982\u679c\u627e\u4e0d\u5230SQL\u811a\u672c\uff0c\u53ef\u4ee5\uff1a<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p><strong>\u65b9\u6cd5\u4e00\uff1a\u4ece\u5b98\u7f51\u4e0b\u8f7d<\/strong>\uff08\u4ec5\u96506.0.0\u4ee5\u4e0a\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u4e0b\u8f7dZabbix 5.0\u6e90\u7801\u5305\nwget https:\/\/cdn.zabbix.com\/zabbix\/sources\/stable\/6.0\/zabbix-6.0.0.tar.gz\ntar -xf zabbix-6.0.0.tar.gz\ncd zabbix-6.0.0\/database\/mysql<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9E%E6%8E%A5%E9%97%AE%E9%A2%98%E6%8E%92%E6%9F%A5\"><\/span>\u6570\u636e\u5e93\u8fde\u63a5\u95ee\u9898\u6392\u67e5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6d4b\u8bd5\u6570\u636e\u5e93\u8fde\u63a5\nmysql -uzabbix -p -h localhost zabbix\n\n# \u68c0\u67e5\u6570\u636e\u5e93\u6743\u9650\nmysql -u root -p\nSHOW GRANTS FOR 'zabbix'@'localhost';<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%9C%8D%E5%8A%A1%E7%8A%B6%E6%80%81%E6%A3%80%E6%9F%A5\"><\/span>\u670d\u52a1\u72b6\u6001\u68c0\u67e5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code># \u670d\u52a1\u7aef\u68c0\u67e5\nsystemctl status zabbix-server\ntail -f \/var\/log\/zabbix\/zabbix_server.log\n#\u5ba2\u6237\u7aef\u68c0\u67e5\nsystemctl status zabbix-agent2\ntail -f \/var\/log\/zabbix\/zabbix_agent2.log<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E6%8E%92%E6%9F%A5%E5%AE%A2%E6%88%B7%E7%AB%AF%E8%83%BD%E5%90%A6%E6%AD%A3%E5%B8%B8%E8%BF%9E%E6%8E%A5\"><\/span>\u6392\u67e5\u5ba2\u6237\u7aef\u80fd\u5426\u6b63\u5e38\u8fde\u63a5<span class=\"ez-toc-section-end\"><\/span><\/h4>\n\n\n\n<p>\u670d\u52a1\u7aef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6d4b\u8bd5\u7f51\u7edc\u8fde\u901a\u6027\nping 10.0.0.113\n# \u6d4b\u8bd5\u7aef\u53e3\u8fde\u901a\u6027\ntelnet 10.0.0.113 10050\nyum install -y zabbix-get\n\nzabbix_get -s 10.0.0.113 -k \"system.users.num\"\n#\u770b\u65e5\u5fd7\ntail -f \/var\/log\/zabbix\/zabbix_server.log<\/code><\/pre>\n\n\n\n<p>\u5ba2\u6237\u7aef\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u68c0\u67e5\u9632\u706b\u5899\u72b6\u6001\nsystemctl status firewalld\n\n# \u5982\u679c\u9632\u706b\u5899\u5f00\u542f\uff0c\u68c0\u67e5\u7aef\u53e3\u662f\u5426\u5f00\u653e\nzabbix_get -s 10.0.0.113 -k \"system.users.num\"\n\n# \u5982\u679c\u6ca1\u6709\u5f00\u653e\uff0c\u6dfb\u52a0\u89c4\u5219\nfirewall-cmd --permanent --add-port=10050\/tcp\nfirewall-cmd --reload\n\n#\u68c0\u67e5Zabbix Agent\u914d\u7f6e\uff1acat \/etc\/zabbix\/zabbix_agent2.conf\n# \u5141\u8bb8\u8fde\u63a5\u7684\u670d\u52a1\u5668IP\uff08\u6dfb\u52a0Zabbix\u670d\u52a1\u5668IP\uff09\nServer=10.0.0.112,127.0.0.1\n# \u4e3b\u52a8\u68c0\u67e5\u7684\u670d\u52a1\u5668IP\nServerActive=10.0.0.112,127.0.0.1\n# \u76d1\u542c\u6240\u6709\u63a5\u53e3\nListenIP=0.0.0.0\n# \u4e3b\u673a\u540d\uff08\u5fc5\u987b\u4e0eWeb\u754c\u9762\u4e2d\u914d\u7f6e\u7684\u4e00\u81f4\uff09\nHostname=10.0.0.113\n\n\n# \u91cd\u542fagent\u670d\u52a1\nsystemctl restart zabbix-agent2\n# \u68c0\u67e5\u670d\u52a1\u72b6\u6001\nsystemctl status zabbix-agent2\n# \u68c0\u67e5\u7aef\u53e3\u76d1\u542c\nnetstat -tulnp | grep 10050\n# \u6216\u4f7f\u7528\nss -tulnp | grep 10050\n#\u770b\u65e5\u5fd7\ntail -f \/var\/log\/zabbix\/zabbix_agent2.log<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Zabbix 5.0 \u5b8c\u6574\u90e8\u7f72\u6587\u6863\uff08\u9f99\u8725810 + MySQL\uff09 \u73af\u5883\u51c6\u5907\uff1a \u73af\u5883 \u7248\u672c\u53f7 zabbix 5. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[20],"class_list":["post-2954","post","type-post","status-publish","format-standard","hentry","category-vxhs888p","tag-create_project"],"_links":{"self":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/2954","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2954"}],"version-history":[{"count":1,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/2954\/revisions"}],"predecessor-version":[{"id":2955,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=\/wp\/v2\/posts\/2954\/revisions\/2955"}],"wp:attachment":[{"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2954"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2954"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxjk.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2954"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}