{"id":45108,"date":"2024-10-06T20:31:13","date_gmt":"2024-10-06T12:31:13","guid":{"rendered":"https:\/\/server.hk\/cnblog\/45108\/"},"modified":"2024-10-06T20:31:13","modified_gmt":"2024-10-06T12:31:13","slug":"zabbix-2-2-%e6%9c%8d%e5%8b%99%e7%ab%af%e5%ae%89%e8%a3%9d","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/45108\/","title":{"rendered":"Zabbix 2.2 \u670d\u52d9\u7aef\u5b89\u88dd"},"content":{"rendered":"<h1 id=\"zabbix-2-2-%e6%9c%8d%e5%8b%99%e7%ab%af%e5%ae%89%e8%a3%9d-HyWEmYWjMN\">Zabbix 2.2 \u670d\u52d9\u7aef\u5b89\u88dd<\/h1>\n<p>Zabbix \u662f\u4e00\u6b3e\u958b\u6e90\u7684\u76e3\u63a7\u89e3\u6c7a\u65b9\u6848\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc\u4f3a\u670d\u5668\u3001\u7db2\u7d61\u8a2d\u5099\u53ca\u61c9\u7528\u7a0b\u5e8f\u7684\u76e3\u63a7\u3002Zabbix 2.2 \u7248\u672c\u5f15\u5165\u4e86\u591a\u9805\u65b0\u529f\u80fd\u548c\u6539\u9032\uff0c\u4f7f\u5176\u6210\u70ba\u4e00\u500b\u66f4\u5f37\u5927\u4e14\u9748\u6d3b\u7684\u76e3\u63a7\u5de5\u5177\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u5728\u4f3a\u670d\u5668\u4e0a\u5b89\u88dd Zabbix 2.2 \u670d\u52d9\u7aef\uff0c\u4e26\u63d0\u4f9b\u8a73\u7d30\u7684\u6b65\u9a5f\u548c\u6ce8\u610f\u4e8b\u9805\u3002<\/p>\n<h2 id=\"%e7%b3%bb%e7%b5%b1%e9%9c%80%e6%b1%82-HyWEmYWjMN\">\u7cfb\u7d71\u9700\u6c42<\/h2>\n<p>\u5728\u5b89\u88dd Zabbix \u4e4b\u524d\uff0c\u9996\u5148\u9700\u8981\u78ba\u4fdd\u60a8\u7684\u4f3a\u670d\u5668\u6eff\u8db3\u4ee5\u4e0b\u7cfb\u7d71\u9700\u6c42\uff1a<\/p>\n<ul>\n<li>\u64cd\u4f5c\u7cfb\u7d71\uff1a\u652f\u6301\u7684 Linux \u767c\u884c\u7248\uff08\u5982 Ubuntu\u3001CentOS \u7b49\uff09<\/li>\n<li>Web \u4f3a\u670d\u5668\uff1aApache \u6216 Nginx<\/li>\n<li>\u6578\u64da\u5eab\uff1aMySQL\u3001PostgreSQL \u6216 SQLite<\/li>\n<li>PHP\uff1a\u7248\u672c\u9700\u5728 5.3.3 \u4ee5\u4e0a<\/li>\n<\/ul>\n<h2 id=\"%e5%ae%89%e8%a3%9d%e6%ad%a5%e9%a9%9f-HyWEmYWjMN\">\u5b89\u88dd\u6b65\u9a5f<\/h2>\n<h3 id=\"1-%e6%9b%b4%e6%96%b0%e7%b3%bb%e7%b5%b1-HyWEmYWjMN\">1. \u66f4\u65b0\u7cfb\u7d71<\/h3>\n<pre><code>sudo apt-get update\nsudo apt-get upgrade<\/code><\/pre>\n<h3 id=\"2-%e5%ae%89%e8%a3%9d%e5%bf%85%e8%a6%81%e7%9a%84%e8%bb%9f%e4%bb%b6%e5%8c%85-HyWEmYWjMN\">2. \u5b89\u88dd\u5fc5\u8981\u7684\u8edf\u4ef6\u5305<\/h3>\n<p>\u5b89\u88dd Apache\u3001MySQL \u548c PHP \u53ca\u5176\u76f8\u95dc\u64f4\u5c55\uff1a<\/p>\n<pre><code>sudo apt-get install apache2 mysql-server php libapache2-mod-php php-mysql php-gd php-xml php-bcmath php-mbstring<\/code><\/pre>\n<h3 id=\"3-%e4%b8%8b%e8%bc%89-zabbix-2-2-HyWEmYWjMN\">3. \u4e0b\u8f09 Zabbix 2.2<\/h3>\n<p>\u5f9e Zabbix \u5b98\u65b9\u7db2\u7ad9\u4e0b\u8f09 Zabbix 2.2 \u7684\u5b89\u88dd\u5305\uff1a<\/p>\n<pre><code>wget https:\/\/cdn.zabbix.com\/zabbix\/sources\/stable\/2.2\/zabbix-2.2.0.tar.gz<\/code><\/pre>\n<h3 id=\"4-%e8%a7%a3%e5%a3%93%e5%ae%89%e8%a3%9d%e5%8c%85-HyWEmYWjMN\">4. \u89e3\u58d3\u5b89\u88dd\u5305<\/h3>\n<pre><code>tar -zxvf zabbix-2.2.0.tar.gz<\/code><\/pre>\n<h3 id=\"5-%e7%b7%a8%e8%ad%af%e5%92%8c%e5%ae%89%e8%a3%9d-zabbix-HyWEmYWjMN\">5. \u7de8\u8b6f\u548c\u5b89\u88dd Zabbix<\/h3>\n<p>\u9032\u5165\u89e3\u58d3\u5f8c\u7684\u76ee\u9304\uff0c\u7136\u5f8c\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u7de8\u8b6f\u548c\u5b89\u88dd\uff1a<\/p>\n<pre><code>cd zabbix-2.2.0\n.\/configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-jabber --with-libcurl\nmake\nsudo make install<\/code><\/pre>\n<h3 id=\"6-%e9%85%8d%e7%bd%ae%e6%95%b8%e6%93%9a%e5%ba%ab-HyWEmYWjMN\">6. \u914d\u7f6e\u6578\u64da\u5eab<\/h3>\n<p>\u5728 MySQL \u4e2d\u5275\u5efa Zabbix \u6578\u64da\u5eab\u548c\u7528\u6236\uff1a<\/p>\n<pre><code>mysql -u root -p\nCREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;\nCREATE USER 'zabbix'@'localhost' IDENTIFIED BY 'your_password';\nGRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'localhost';\nFLUSH PRIVILEGES;<\/code><\/pre>\n<h3 id=\"7-%e5%b0%8e%e5%85%a5%e5%88%9d%e5%a7%8b%e6%95%b8%e6%93%9a-HyWEmYWjMN\">7. \u5c0e\u5165\u521d\u59cb\u6578\u64da<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5c07\u521d\u59cb\u6578\u64da\u5c0e\u5165\u5230 Zabbix \u6578\u64da\u5eab\u4e2d\uff1a<\/p>\n<pre><code>cd database\/mysql\nmysql -u zabbix -p zabbix &lt; schema.sql\nmysql -u zabbix -p zabbix &lt; images.sql\nmysql -u zabbix -p zabbix &lt; data.sql<\/code><\/pre>\n<h3 id=\"8-%e9%85%8d%e7%bd%ae-zabbix-%e6%9c%8d%e5%8b%99%e7%ab%af-HyWEmYWjMN\">8. \u914d\u7f6e Zabbix \u670d\u52d9\u7aef<\/h3>\n<p>\u7de8\u8f2f Zabbix \u670d\u52d9\u7aef\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n<pre><code>sudo nano \/usr\/local\/etc\/zabbix_server.conf<\/code><\/pre>\n<p>\u5728\u6587\u4ef6\u4e2d\u8a2d\u7f6e\u6578\u64da\u5eab\u9023\u63a5\u4fe1\u606f\uff1a<\/p>\n<pre><code>DBName=zabbix\nDBUser=zabbix\nDBPassword=your_password<\/code><\/pre>\n<h3 id=\"9-%e5%95%9f%e5%8b%95-zabbix-%e6%9c%8d%e5%8b%99%e7%ab%af-HyWEmYWjMN\">9. \u555f\u52d5 Zabbix \u670d\u52d9\u7aef<\/h3>\n<pre><code>sudo zabbix_server<\/code><\/pre>\n<h3 id=\"10-%e9%85%8d%e7%bd%ae-web-%e7%95%8c%e9%9d%a2-HyWEmYWjMN\">10. \u914d\u7f6e Web \u754c\u9762<\/h3>\n<p>\u5c07 Zabbix Web \u754c\u9762\u6587\u4ef6\u8907\u88fd\u5230 Apache \u7684\u6839\u76ee\u9304\uff1a<\/p>\n<pre><code>sudo cp -r frontends\/php\/* \/var\/www\/html\/<\/code><\/pre>\n<p>\u7136\u5f8c\uff0c\u60a8\u53ef\u4ee5\u901a\u904e\u700f\u89bd\u5668\u8a2a\u554f Zabbix Web \u754c\u9762\uff0c\u5730\u5740\u70ba\uff1ahttp:\/\/your_server_ip\/zabbix\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-HyWEmYWjMN\">\u7e3d\u7d50<\/h2>\n<p>\u5b89\u88dd Zabbix 2.2 \u670d\u52d9\u7aef\u7684\u904e\u7a0b\u76f8\u5c0d\u7c21\u55ae\uff0c\u53ea\u9700\u9075\u5faa\u4e0a\u8ff0\u6b65\u9a5f\u5373\u53ef\u5b8c\u6210\u3002Zabbix \u63d0\u4f9b\u4e86\u5f37\u5927\u7684\u76e3\u63a7\u529f\u80fd\uff0c\u80fd\u5920\u5e6b\u52a9\u7528\u6236\u53ca\u6642\u767c\u73fe\u548c\u89e3\u6c7a\u7cfb\u7d71\u554f\u984c\u3002\u82e5\u60a8\u9700\u8981\u7a69\u5b9a\u7684\u4f3a\u670d\u5668\u74b0\u5883\u4f86\u904b\u884c Zabbix\uff0c\u8003\u616e\u4f7f\u7528 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u6216 <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a> \u4f86\u78ba\u4fdd\u6700\u4f73\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to install Zabbix 2.2 server with step-by-step instructions for efficient monitoring and management of your IT infrastructure.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-45108","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45108","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=45108"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45108\/revisions"}],"predecessor-version":[{"id":45109,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/45108\/revisions\/45109"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=45108"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=45108"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=45108"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}