Zabbix监控安装部署

1.编译安装zabbix:

useradd -s /sbin/nologin zabbix

同时安装serveragent,并支持将数据放入mysql数据库中,可使用类似命令如下配置

./configure--enable-server--enable-agent--with-mysql–enable-ipv6–with-net-snmp–with-libcurl

2.Yum install mysql http php*

   Mysql –u root

   grant all onzabbix.* to zabbix@'192.168.%.%' identified by 'qaz123';

   flush privileges

   mysql –u zabbix –pzabbix >schema.sql

   mysql –u zabbix –pzabbix >p_w_picpaths.sql

   mysql –u zabbix –pzabbix >date.sql

   要开启端口3306 iptables 或者 关闭iptables

   cp  zabbix-2.0.9/misc/init.d/fedora/core/zabbix_* /etc/init.d/

   Ln –s /usr/local/zabbix/sbin/zabbix_server /usr/local/sbin/


   chown -R zabbix.zabbix/usr/local/zabbix/

   cp –rp zabbix-2.0.9/frontends/php/*/var/www/html/


3.设置区域为上海vim /etc/php.ini

      date timezone=Asia/Shanghai

Zabbix 配置错误注意事项:

configure: error: Invalid NET-SNMP directory - unable to findnet-snmp-config

配置:错误:无效的NET-SNMP目录 - 无法找到NET-SNMP-配置

configure: error: Not found NET-SNMP library

配置:错误:未找到的NET-SNMP

解决方案:Yum install net-snmp-deve

Mysql报错

error: 'Access denied for user 'root'@'localhost' (using password:YES)'

解决方法

方法一:

# /etc/init.d/mysqld stop

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking&

# mysql -u root mysql

mysql> UPDATE user SET Password=PASSWORD(newpassword) where USER=root;

mysql> FLUSH PRIVILEGES;

mysql> quit

# /etc/init.d/mysqld restart

# mysql -uroot -p

Php 编译安装的话不要忘记添加以下参数–enable-bcmath--enable-mbstring =all

如果是YUM安装的话有可能会缺少 yum install –enable-bcmath--enable-mbstring

OR RPM install –nodeps --force