{"id":61498,"date":"2025-04-29T12:48:59","date_gmt":"2025-04-29T04:48:59","guid":{"rendered":"https:\/\/fwq.ai\/blog\/61498\/"},"modified":"2025-04-29T12:48:59","modified_gmt":"2025-04-29T04:48:59","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8linux%e4%b8%8a%e5%ae%89%e8%a3%85%e5%92%8c%e9%85%8d%e7%bd%ae%e7%9b%91%e6%8e%a7%e5%b7%a5%e5%85%b7%ef%bc%88%e5%a6%82zabbix%ef%bc%89-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/61498\/","title":{"rendered":"\u5982\u4f55\u5728Linux\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u76d1\u63a7\u5de5\u5177\uff08\u5982Zabbix\uff09"},"content":{"rendered":"<p>\u5982\u4f55\u5728linux\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u76d1\u63a7\u5de5\u5177\uff08\u5982zabbix\uff09<\/p>\n<p>\u6982\u8ff0\uff1a<br \/>\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u76d1\u63a7\u5de5\u5177\u662f\u786e\u4fdd\u670d\u52a1\u5668\u548c\u5e94\u7528\u7a0b\u5e8f\u6b63\u5e38\u8fd0\u884c\u7684\u91cd\u8981\u4e00\u6b65\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u4e00\u4e2a\u6d41\u884c\u7684\u76d1\u63a7\u5de5\u5177\uff0cZabbix\u3002Zabbix\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u4e14\u7075\u6d3b\u7684\u76d1\u63a7\u89e3\u51b3\u65b9\u6848\uff0c\u53ef\u5e2e\u52a9\u7ba1\u7406\u5458\u76d1\u63a7\u670d\u52a1\u5668\u6027\u80fd\u3001\u7f51\u7edc\u6d41\u91cf\u3001\u5e94\u7528\u7a0b\u5e8f\u7b49\u3002<\/p>\n<p>\u6b65\u9aa41\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305<br \/>\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\uff0c\u4ee5\u4fbf\u5728Linux\u7cfb\u7edf\u4e0a\u6b63\u5e38\u5b89\u88c5\u548c\u8fd0\u884cZabbix\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n<pre>sudo apt-get update\nsudo apt-get install apache2 mysql-server php php-mysql php-gd php-xml php-bcmath php-mbstring<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa42\uff1a\u521b\u5efaZabbix\u6570\u636e\u5e93<br \/>\u5728\u5b89\u88c5Zabbix\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u6765\u5b58\u50a8\u76d1\u63a7\u6570\u636e\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u767b\u5f55MySQL\u3002<\/p>\n<pre>sudo mysql -u root -p<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u8f93\u5165\u5bc6\u7801\u540e\uff0c\u5c06\u4f1a\u8fdb\u5165MySQL\u547d\u4ee4\u884c\u754c\u9762\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u548c\u7528\u6237\uff0c\u5e76\u5c06\u6743\u9650\u6388\u4e88\u8be5\u7528\u6237\u3002<\/p>\n<pre>CREATE DATABASE zabbix CHARACTER SET UTF8 COLLATE UTF8_BIN;\nCREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'password';\nGRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost' WITH GRANT OPTION;\nFLUSH PRIVILEGES;\nEXIT;<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa43\uff1a\u4e0b\u8f7d\u548c\u5b89\u88c5Zabbix<br \/>\u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u5b89\u88c5Zabbix\u4e86\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4eceZabbix\u5b98\u65b9\u7f51\u7ad9\u4e2d\u4e0b\u8f7d\u6700\u65b0\u7684Zabbix\u670d\u52a1\u5668\u8f6f\u4ef6\u5305\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u3002<\/p>\n<pre>wget https:\/\/repo.zabbix.com\/zabbix\/4.4\/ubuntu\/pool\/main\/z\/zabbix-release\/zabbix-release_4.4-1%2Bbionic_all.deb<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c06\u8f6f\u4ef6\u5305\u5b89\u88c5\u5230\u7cfb\u7edf\u4e2d\u3002<\/p>\n<pre>sudo dpkg -i zabbix-release_4.4-1+bionic_all.deb\nsudo apt-get update\nsudo apt-get install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-agent<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa44\uff1a\u914d\u7f6eZabbix\u670d\u52a1\u5668<br \/>Zabbix\u670d\u52a1\u5668\u5c06\u76d1\u63a7\u6570\u636e\u5b58\u50a8\u5728\u4e0a\u4e00\u6b65\u4e2d\u521b\u5efa\u7684\u6570\u636e\u5e93\u4e2d\u3002\u6253\u5f00Zabbix\u670d\u52a1\u5668\u914d\u7f6e\u6587\u4ef6\uff0c\u5e76\u5bf9\u5176\u8fdb\u884c\u5fc5\u8981\u7684\u66f4\u6539\u3002<\/p>\n<pre>sudo nano \/etc\/zabbix\/zabbix_server.conf<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u627e\u5230\u5e76\u7f16\u8f91\u4ee5\u4e0b\u884c\u3002<\/p>\n<pre>DBHost=localhost\nDBName=zabbix\nDBUser=zabbix\nDBPassword=password<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n<p>\u6b65\u9aa45\uff1a\u5bfc\u5165Zabbix\u6570\u636e\u5e93\u6a21\u5f0f\u548c\u6570\u636e<br \/>\u5728\u6b64\u6b65\u9aa4\u4e2d\uff0c\u6211\u4eec\u5c06\u5bfc\u5165Zabbix\u6570\u636e\u5e93\u7684\u6a21\u5f0f\u548c\u6570\u636e\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u767b\u5f55MySQL\u3002<\/p>\n<pre>sudo mysql -u zabbix -p zabbix &lt;p&gt;\u8f93\u5165\u4e4b\u524d\u8bbe\u7f6e\u7684\u5bc6\u7801\uff0c\u7136\u540e\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002&lt;\/p&gt;&lt;pre class=\"brush:php;toolbar:false;\"&gt;sudo zcat \/usr\/share\/doc\/zabbix-server-mysql\/data.sql.gz | mysql -u zabbix -p zabbix<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa46\uff1a\u914d\u7f6eZabbix\u524d\u7aef<br \/>\u73b0\u5728\uff0c\u6211\u4eec\u9700\u8981\u5bf9Zabbix\u524d\u7aef\u8fdb\u884c\u4e00\u4e9b\u914d\u7f6e\u3002\u6253\u5f00Apache\u7684Zabbix\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n<pre>sudo nano \/etc\/zabbix\/apache.conf<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u627e\u5230\u4ee5\u4e0b\u884c\u5e76\u8fdb\u884c\u7f16\u8f91\u3002<\/p>\n<pre>php_value date.timezone Europe\/Riga<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5c06\u65f6\u533a\u66f4\u6539\u4e3a\u60a8\u6240\u5728\u7684\u65f6\u533a\u3002\u4fdd\u5b58\u5e76\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n<p>\u6b65\u9aa47\uff1a\u542f\u52a8Zabbix\u670d\u52a1<br \/>\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8Zabbix\u670d\u52a1\u5668\u548cZabbix\u4ee3\u7406\u3002<\/p>\n<pre>sudo systemctl start zabbix-server\nsudo systemctl enable zabbix-server\nsudo systemctl start zabbix-agent\nsudo systemctl enable zabbix-agent\nsudo systemctl restart apache2<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u6b65\u9aa48\uff1a\u8bbf\u95eeZabbix\u524d\u7aef<br \/>\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u670d\u52a1\u5668\u7684IP\u5730\u5740\uff0c\u5e76\u6dfb\u52a0\u201c\/zabbix\u201d\u4ee5\u8bbf\u95eeZabbix\u524d\u7aef\u3002<\/p>\n<pre>http:\/\/your_server_IP\/zabbix<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u4f7f\u7528\u9ed8\u8ba4\u7684\u7528\u6237\u540d\u201cAdmin\u201d\u548c\u5bc6\u7801\u201czabbix\u201d\u767b\u5f55\u3002<\/p>\n<p>\u7ed3\u8bba\uff1a<br \/>\u901a\u8fc7\u6309\u7167\u4e0a\u8ff0\u6b65\u9aa4\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u914d\u7f6eZabbix\uff0c\u60a8\u73b0\u5728\u5df2\u7ecf\u62e5\u6709\u4e86\u4e00\u4e2a\u529f\u80fd\u5f3a\u5927\u7684\u76d1\u63a7\u5de5\u5177\uff0c\u53ef\u4ee5\u5e2e\u52a9\u60a8\u76d1\u63a7\u670d\u52a1\u5668\u548c\u5e94\u7528\u7a0b\u5e8f\u7684\u8fd0\u884c\u72b6\u51b5\u3002\u60a8\u8fd8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u5bf9Zabbix\u8fdb\u884c\u8fdb\u4e00\u6b65\u7684\u914d\u7f6e\u548c\u5b9a\u5236\u5316\u3002\u5f00\u59cb\u4f7f\u7528Zabbix\u6765\u76d1\u63a7\u548c\u4f18\u5316\u60a8\u7684\u7cfb\u7edf\u5427\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5982\u4f55\u5728Linux\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u76d1\u63a7\u5de5\u5177\uff08\u5982Zabbix\uff09\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u5728linux\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u76d1\u63a7\u5de5\u5177\uff08\u5982zabbix\uff09 \u6982\u8ff0\uff1a\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u76d1\u63a7\u5de5\u5177\u662f\u786e\u4fdd\u670d\u52a1\u5668\u548c\u5e94\u7528\u7a0b\u5e8f\u6b63\u5e38\u8fd0\u884c\u7684\u91cd\u8981\u4e00\u6b65\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5\u548c\u914d\u7f6e\u4e00\u4e2a\u6d41\u884c\u7684\u76d1\u63a7\u5de5\u5177\uff0cZabbix\u3002Zabbix\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u4e14\u7075\u6d3b\u7684\u76d1\u63a7\u89e3\u51b3\u65b9\u6848\uff0c\u53ef\u5e2e\u52a9\u7ba1\u7406\u5458\u76d1\u63a7\u670d\u52a1\u5668\u6027\u80fd\u3001\u7f51\u7edc\u6d41\u91cf\u3001\u5e94\u7528\u7a0b\u5e8f\u7b49\u3002 \u6b65\u9aa41\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5\u4e00\u4e9b\u5fc5\u8981\u7684\u8f6f\u4ef6\u5305\uff0c\u4ee5\u4fbf\u5728Linux\u7cfb\u7edf\u4e0a\u6b63\u5e38\u5b89\u88c5\u548c\u8fd0\u884cZabbix\u3002\u6253\u5f00\u7ec8\u7aef\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\u6240\u9700\u7684\u8f6f\u4ef6\u5305\u3002 sudo apt-get update sudo apt-get install apache2 mysql-server php php-mysql php-gd php-xml php-bcmath php-mbstring \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa42\uff1a\u521b\u5efaZabbix\u6570\u636e\u5e93\u5728\u5b89\u88c5Zabbix\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u6570\u636e\u5e93\u6765\u5b58\u50a8\u76d1\u63a7\u6570\u636e\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u767b\u5f55MySQL\u3002 sudo mysql -u root -p \u767b\u5f55\u540e\u590d\u5236 \u8f93\u5165\u5bc6\u7801\u540e\uff0c\u5c06\u4f1a\u8fdb\u5165MySQL\u547d\u4ee4\u884c\u754c\u9762\u3002\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u548c\u7528\u6237\uff0c\u5e76\u5c06\u6743\u9650\u6388\u4e88\u8be5\u7528\u6237\u3002 CREATE DATABASE zabbix CHARACTER SET UTF8 COLLATE UTF8_BIN; CREATE USER &#8216;zabbix&#8217;@&#8217;localhost&#8217; IDENTIFIED BY &#8216;password&#8217;; GRANT ALL PRIVILEGES ON zabbix.* TO &#8216;zabbix&#8217;@&#8217;localhost&#8217; WITH GRANT OPTION; FLUSH PRIVILEGES; EXIT; \u767b\u5f55\u540e\u590d\u5236 \u6b65\u9aa43\uff1a\u4e0b\u8f7d\u548c\u5b89\u88c5Zabbix\u73b0\u5728\u6211\u4eec\u53ef\u4ee5\u5f00\u59cb\u5b89\u88c5Zabbix\u4e86\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u4eceZabbix\u5b98\u65b9\u7f51\u7ad9\u4e2d\u4e0b\u8f7d\u6700\u65b0\u7684Zabbix\u670d\u52a1\u5668\u8f6f\u4ef6\u5305\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4e0b\u8f7d\u8f6f\u4ef6\u5305\u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-61498","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61498","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=61498"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/61498\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=61498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=61498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=61498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}