SSL: 1
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
Warning: Cannot modify header information - headers already sent by (output started at /www/blog/wp-includes/load.php:1646) in /www/blog/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":260,"date":"2016-05-21T12:46:37","date_gmt":"2016-05-21T04:46:37","guid":{"rendered":"https:\/\/blog.weskiller.com\/?p=260"},"modified":"2016-06-13T10:17:40","modified_gmt":"2016-06-13T02:17:40","slug":"zabbix","status":"publish","type":"post","link":"https:\/\/blog.gamein.vip\/zabbix.html","title":{"rendered":"Zabbix"},"content":{"rendered":"
\u5b98\u65b9\u7ad9\u70b9www.zabbix.com<\/a> Zabbix\u7684WEB\u9875\u9762\u914d\u7f6e\u5c31\u4e0d\u518d\u8be6\u7ec6\u8bb2\u8ff0\u3002\uff08\u4e0b\u4e00\u6b65\uff0c\u4e0b\u4e00\u6b65\u3002\uff09
\n\u5728\u76d1\u63a7\u5f00\u6e90\u8f6f\u4ef6\u65b9\u9762\u3002Zabbix\u53ef\u8c13\u662f\u96c6\u5927\u6210\u8005\uff0c\u5927\u5305\u5927\u63fd\uff0c\u5305\u542b\u4e86agent\uff0cserver\uff0cproxy\uff0cgraphic\u3002\u800c\u4e14\u90fd\u505a\u7684\u76f8\u5bf9\u4e0d\u9519\uff0c\u7ed9\u6211\u4eec\u8fd9\u6837\u7684\u61d2\u4eba\u8fd0\u7ef4\u4eba\u5458\u5e2e\u52a9\u7b80\u76f4\u4e0d\u8981\u592a\u5927\u3002
\n\u800c\u4e14\u7b80\u6613\u7684\u5b89\u88c5\u65b9\u5f0f\uff0c\u4e5f\u662f\u4ed6\u53d7\u4f17\u591a\u8fd0\u7ef4\u559c\u7231\u7684\u539f\u56e0\u3002
\nzabbix_server<\/span>
\n*\u9700\u8981\u4e8b\u5148\u652f\u6301php\u73af\u5883,\u535a\u4e3b\u73af\u5883\u4e3anginx+mariadb+php
\n*\u7cfb\u7edf\u73af\u5883CentOS Linux release 7.2.1511 (Core)
\n*\u4f7f\u7528\u6700\u65b0\u7248\u672c\u7684Zabbix3.0.3
\n*Zabbix\u4e0b\u8f7d\u5730\u5740 www.zabbix.com\/download.php<\/a><\/p>\n\r\n\r\n[11:38:34 \/usr\/local\/src]#wget http:\/\/iweb.dl.sourceforge.net\/project\/zabbix\/ZABBIX%20Latest%20Stable\/3.0.3\/zabbix-3.0.3.tar.gz\r\n[11:41:10 \/usr\/local\/src]#tar xf zabbix-3.0.3.tar.gz\r\n[11:41:47 \/usr\/local\/src]#cd zabbix-3.0.3\r\n[11:42:22 \/usr\/local\/src\/zabbix-3.0.3]#yum install -y net-snmp-devel net-snmp net-snmp-config #\u4f7fzabbix\u652f\u6301net-snmp\r\n[11:44:42 \/usr\/local\/src\/zabbix-3.0.3]#.\/configure --prefix=\/usr\/local\/zabbix \\\r\n--enable-server \\\r\n--enable-agent \\\r\n--with-net-snmp \\\r\n--with-libcurl \\\r\n--with-libxml2 \\\r\n--enable-proxy \\\r\n--with-mysql=\/usr\/local\/mariadb\/bin\/mysql_config\r\n[11:47:34 \/usr\/local\/src\/zabbix-3.0.3]#make && make install\r\n[11:54:22 \/usr\/local\/src\/zabbix-3.0.3]#cp -a misc\/init.d\/fedora\/core\/zabbix_server \/etc\/init.d\r\n[11:54:27 \/usr\/local\/src\/zabbix-3.0.3]#vi \/etc\/init.d\/zabbix_server #\u4fee\u6539BASEDIR\r\n # Zabbix-Directory\r\n BASEDIR=\/usr\/local\/zabbix\r\n[11:55:15 \/usr\/local\/src\/zabbix-3.0.3]#vi \/etc\/services #\u4e3a\u7cfb\u7edf\u6dfb\u52a0\u89e3\u6790\u670d\u52a1\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[11:57:45 \/usr\/local\/src\/zabbix-3.0.3]#vi \/usr\/local\/zabbix\/etc\/zabbix_server.conf #\u914d\u7f6ezabbix_server\r\nDBHost=localhost #\u6709\u65f6\u914d\u7f6e\u4e3alocalhost\uff0czabbix_server\u65e0\u6cd5\u8fde\u63a5\u6570\u636e\u5e93\uff0c\u914d\u7f6e\u4e3a127.0.0.1\u5373\u53ef\uff0c\u4fdd\u7559\u7591\u95ee\r\nDBName=zabbix\r\nDBUser=zabbix\r\nDBPassword=zabbix\r\nDBSocket=\/data\/mariadb\/mariadb.sock\r\nListenIP=192.168.0.100 #\u914d\u7f6e\u76d1\u542c\u7684\u7aef\u53e3\r\nLogFile=\/var\/log\/zabbix\/zabbix_server.log #\u65e5\u5fd7\u8def\u5f84\r\nPidFile=\/var\/log\/zabbix\/zabbix_server.pid\r\n[12:00:31 \/usr\/local\/src\/zabbix-3.0.3]#useradd -r zabbix #\u6dfb\u52a0\u7cfb\u7edf\u7528\u6237\r\n[12:00:37 \/usr\/local\/src\/zabbix-3.0.3]#mkdir -p \/var\/log\/zabbix\r\n[12:00:41 \/usr\/local\/src\/zabbix-3.0.3]#chown -R zabbix.zabbix \/var\/log\/zabbix\r\n[12:02:45 \/usr\/local\/src\/zabbix-3.0.3]#mysql\r\ngrant all privileges on zabbix.* to zabbix@'localhost' identified by 'zabbix'; #\u6388\u6743mariadb\u7528\u6237\r\nflush privileges;\r\n[12:02:45 \/usr\/local\/src\/zabbix-3.0.3]#mysql -u zabbix -pzabbix zabbix < database\/mysql\/schema.sql\r\n[12:03:48 \/usr\/local\/src\/zabbix-3.0.3]#mysql -u zabbix -pzabbix zabbix < database\/mysql\/images.sql \r\n[12:04:02 \/usr\/local\/src\/zabbix-3.0.3]#mysql -u zabbix -pzabbix zabbix < database\/mysql\/data.sql\r\n[12:04:11 \/usr\/local\/src\/zabbix-3.0.3]#service zabbix_server start #\u542f\u52a8zabbix_server\u670d\u52a1\r\n[12:05:46 \/usr\/local\/src\/zabbix-3.0.3]#tail -f \/var\/log\/zabbix\/zabbix_server.log #\u67e5\u770bzabbix_server\u542f\u52a8\u540e\uff0c\u751f\u4ea7\u65e5\u5fd7\uff0c\u6392\u9664\u6545\u969c\r\n[12:05:59 \/usr\/local\/src\/zabbix-3.0.3]#ps aux|grep zabbix_server #\u68c0\u67e5\u8fdb\u7a0b\uff0c\u670d\u52a1\u5df2\u7ecf\u6b63\u5e38\u542f\u52a8\r\nzabbix 4685 0.0 0.1 143872 1688 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: housekeeper [startup idle for 30 minutes]\r\nzabbix 4686 0.0 0.2 143864 2184 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: timer #1 [processed 0 triggers, 0 events in 0.000020 sec, 0 maintenances in 0.000000 sec, idle 30 sec]\r\nzabbix 4689 0.0 0.1 143864 2000 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: http poller #1 [got 0 values in 0.000630 sec, idle 5 sec]\r\nzabbix 4690 0.0 0.4 248332 4244 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: discoverer #1 [processed 0 rules in 0.000555 sec, idle 60 sec]\r\nzabbix 4691 0.0 0.1 143872 1904 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: history syncer #1 [synced 0 items in 0.000002 sec, idle 1 sec]\r\nzabbix 4693 0.0 0.1 143872 1904 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: history syncer #2 [synced 0 items in 0.000001 sec, idle 1 sec]\r\nzabbix 4694 0.0 0.1 143872 1904 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: history syncer #3 [synced 0 items in 0.000001 sec, idle 1 sec]\r\nzabbix 4695 0.0 0.1 143872 1904 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: history syncer #4 [synced 0 items in 0.000001 sec, idle 1 sec]\r\nzabbix 4696 0.0 0.1 143868 1992 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: escalator #1 [processed 0 escalations in 0.000187 sec, idle 3 sec]\r\nzabbix 4697 0.0 0.1 143872 1904 ? S 12:20 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_server: proxy poller #1 [exchanged data with 0 proxies in 0.000002 sec, idle 5 sec]\r\n[12:08:12 \/usr\/local\/src\/zabbix-3.0.3]#cp -a frontends\/php \/www\/zabbix #\u914d\u7f6ephp\u524d\u6bb5\r\n[12:10:03 \/usr\/local\/src\/zabbix-3.0.3]#chown -R www.www \/www\/zabbix #\u6388\u6743\u8bbf\u95ee\r\n[12:13:43 \/usr\/local\/src\/zabbix-3.0.3]#semanage fcontext -a -t unconfined_t "\/www\/zabbix(\/.*)?" #\u5728selinux\u5f00\u542f\u7684\u60c5\u51b5\u4e0b\u4f60\u53ef\u80fd\u8fd8\u9700\u8981\u8fd9\u6837\u7684\u64cd\u4f5c,\u7531\u4e8enginx\u4e3a\u7f16\u8bd1\u5b89\u88c5\u6240\u4ee5\u53e5\u67c4\u4e3aunconfined_t\uff0c\u8bf7\u4f7f\u7528ps auxZ\u67e5\u770bWEB\u670d\u52a1\u8fdb\u7a0b\u3002\r\n[12:18:21 \/usr\/local\/src\/zabbix-3.0.3]#vi \/usr\/local\/php\/etc\/php.ini #\u914d\u7f6ephp\u652f\u6301zabbix\u7684\u9700\u6c42\r\nmax_execution_time = 300\r\nmax_input_time = 300\r\nalways_populate_raw_post_data = -1\r\n[12:18:21 \/usr\/local\/src\/zabbix-3.0.3]#service php-fom restart #\u91cd\u542fphp-fpm\u751f\u6548\u914d\u7f6e\r\n<\/pre>\n
\n*\u6e29\u99a8\u63d0\u9192\uff0czabbix\u7684\u9ed8\u8ba4\u7528\u6237\u4e3aadmin\uff0c\u5bc6\u7801\u4e3azabbix\u3002
\n\u81ea\u6b64zabbix_server\u5c31\u5df2\u7ecf\u5b89\u88c5\u6210\u529f\u3002
\nzabbix_agent<\/span>
\n\u63a5\u4e0b\u6765zabbix_agent\u7684\u5b89\u88c5\u3002\u57fa\u672c\u4e0a\u6b65\u9aa4\u548cserver\u76f8\u540c\uff0c\u5b89\u88c5\u5c31\u4e0d\u518d\u591a\u53d9\u8ff0<\/p>\n\r\n[13:31:21 \/usr\/local\/src\/zabbix-3.0.3]#cp -a misc\/init.d\/fedora\/core\/zabbix_agentd \/etc\/init.d\r\n[13:33:27 \/usr\/local\/src\/zabbix-3.0.3]#vi \/etc\/init.d\/zabbix_server #\u4fee\u6539BASEDIR\r\n # Zabbix-Directory\r\n BASEDIR=\/usr\/local\/zabbix\r\n[13:33:27 \/usr\/local\/src\/zabbix-3.0.3]#vi \/usr\/local\/zabbix\/etc\/zabbix_agentd.conf\r\nLogFile=\/var\/log\/zabbix\/zabbix_server.log\r\nPidFile=\/var\/log\/zabbix\/zabbix_server.pid\r\nServer=192.168.0.1 #\u6307\u5b9azabbix_server\u7684\u5730\u5740\r\nHostname=node1\r\n[13:36:22 \/usr\/local\/src\/zabbix-3.0.3]#vi \/etc\/services #\u4e3a\u7cfb\u7edf\u6dfb\u52a0\u89e3\u6790\u670d\u52a1\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[13:38:27 \/usr\/local\/src\/zabbix-3.0.3]#service zabbix_agentd start\r\n[14:39:44 \/usr\/local\/src\/zabbix-3.0.3]#tail -f \/var\/log\/zabbix\/zabbix_server.log #\u67e5\u770bzabbix_server\u542f\u52a8\u540e\uff0c\u751f\u4ea7\u65e5\u5fd7\uff0c\u6392\u9664\u6545\u969c\r\n[12:39:46 \/usr\/local\/src\/zabbix-3.0.3]#ps aux|grep zabbix_agentd #\u68c0\u67e5\u8fdb\u7a0b\uff0c\u670d\u52a1\u5df2\u7ecf\u6b63\u5e38\u542f\u52a8\r\nzabbix 6153 0.0 0.1 84132 1340 ? S 13:29 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_agentd\r\nzabbix 6154 0.0 0.1 84132 1392 ? S 13:29 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_agentd: collector [idle 1 sec]\r\nzabbix 6155 0.0 0.1 84132 1648 ? S 13:29 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_agentd: listener #1 [waiting for connection]\r\nzabbix 6156 0.0 0.1 84132 1652 ? S 13:29 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_agentd: listener #2 [waiting for connection]\r\nzabbix 6157 0.0 0.1 84132 1632 ? S 13:29 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_agentd: listener #3 [waiting for connection]\r\nzabbix 6158 0.0 0.1 84132 1336 ? S 13:29 0:00 \/usr\/local\/zabbix\/sbin\/zabbix_agentd: active checks #1 [idle 1 sec]\r\nroot 6646 0.0 0.0 112644 968 pts\/1 S+ 13:37 0:00 grep --color=auto zabbix_agentd\r\n<\/pre>\n