從零開始的監控系統安裝(使用zabbix)
從零開始的監控系統安裝(使用zabbix3.2)
下載位置
https://www.zabbix.com/download?zabbix=3.2&os_distribution=centos&os_version=6&db=MySQL
一、添加zabbix的rpm源
rpm -i http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm
二、安裝Zabbix Server
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
三、安裝功能相依插件
yum -y install php-bcmath php-mbstring php-xml curl curl-devel net-snmp net-snmp-devel net-snmp-utils perl-DBI
四、設定Zabbix SQL
mysql -uroot -p
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix888';
mysql> flush privileges;
mysql> quit;
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
五、設定Zabbix Server
vim /etc/zabbix/zabbix_server.conf
修改 DBPassword=password六、修改時區
vim /etc/php.ini
date.timezone = "Asia/Taipei"
重啟php-fpmpkill php-fpm
/usr/local/web/php/sbin/php-fpm
七、修改nginx設定檔
vim zabbix.conf
#---------------------------------------------------------------------------------#server{
listen 80;
server_name zabbix.mis;
root /usr/share/zabbix/;
index index.php;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
#---------------------------------------------------------------------------------#
/usr/local/web/nginx/sbin/nginx -t
/usr/local/web/nginx/sbin/nginx -s reload
六、啟動zabbix server
service zabbix-server start
service zabbix-agent start
===========================================
可能出現error
1.Warning: require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Permission denied in /usr/share/zabbix/include/classes/core/ZBase.php on line 269
解決方法:
chmod -R 777 /etc/zabbix/web
2.Error connecting to database: No such file or directory
解決方法
ln -s /var/lib/mysql/mysql.sock /tmp/
安裝Zabbix-agent
一、添加zabbix的rpm源
rpm -i http://repo.zabbix.com/zabbix/3.2/rhel/6/x86_64/zabbix-release-3.2-1.el6.noarch.rpm
二、安裝Zabbix Agent
yum -y install zabbix-agent
vi /etc/zabbix/zabbix_agentd.conf
修改
Server="Server ip"
啟動agent
service zabbix-agent start
如有firewall需開啟10050,10051
留言
張貼留言