==== 安装 ==== - 禁用selinux,iptables - 先添加一个zabbix的官方yum源 sudo rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm - 安装软件及依赖:sudo yum -y install iksemel libssh2 zabbix-server-mysql zabbix-web-mysql mysql-server zabbix-agent install net-snmp-devel net-snmp-libs net-snmp-perl net-snmp-utils net-snmp httpd mysql-server === 配置mysql === * mysql> create database zabbixdb character set utf8 collate utf8_bin; * mysql> grant all privileges on zabbixdb.* to zabbix@localhost identified by 'zabbix'; * mysql -uzabbix -pzabbix zabbixdb < /usr/share/doc/zabbix-server-mysql-2.4.7/create/schema.sql * mysql -uzabbix -pzabbix zabbixdb < /usr/share/doc/zabbix-server-mysql-2.4.7/create/images.sql * mysql -uzabbix -pzabbix zabbixdb < /usr/share/doc/zabbix-server-mysql-2.4.7/create/data.sql === 配置zabbix === sudo vim /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbixdb DBUser=zabbix DBPassword=zabbix === 配置php === sudo vim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai # 修改这一行即可 === 其他配置 === 添加固定服务端口,以便于后期监测和防火墙监控端口 sudo vim /etc/services zabbix-agent 10050/tcp # zabbix-agent-tcp,agent端需要配置 zabbix-agent 10050/udp # zabbix-agent-udp,agent端需要配置 zabbix-trapper 10051/tcp # zabbix-trapper-tcp,server端需要配置 zabbix-trapper 10051/udp # zabbix-trapper-udp,server端需要配置 === 启动 === * sudo chkconfig httpd on ; sudo service httpd start * sudo chkconfig mysqld on ; sudo service mysqld start * sudo chkconfig snmpd on ; sudo service snmpd start * sudo chkconfig snmptrapd on ; sudo service snmptrapd start * sudo chkconfig zabbix-agent on ; sudo service zabbix-agent start * sudo chkconfig zabbix-server on ; sudo service zabbix-server start 进入图形安装界面 * 输入http://localhost/zabbix * 一步一步配置下去就完成了(除了数据库连接哪一步需要验证一下,其他步骤默认即可) * 默认登陆密码 * Admin (A大写) * zabbix === Agent端配置 === * sudo rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm * sudo yum install zabbix-agent * sudo service zabbix-agent start vim /etc/zabbix/zabbix_agentd.conf 主要是配置 Hostname=master # 这个名字要和web界面中host的name一样,不然日志中会报异常 Server=192.168.0.4,192.168.0.5 #被动模式,允许哪些Zabbix-Server向我发送请求,不要写127.0.0.1 ServerActive=192.168.0.5:10051 #主动模式,我要发动哪些zabbix-server上 ==== 配置原则 ==== {{:pasted:20151128-141509.png}}