1、创建zabbix 用户与组
groupadd zabbix
useradd -g zabbix zabbix
2、从官网下载zabbix,我使用的是zabbix2.2.0,附件有安装包
3、安装方法可以参考官网
()
3、安装环境
yum install make mysql-server httpd phpmysql-devel gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmathphp-mbstring php-xml –y 4、启动mysql并初始化
service mysqld startmysql –uroot
mysql>create database zabbix character set utf8;
mysql>grant all privileges on zabbix.* to zabbix@192.168.8.180 identified by 'zabbix';
mysql> exit
进入zabbix文件夹的database/mysql下;
mysql-uzabbix -pzabbix -h192.168.8.180 zabbix<schema.sql
mysql-uzabbix -pzabbix -h192.168.8.180 zabbix<p_w_picpaths.sql
mysql-uzabbix -pzabbix -h192.168.8.180 zabbix<data.sql
配置编译
./configure --enable-server --enable-proxy--enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2 --with-libcurl
make && make install
备注:
–enable-server安装ZabbixServer
–enable-proxy安装ZabbixProxy
–enable-agent安装ZabbixAgent
–with-mysql使用mysql做数据库服务器
–with-net-snmp支持SNMP
–with-libcurl支持curl用于web 监控
5、启动ZABBIX进程
A、编辑zabbix_server.conf文 件
vi /usr/local/etc/zabbix_server.conf
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
6、拷贝ZABBIX文件到redhat系统的web目录
cd /var/www/html
mkdirzabbix
cdzabbix
cp –a /zabbix/zabbixsource/frontends/php/* /var/www/html/zabbix/
7、自动启动zabbix
cp /zabbix/zabbixsource/misc/init.d/fedora/core5/zabbix_server/etc/init.d/cp /zabbix/zabbixsource/misc/init.d/fedora/core5/zabbix_agentd /etc/init.d/chmod 700 /etc/init.d/zabbix_*
/etc/init.d/zabbix_server start/etc/init.d/zabbix_agentd startchkconfig zabbix_server onchkconfig zabbix_agentd on
8、修改php相关参数vi /etc/php.ini 找到如下几项,改成下面的值,前面有;号的要删掉max_execution_time = 300max_input_time = 300date.timezone = PRCpost_max_size = 32M
9、重启httpd/etc/init.d/httpd restart
10、访问页面
11、图形安装过程一般会有2个检查点失败,php bcmath和 php mbstring,解决方法
从http://rpm.pbone.net/网站搜索这些包php-mbstring和php-bcmath
然后在服务器上安装这些包,但是不依赖的安装
rpm -ivh php-mbstring-5.3.3-22.el6.x86_64.rpm –nodeps
rpm -ivh php-bcmath-5.3.3-6.2.x86_64.rpm --nodep
rpm –ivh php-common-5.3.3-22.el6.x86_64.rpm
安装完后,重启下zabbix_server和zabbix_agentd、httpd
登陆zabbix以后,就出现server isnot running,处理方法:
1、然后启用检测;
2、setsebool -P httpd_can_network_connect on
3、编辑zabbix.conf.php文件,把$ZBX_SERVER的值改为本机的IP地址
$ZBX_SERVER = '192.168.30.2'; #######用IP代替hostname