标签:监控服务器
1、安装LAMP环境及依赖包
[root@localhost ~]# yum install make gcc mysql-server mysql-devel libcurl-devel net-snmp-devel php php-gd php-xml php-mysql php-mbstring php-bcmath httpd -y
2、添加用户
[root@localhost ~]# groupadd zabbix
[root@localhost ~]# useradd zabbix -g zabbix
3、创建数据库,添加用户授权
[root@localhost ~]# /etc/init.d/mysqld start
[root@localhost ~]# mysql -e "create database zabbix character set utf8;"
[root@localhost ~]# mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by ‘123456‘;"
4、编译安装zabbix
[root@localhost ~]# cd /usr/local/src/
[root@localhost ~]#wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX Latest Stable/2.2.3/zabbix-2.2.3.tar.gz
[root@localhost src]# tar zxf zabbix-2.0.2.tar.gz
[root@localhost src]# cd zabbix-2.0.2
[root@localhost zabbix-2.0.2]# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl
[root@localhost zabbix-2.0.2]# make install
5、导入数据库
[root@localhost zabbix-2.0.2]# mysql -uzabbix -p‘123456‘ zabbix < database/mysql/schema.sql
[root@localhost zabbix-2.0.2]# mysql -uzabbix -p‘123456‘ zabbix < database/mysql/images.sql
[root@localhost zabbix-2.0.2]# mysql -uzabbix -p‘123456‘ zabbix < database/mysql/data.sql
6、拷贝、修改配置文件
[root@localhost zabbix-2.0.2]# sed -i ‘s/^DBUser=.*$/DBUser=zabbix/g‘ /usr/local/zabbix/etc/zabbix_server.conf
[root@localhost zabbix-2.0.2]# sed -i ‘s/^.*DBPassword=.*$/DBPassword=123456/g‘ /usr/local/zabbix/etc/zabbix_server.conf
[root@localhost zabbix-2.0.2]# cp -r frontends/php /var/www/html/zabbix
[root@localhost zabbix-2.0.2]# cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
[root@localhost zabbix-2.0.2]#sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘ /etc/init.d/zabbix_server
[root@localhost zabbix-2.0.2]#sed -i ‘s/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g‘ /etc/init.d/zabbix_agentd
7、添加服务端口
[root@localhost ~]# cat >>/etc/services <<EOF
> zabbix-agent 10050/tcp Zabbix Agent
> zabbix-agent 10050/udp Zabbix Agent
> zabbix-trapper 10051/tcp Zabbix Trapper
> zabbix-trapper 10051/udp Zabbix Trapper
> EOF
8、修改php.ini
[root@localhost ~]#sed -i ‘s/^\(.*\)date.timezone =.*$/date.timezone = Asia\/Shanghai/g‘ /etc/php.ini
[root@localhost ~]#sed -i ‘s/^\(.*\)post_max_size =.*$/post_max_size = 16M/g‘ /etc/php.ini
[root@localhost ~]#sed -i ‘s/^\(.*\)max_execution_time =.*$/max_execution_time = 300/g‘ /etc/php.ini
[root@localhost ~]#sed -i ‘s/^\(.*\)max_input_time =.*$/max_input_time = 300/g‘ /etc/php.ini
9、启动服务
[root@localhost ~]# /etc/init.d/zabbix_server start
[root@localhost ~]# /etc/init.d/zabbix_agentd start
[root@localhost ~]# /etc/init.d/httpd start
10、WEB配置服务
11、检查PHP环境
12、数据库配置
13、主机及端口
14、配置预览
15、配置Fail,点击Save configuration file将zabbix.conf.php保存到本地,再上传至服务器/var/www/html/zabbix/conf目录,然后Retry(不要使用迅雷等第三方下载)
16、刷新后配置正确,点击Finsh完成即可
17、登陆界面,初始用户名为:admin 密码:zabbix
18、登陆首页后,看到zabbix server is running的状态为yes,则代表zabbix监控服务器部署成功
本文出自 “linux运维实战” 博客,谢绝转载!
标签:监控服务器
原文地址:http://zhengxiongcai.blog.51cto.com/9997166/1620790