{"id":219,"date":"2015-12-20T23:10:18","date_gmt":"2015-12-20T15:10:18","guid":{"rendered":"http:\/\/yyshell.com\/?p=219"},"modified":"2015-12-20T23:25:08","modified_gmt":"2015-12-20T15:25:08","slug":"centos7%e5%ae%89%e8%a3%85zabbix2-4%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/yyshell.com\/?p=219","title":{"rendered":"CentOS7\u5b89\u88c5zabbix2.4\u6559\u7a0b"},"content":{"rendered":"<p>\u524d\u6bb5\u65f6\u95f4\uff0c\u516c\u53f8\u9700\u8981\u642d\u5efa\u4e00\u5957\u76d1\u63a7\u7cfb\u7edf\uff0c\u6211\u4e4b\u95f4\u63a5\u89e6\u8fc7zabbix\uff0c\u6545\u73b0\u5728\u7279\u5730\u628azabbix\u7684\u642d\u5efa\u8fc7\u7a0b\u603b\u7ed3\u4e0b\u3002\u672c\u5730\u642d\u5efa\u7684\u73af\u5883\uff1a<br \/>\n\u7cfb\u7edf\uff1aCentOS7.2<br \/>\nIP:192.168.1.106 192.168.1.107,\u4e00\u53f0\u662fzabbix\u7684web\u7aef\uff0c\u4e00\u53f0\u5b89\u88c5\u6570\u636e\u5e93\u3002<br \/>\nzabbix\u7248\u672c:2.4.7<\/p>\n<p>\u6211\u4eec\u6b64\u6b21\u5b89\u88c5\u91c7\u7528rpm\u5305\u5b89\u88c5\u7684\u65b9\u5f0f\uff0c\u901a\u8fc7yum\u8fdb\u884c\u5b89\u88c5\uff0c\u642d\u914d\u7684\u6570\u636e\u5e93\u4e3aCentOS7\u9ed8\u8ba4\u7684MariaDB\u3002<\/p>\n<ol>\n<li>\u5b89\u88c5\u5b98\u65b9yum\u6e90rpm -ivh http:\/\/repo.zabbix.com\/zabbix\/2.4\/rhel\/7\/x86_64\/zabbix-release-2.4-1.el7.noarch.rpm<\/li>\n<li>\u5b89\u88c5zabbix\u76f8\u5173\u7684\u5305yum install zabbix-server-mysql zabbix-web-mysql<\/li>\n<li>\u53e6\u5916107\u7684\u4e00\u53f0\u5b89\u88c5MariaDB\uff0cyum install mariadb-server<\/li>\n<li>\u5728106\u7684\u673a\u5668\u4e0a\u542f\u52a8httpd\uff0c\u5e76\u8bbe\u4e3a\u5f00\u673a\u542f\u52a8<br \/>\nsystemctl start httpd<br \/>\nsystemctl enable httpd<\/li>\n<li>\u9632\u706b\u5899\u5f00\u653ehttp\u670d\u52a1<br \/>\nfirewall-cmd &#8211;permanent &#8211;add-service=httpfirewall-cmd &#8211;reload<\/li>\n<li>\u5728107\u7684\u673a\u5668\u4e0a\u542f\u52a8MariaDB\uff0c\u5e76\u8bbe\u4e3a\u5f00\u673a\u542f\u52a8<br \/>\nsystemctl start mariadb<br \/>\nsystemctl enable mariadb<\/li>\n<li>\u9632\u706b\u5899\u5f00\u653e\u6570\u636e\u5e93\u670d\u52a1<br \/>\nfirewall-cmd &#8211;permanent &#8211;add-service=mysqlfirewall-cmd &#8211;reload<\/li>\n<li>\u521b\u5efa\u6570\u636e\u5e93\u548c\u5bf9\u5e94\u7684\u7528\u6237<br \/>\nmysql -uroot -p<br \/>\ncreate database zabbix character set utf8 collate utf8_bin;grant all privileges on zabbix.* to zabbix@192.168.1.106 identified by &#8216;zabbix&#8217;;<\/li>\n<li>106\u673a\u5668cd\u5230zabbix\u7684\u6570\u636e\u5e93\u521b\u5efa\u811a\u672c\u7684\u76ee\u5f55cd \/usr\/share\/doc\/zabbix-server-mysql-2.4.7\/create\/<\/li>\n<li>\u5b89\u88c5\u6570\u636e\u5e93\u5ba2\u6237\u7aefyum install mariadb<\/li>\n<li>\u767b\u5f55\u6570\u636e\u5e93\uff0c\u5bfc\u5165\u8868<br \/>\nmysql -uzabbix -pzabbix -h192.168.1.107 zabbix &lt; schema.sql<br \/>\nmysql -uzabbix -pzabbix -h192.168.1.107 zabbix &lt; images.sql<br \/>\nmysql -uzabbix -pzabbix -h192.168.1.107 zabbix &lt; data.sql<\/li>\n<li>\u7f16\u8f91php\u7684\u914d\u7f6e<br \/>\nvim \/etc\/httpd\/conf.d\/zabbix.conf<br \/>\n\u5427# php_value date.timezone Europe\/Riga \u6539\u6210php_value date.timezone Asia\/Shanghai<\/li>\n<li>\u4fee\u6539zabbix\u914d\u7f6e\u6587\u4ef6<br \/>\nvim \/etc\/zabbix\/zabbix_server.conf<br \/>\nDBHost=192.168.1.107<br \/>\nDBName=zabbix<br \/>\nDBUser=zabbix<br \/>\nDBPassword=zabbix<\/li>\n<li>\u91cd\u542fzabbix:systemctl restart zabbix-server.service<\/li>\n<li>\u6253\u5f00setsebool -P httpd_can_network_connect_db on<\/li>\n<li>106\u4e0a\u5f00\u653e\u7aef\u53e3firewall-cmd &#8211;permanent &#8211;add-port=10051\/tcp<br \/>\nfirewall-cmd &#8211;reload<\/li>\n<li>\u6253\u5f00setsebool -P httpd_can_connect_zabbix on<\/li>\n<li>\u6253\u5f00setsebool -P zabbix_can_network on<\/li>\n<li>\u7528\u6d4f\u89c8\u5668\u6253\u5f00http:\/\/192.168.1.106\/zabbix<\/li>\n<li>\u9ed8\u8ba4\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\uff1aAdmin zabbix<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u6bb5\u65f6\u95f4\uff0c\u516c\u53f8\u9700\u8981\u642d\u5efa\u4e00\u5957\u76d1\u63a7\u7cfb\u7edf\uff0c\u6211\u4e4b\u95f4\u63a5\u89e6\u8fc7zabbix\uff0c\u6545\u73b0\u5728\u7279\u5730\u628azab<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-219","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts\/219","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=219"}],"version-history":[{"count":2,"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions"}],"predecessor-version":[{"id":221,"href":"https:\/\/yyshell.com\/index.php?rest_route=\/wp\/v2\/posts\/219\/revisions\/221"}],"wp:attachment":[{"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yyshell.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}