{"id":107506,"date":"2024-10-21T06:54:10","date_gmt":"2024-10-20T22:54:10","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=107506"},"modified":"2024-10-21T06:54:10","modified_gmt":"2024-10-20T22:54:10","slug":"zabbix-zabbix-install","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/zabbix-zabbix-install.html","title":{"rendered":"zabbix\u8be6\u89e3\u4e4bzabbix\u7684\u5b89\u88c5"},"content":{"rendered":"

\u7531\u4e8eubuntu\u6e90\u91cc\u81ea\u5e26\u6709zabbix \uff0c\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7apt-get\u7684\u65b9\u5f0f\u8fdb\u884c\u5b89\u88c5\uff0c\u6240\u4ee5\u8fd9\u91cc\u5c31\u4ee5centos6.5\u4e3a\u4f8b\uff0c\u4ecb\u7ecd\u4e0bzabbix\u7684\u6e90\u7801\u5305\u7f16\u8bd1\u5b89\u88c5\u7684\u8fc7\u7a0b\u3002<\/p>\n

\u4e00\u3001lamp\u73af\u5883\u5b89\u88c5<\/strong><\/div>\n

1\u3001yum\u5b89\u88c5lamp<\/strong><\/p>\n

#yum -y update\r\n#yum -y install\r\ngcc gcc-c++ autoconf\r\nhttpd php mysql mysql-server php-mysql\r\nhttpd-manual mod_ssl mod_perl mod_auth_mysql php-gd php-xml php-mbstring php-ldap\r\nphp-pear\r\nphp-xmlrpc\r\nphp-bcmath\r\nmysql-connector-odbc\r\nmysql-devel\r\nlibdbi-dbd-mysql\r\nnet-snmp-devel curl-devel\r\nunixODBC-devel\r\nOpenIPMI-devel\r\njava-devel\r\n<\/pre>\n

2\u3001\u4fee\u6539php.ini<\/strong>
\n\u7531\u4e8e\u540e\u9762\u7684\u5b89\u88c5\u65f6\u4f1a\u5bf9php.ini\u7684\u76f8\u5173\u53c2\u6570\u8fdb\u884c\u68c0\u6d4b\uff0c\u53d1\u73b0\u4e0d\u6ee1\u8db3\u65f6\u5728\u9875\u9762\u4e0a\u4f1a\u62a5\u9519\uff0c\u6240\u4ee5\u8fd9\u91cc\u9700\u8981\u63d0\u524d\u4fee\u6539\u76f8\u5173\u53c2\u6570\uff0c\u5176\u4e2d\u9700\u8981\u4fee\u6539\u7684\u90e8\u5206\u5982\u4e0b\uff1a<\/p>\n

# vim \/etc\/php.ini\r\ndate.timezone = Asia\/Shanghai\r\nmax_execution_time = 300\r\npost_max_size = 32M\r\nmax_input_time=300\r\nmemory_limit = 128M\r\nmbstring.func_overload = 2\r\n<\/pre>\n

\u4e5f\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7shell\u8bed\u53e5\u7684\u65b9\u5f0f\u8fdb\u884c\u4fee\u6539\uff0c\u5982\u4e0b\uff1a<\/p>\n

# sed -i \"s\/;date.timezone =\/date.timezone = Asia\/Shanghai\/g\" \/etc\/php.ini\r\n# sed -i \"s#max_execution_time = 30#max_execution_time = 300#g\" \/etc\/php.ini\r\n# sed -i \"s#post_max_size = 8M#post_max_size = 32M#g\" \/etc\/php.ini\r\n# sed -i \"s#max_input_time = 60#max_input_time = 300#g\" \/etc\/php.ini\r\n# sed -i \"s#memory_limit = 128M#memory_limit = 128M#g\" \/etc\/php.ini\r\n# sed -i \"\/;mbstring.func_overload = 0\/ambstring.func_overload = 2n\" \/etc\/php.ini\r\n<\/pre>\n
\u4e8c\u3001zabbix\u7684\u5b89\u88c5<\/strong><\/div>\n

1\u3001\u5b89\u88c5zabbix\u7f16\u8bd1\u65f6\u6240\u9700\u7684\u4f9d\u8d56\u5305<\/strong><\/p>\n

# yum -y install curl curl-devel pcre pcre-devel libssh2-devel openldap-devel<\/pre>\n

2\u3001zabbix\u7684\u4e0b\u8f7d\u5b89\u88c5<\/strong>
\n\u5230zabbix\u7684\u4e0b\u5b98\u65b9\u4e0b\u8f7d\u9875\u9762<\/a>\u4e0b\u8f7d\u53d6\u65b0\u7684stable\u7248\u672c \uff0c\u76ee\u524d\u7684\u6700\u65b0\u7248\u672c\u4e3a2.2.3<\/p>\n

# wget http:\/\/jaist.dl.sourceforge.net\/project\/zabbix\/ZABBIX%20Latest%20Stable\/2.2.3\/zabbix-2.2.3.tar.gz\r\n# tar zxvf zabbix-2.2.3.tar.gz\r\n<\/pre>\n

3\u3001\u7f16\u8bd1\u5b89\u88c5<\/strong><\/p>\n

# useradd zabbix\r\n# .\/configure --prefix=\/usr\r\n--sysconfdir=\/etc\/zabbix\r\n--enable-server --enable-proxy\r\n--enable-agent\r\n--enable-ipv6 --with-mysql=\/usr\/bin\/mysql_config --with-net-snmp\r\n--with-libcurl\r\n--with-openipmi\r\n--with-unixodbc\r\n--with-ldap\r\n--with-ssh2\r\n--enable-java\r\n# make install\r\n\u6ce8\uff1a<\/pre>\n

a\u3001\u5982\u679c\u4f60\u53ea\u662f\u60f3\u5b89\u88c5\u4e00\u4e2a\u670d\u52a1\u7aef\uff0c\u53ea\u9700\u5f00\u542f--enable-server \u5373\u53ef\uff0c\u5176\u4ed6\u53c2\u6570\u53ef\u4ee5\u4e0d\u7528\u9009\uff0c\u4f46\u8fd9\u91cc\u662f\u4e3a\u4e86\u540e\u9762\u7684\u5404\u9879\u529f\u80fd\u90fd\u53ef\u4ee5\u4f7f\u7528\uff0c\u6240\u4ee5\u5f00\u542f\u4e86\u975e\u5e38\u591a\u7684\u53c2\u6570 \u3002<\/p>\n

b\u3001\u901a\u5e38\u5728\u9700\u8981\u8fdb\u884c\u81ea\u52a8\u5316\u5904\u7406\u7684\u73af\u5883\u4e2d\uff0c\u4e00\u822c\u9700\u8981\u7edf\u4e00\u6279\u91cf\u4e3b\u673a\u7684\u7528\u6237\u540d\u7684ID\u503c \uff0c\u53ef\u4ee5\u901a\u8fc7<\/p>\n

groupadd\u00a0 -g 201 zabbix ;useradd -g zabbix -u 201 -m zabbix \r\n\r\n\u7684\u65b9\u5f0f\u65b0\u589e\u7528\u6237 \u3002<\/pre>\n

4\u3001\u589e\u52a0services\u914d\u7f6e<\/strong><\/p>\n

\u7f16\u8f91\/etc\/services\u914d\u7f6e\u6587\u4ef6\uff0c\u65b0\u589e\u4e0b\u9762\u90e8\u5206\uff1a<\/p>\n

# vim \/etc\/services\r\nzabbix-agent 10050\/tcp #Zabbix Agent\r\nzabbix-agent 10050\/udp #Zabbix Agent\r\nzabbix-trapper 10051\/tcp #Zabbix Trapper\r\nzabbix-trapper 10051\/udp #Zabbix Trapper\r\n<\/pre>\n
\u4e09\u3001mysql \u6570\u636e\u914d\u7f6e<\/strong><\/div>\n

\u914d\u7f6emysql\u9ed8\u8ba4\u5f00\u673a\u542f\u52a8\uff0c\u5e76\u542f\u52a8mysql\u670d\u52a1\uff1a<\/p>\n

# chkconfig mysqld on\r\n# services mysqld start\r\n<\/pre>\n

\u4fee\u6539mysql root\u5bc6\u7801\uff0c\u5e76\u767b\u5f55\u6d4b\u8bd5\uff1a<\/p>\n

# mysqladmin -uroot password 123456\r\n# mysql -uroot -p123456\r\n<\/pre>\n

\u521b\u5efazabbix\u4f7f\u7528\u7684\u6570\u636e\u5e93\uff0c\u5e76\u914d\u7f6e\u7528\u6237\u540d\u5bc6\u7801\uff1a<\/p>\n

mysql> create database zabbix character set utf8;\r\nQuery OK, 1 row affected (0.00 sec)\r\nmysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';\r\nQuery OK, 0 rows affected (0.00 sec)\r\nmysql> flush privileges;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n<\/pre>\n

\u8fd9\u91cc\u65b0\u5efa\u4e86\u4e00\u4e2a\u7528\u6237\u540d\u5bc6\u7801\u90fd\u4e3azabbix\u7684\u8d26\u53f7 \uff0c\u5b8c\u6210\u540e\u8bb0\u5f97\u4f7f\u7528zabbix -uzabbix -pzabbix \u6d4b\u8bd5\u662f\u5426\u53ef\u4ee5\u6b63\u5e38\u8fdb\u884c\u8fde\u63a5\u3002<\/p>\n

\u8fdb\u5165zabbix\u6e90\u7801\u5305\u89e3\u538b\u76ee\u5f55\uff0c\u5bfc\u5165mysql\u6570\u636e\uff1a<\/p>\n

[root@localhost zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < .\/database\/mysql\/schema.sql\r\n[root@localhost zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < .\/database\/mysql\/images.sql\r\n[root@localhost zabbix-2.2.3]# mysql -uzabbix -pzabbix zabbix < .\/database\/mysql\/data.sql\r\n<\/pre>\n
\u56db\u3001zabbix\u542f\u52a8\u811a\u672c\u53caconf\u914d\u7f6e<\/strong><\/div>\n

1\u3001\u914d\u7f6ezabbix\u542f\u52a8\u811a\u672c\uff0c\u5e76\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\u52a8<\/strong><\/p>\n

# cp misc\/init.d\/fedora\/core\/zabbix_* \/etc\/init.d\/\r\n# chmod 755 \/etc\/init.d\/zabbix_*\r\n# sed -i \"s#BASEDIR=\/usr\/local#BASEDIR=\/usr\/#g\" \/etc\/init.d\/zabbix_server\r\n# sed -i \"s#BASEDIR=\/usr\/local#BASEDIR=\/usr\/#g\" \/etc\/init.d\/zabbix_agentd\r\n\/\/\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\r\n# chkconfig zabbix_server on\r\n# chkconfig zabbix_agentd on\r\n<\/pre>\n

2\u3001zabbix_server.conf\u670d\u52a1\u7aef\u914d\u7f6e<\/strong><\/p>\n

\u4fee\u6539\/etc\/zabbix\/zabbix_server.conf \u914d\u7f6e\u6587\u4ef6\uff0c\u4fee\u6539\u540e\u914d\u7f6e\u6587\u4ef6\u7ed3\u679c\u7c7b\u4f3c\u5982\u4e0b\uff1a<\/p>\n

# egrep -v \"(#|^$)\" \/etc\/zabbix\/zabbix_server.conf\r\nLogFile=\/var\/log\/zabbix\/zabbix_server.log\r\nDBHost=localhost\r\nDBName=zabbix\r\nDBUser=zabbix\r\nDBPassword=zabbix\r\n\/\/\u4ee5\u4e0b\u90e8\u5206\u4e3a\u53ef\u9009\u9879\uff0c\u53ef\u4ee5\u4f7f\u7528\u9ed8\u8ba4\u503c\u5373\u53ef\r\nDBSocket=\/var\/lib\/mysql\/mysql.sock\r\nDBPort=3306\r\nStartPollers=160\r\nStartTrappers=20\r\nStartPingers=100\r\nStartDiscoverers=120\r\nMaxHousekeeperDelete=5000\r\nCacheSize=1024M\r\nStartDBSyncers=16\r\nHistoryCacheSize=1024M\r\nTrendCacheSize=1024M\r\nHistoryTextCacheSize=512M\r\nAlertScriptsPath=\/etc\/zabbix\/alertscripts\r\nLogSlowQueries=1000\r\n<\/pre>\n

3\u3001zabbix_agentd.conf<\/strong><\/p>\n

\u9700\u8981\u6ce8\u610f\u7684\u662f\u5728\/etc\/zabbix\/\u76ee\u5f55\u4e0b\u4f1a\u6709\u4e00\u4e2azabbix_agent.conf\u548c\u4e00\u4e2azabbix_agentd.conf \uff0c\u8fd9\u91cc\u4f7f\u7528\u7684\u662f\u5e26 d \u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u4e24\u90fd\u7684\u533a\u522b\u662f\uff1azabbix_agent.conf\u662f\u7528\u8d85\u7ea7\u670d\u52a1\uff08xinetd\uff09\u7684\u65b9\u5f0f\u6765\u542f\u52a8\u7684\uff0czabbix_agentd.conf\u662f\u4ee5\u72ec\u7acb\u8fdb\u7a0b\u7684\u65b9\u5f0f\u6765\u542f\u52a8\u7684 \u3002<\/p>\n

# egrep -v \"(#|^$)\" \/etc\/zabbix\/zabbix_agentd.conf\r\nLogFile=\/var\/log\/zabbix\/zabbix_agentd.log\r\nEnableRemoteCommands=0\r\nServer=127.0.0.1,192.168.1.100\r\nStartAgents=8\r\nServerActive=192.168.1.100:10051\r\nHostname=test1\r\nTimeout=30\r\nInclude=\/etc\/zabbix\/zabbix_agentd.conf.d\/\r\nUnsafeUserParameters=1\r\n<\/pre>\n

\u5de5\u4f5c\u6a21\u5f0f\uff1a
\nServer \u662f\u91c7\u7528\u88ab\u52a8\u5de5\u4f5c\u6a21\u5f0f\uff0c\u5141\u8bb8\u8bbf\u95ee\u7684 ip \u5730\u5740\uff0cserver \u7aef\u83b7\u53d6\u6570\u636e \u3002
\nServerActive \u662f\u91c7\u7528\u4e3b\u52a8\u5de5\u4f5c\u6a21\u5f0f\uff0c\u5c06\u6570\u636e\u4e0a\u4f20\u5230\u54ea\u53f0\u670d\u52a1\u5668\uff0c\u9700\u8981\u586b\u5199 server \u7684\u7aef\u53e3\uff0c\u9ed8\u8ba4\u662f 10051\u8bed\u6cd5\u662f \u201cip1,ip2 \u201d\uff0c\u53ef\u4ee5\u586b\u5199\u591a\u4e2a server \u7aef\uff0c\u4e2d\u95f4\u7528\u9017\u53f7\u9694\u5f00\u3002
\nUnsafeUserParameters \u7684\u503c\u8868\u793a\u662f\u5426\u542f\u7528\u81ea\u5b9a\u4e49\u811a\u672c\uff0c\u9ed8\u8ba4\u662f0\u8868\u793a\u4e0d\u542f\u7528\u3002<\/p>\n

4\u3001\u542f\u52a8\u670d\u52a1<\/strong><\/p>\n

\u5b8c\u6210\u4ee5\u4e0a\u914d\u7f6e\u540e\uff0c\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u670d\u52a1\uff1a<\/p>\n

# service zabbix_server start\r\n# service zabbix_agentd start\r\n<\/pre>\n
\u4e94\u3001zabbix frontends\u524d\u7aef\u914d\u7f6e<\/strong><\/div>\n

1\u3001\u590d\u5236frontend\u9875\u9762\u6587\u4ef6<\/strong><\/p>\n

# cp -r .\/frontends\/php\/ \/var\/www\/html\/zabbix\r\n# chown -R apache.apache \/var\/www\/html\/zabbix\r\n# service httpd start\r\n<\/pre>\n

2\u3001\u914d\u7f6eapache \u865a\u62df\u4e3b\u673a<\/strong><\/p>\n

ServerAdmin admin@361way.com\r\nDocumentRoot \/var\/www\/html\/zabbix\r\nServerName zabbix.361way.com\r\nErrorLog logs\/dummy-zabbix.361way.com-error_log\r\nCustomLog logs\/dummy-zabbix.361way.com-access_log common\r\n\r\n<\/pre>\n

3\u3001zabbix.conf.php\u914d\u7f6e\u6587\u4ef6\u7684\u751f\u6210<\/strong><\/p>\n

\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u4e0a\u9762\u914d\u7f6e\u7684\u865a\u62df\u4e3b\u673a\u540d\uff0c\u8fdb\u5165zabbix_frontend\u914d\u7f6e\u5b89\u88c5\u754c\u9762\uff0c\u5982\u4e0b\uff1a<\/p>\n

\"\"<\/a><\/p>\n

\u4e0a\u56fe\u4e2d\u5982\u679c\u4e0d\u6309\u7b2c\u4e00\u6b65\u4e2dlamp\u7684\u5b89\u88c5\u4e2d\u4fee\u6539\/etc\/php.ini\u7684\u53c2\u6570\uff0c\u8fd9\u91cc\u4f1a\u51fa\u73b0\u7ea2\u8272\u544a\u8b66\u3002<\/p>\n

\"\"<\/a><\/p>\n

\u4ee5\u4e0a\u4e3azabbix \u7684\u6570\u636e\u5e93\u914d\u7f6e\u90e8\u5206\u3002<\/p>\n

\"\"<\/a><\/p>\n

\u6b64\u5904\u5efa\u8bae\u4f7f\u7528\u4e3b\u673a\u540d\uff0c\u56e0\u4e3aIP\u5730\u5740\u53ef\u80fd\u4f1a\u66f4\u6539\uff0c\u800c\u4e3b\u673a\u540d\u66f4\u6539\u7684\u673a\u7387\u8981\u5c0f \u3002\u4f7f\u7528\u4e3b\u673a\u540d\u7684\u8bdd\uff0cIP\u5730\u5740\u66f4\u6539\u5bf9\u53c2\u6570\u4e5f\u4e0d\u4f1a\u6709\u5f71\u54cd \u3002<\/p>\n

\"\"<\/a><\/p>\n

\u6b64\u5904\u53ef\u80fd\u4f1a\u9047\u5230\u65e0\u6cd5\u521b\u5efa\u6587\u4ef6\u7684\u95ee\u9898\uff0c\u8be5\u95ee\u9898\u662f\u7531\u4e8e\u6ca1\u6709\u5199\u6743\u9650\u9020\u6210\u7684\u3002\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u89e3\u51b3\uff1a<\/p>\n

# chown -R apache.apache \/var\/www\/html\/zabbix\r\n<\/pre>\n

\u6309finish\u5b8c\u6210\u5b89\u540e\uff0c\u9ed8\u8ba4\u767b\u5f55\u7684\u7528\u6237\u540d\u662fadmin\uff0c\u5bc6\u7801\u662fzabbix\u00a0 \u3002<\/p>\n

\u516d\u3001selinux\u9632\u706b\u5899\u95ee\u9898<\/strong><\/div>\n

\u8fdb\u5165web\u9875\u9762\u767b\u5f55\u540e\uff0c\u53d1\u73b0\u62a5\u9519\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n

Zabbix server is not running:the information displayed may not be cuurrent .\r\n<\/pre>\n

\u89e3\u51b3\u65b9\u6cd5\uff1avim \/etc\/sysconfig\/selinux<\/span>\u4fee\u6539\u91cc\u9762\u7684selinux=disabled<\/span>\u540e\uff0c\u91cd\u542f\u670d\u52a1\u5668\u540e\u89e3\u51b3\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.361way.com\/zabbix-server-install\/3358.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/zabbix-zabbix-install.html<\/a>\u7f16\u8f91\uff1a\u5f20\u96c4\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u7531\u4e8eubuntu\u6e90\u91cc\u81ea\u5e26\u6709zabbix \uff0c\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7apt-get\u7684\u65b9\u5f0f\u8fdb\u884c\u5b89\u88c5\uff0c\u6240\u4ee5\u8fd9\u91cc\u5c31\u4ee5centos6 […]<\/p>\n","protected":false},"author":643,"featured_media":107511,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-107506","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/107506","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/643"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=107506"}],"version-history":[{"count":7,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/107506\/revisions"}],"predecessor-version":[{"id":107587,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/107506\/revisions\/107587"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/107511"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=107506"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=107506"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=107506"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}