公司的zabbix2.0用了很久了,想尝试更新一下。
一、安装环境缺少的包
yum -y install wget net-snmp-devel OpenIPMI-devel httpd openssl-devel java lrzsz fping-devel libcurl-devel perl-DBI pcre-devel libxml2 libxml2-devel mysql-devel gcc php php-bcmath php-gd php-xml php-mbstring php-ldap php-mysql.x86_64 php-pear php-xmlrpc net-tools wget vim-enhanced
关闭selinux配置
systemctl stop firewall
systemctl disable firewall
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
二、安装服务器端包
#rpm -ivh http://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm
#yum clean all
#yum install zabbix-server-mysql zabbix-web-mysql
三、安装数据库
#yum -y install mariadb-server
启动mariadb
# systemctl start mariadb
之前的服务管理命令还可以用
# service mariadb start
设置开机自启动
# systemctl enable mariadb
安全初始化,设置root密码等
# mysql_secure_installation
导入数据库文件:
[root@zabbix3 ~]# cd /usr/share/doc/zabbix-server-mysql-3.0.7/
[root@zabbix3 zabbix-server-mysql-3.0.7]# ls
AUTHORS ChangeLog COPYING create.sql.gz NEWS README
[root@zabbix3 zabbix-server-mysql-3.0.7]# zcat create.sql.gz | mysql -uroot zabbix
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@zabbix3 zabbix-server-mysql-3.0.7]# zcat create.sql.gz | mysql -uroot -p zabbix
Enter password:
[root@zabbix3 zabbix-server-mysql-3.0.7]#
四、启动zabbix server端
修改 Zabbix Server 配置,并启动 Zabbix Server 服务
# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
快捷操作命令:
# sed -i "s/# DBHost/DBHost/g" zabbix_server.conf
# sed -i "s/# DBPassword=/DBPassword=zabbix/g" zabbix_server.conf
启动zabbix-server服务
# systemctl start zabbix-server
[root@zabbix3 zabbix]# ps -ef | grep zabbix
zabbix 14505 1 0 16:38 ? 00:00:00 /usr/sbin/zabbix_server -c /etc/zabbix/zabbix_server.conf开机自启动zabbix-server服务
# systemctl enable zabbix-server
五、修改PHP、apache等
编辑PHP配置
# vi /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value always_populate_raw_post_data -1
php_value date.timezone Asia/Shanghai
快捷修改命令
# sed -i "s/# php_value date.timezone Europe\/Riga/php_value date.timezone Asia\/Shanghai/g" /etc/httpd/conf.d/zabbix.conf
启动Apache服务
# systemctl start httpd
开机启动Apache服务
# systemctl enable httpd
六、登陆 Zabbix 管理页面http://虚拟机IP/zabbix/,显示Zabbix安装向导。
(后面的看着点击就是)
七、安装zabbix agent
八、其他配置,更换字体等参考这2篇文章
http://www.tuicool.com/articles/V363Unj
http://www.linuxidc.com/Linux/2016-11/137044.htm