Zabbix_Server安装
Zabbix_Server安装
环境:LNMP
准备工作:
1.数据库操作
mysql> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;
Query OK, 1 row affected (0.03 sec) #创建zabbix数据库,字符集设置为utf8
mysql> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY 'zabbix';
Query OK, 0 rows affected (0.00 sec) # 赋予zabbix用户对zabbix数据库的全部权限,同时在mysql数据库中创建zabbix用户
2.PHP
[root@localhost ~]# vi /usr/local/php-5.5.0/etc/php.ini #zabbix 硬性要求
375 max_execution_time = 300
396 memory_limit = 128M
663 post_max_size = 16M
795 upload_max_filesize = 2M
385 max_input_time = 300
913 date.timezone = PRC
安装zabbix_server
[root@localhost media]# tar zxvf zabbix-3.0.3rc1.tar.gz
[root@localhost media]# cd zabbix-3.0.3rc1
[root@localhost zabbix-3.0.3rc1]# ./configure --prefix=/usr/local/zabbix-3.0.3/ --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --enable-java
[root@localhost zabbix-3.0.3rc1]# make && make install
创建zabbix用户和组
[root@localhost zabbix-3.0.3rc1]# groupadd zabbix
[root@localhost zabbix-3.0.3rc1]# useradd -g zabbix zabbix
修改zabbix配置文件
[root@localhost ~]# vi /usr/local/zabbix-3.0.3/etc/zabbix_server.conf
87 DBName=zabbix
103 DBUser=zabbix
111 DBPassword=zabbix
导入数据库
[root@localhost ~]# cd /media/zabbix-3.0.3rc1/database/mysql/
[root@localhost mysql]# mysql -u zabbix -p zabbix < schema.sql
[root@localhost mysql]# mysql -u zabbix -p zabbix < p_w_picpaths.sql
zabbix web部署
[root@localhost ~]# cp -a /media/zabbix-3.0.3rc1/frontends/php/* /usr/local/nginx-1.6.0/html/
服务器启动配置
[root@localhost ~]# cp /media/zabbix-3.0.3rc1/misc/init.d/debian/zabbix-server /etc/init.d/
[root@localhost ~]# cp /media/zabbix-3.0.3rc1/misc/init.d/debian/zabbix-agent /etc/init.d/
[root@localhost ~]# chmod +x /etc/init.d/zabbix-server
[root@localhost ~]# chmod +x /etc/init.d/zabbix-agent
[root@localhost conf]# chkconfig --add zabbix-server
[root@localhost conf]# chkconfig --add zabbix-agent
启动服务
[root@localhost conf]# service zabbix-server start
[root@localhost conf]# service zabbix-agent start
测试访问:http://ip
Ps:这个错误是没有权限,可以收到下载完之后放在目录里面