一,环境准备1,安装lamp平台#yum -y install mysql-server mysql php php-mysql 2,创建库CREATE DATABASE zabbix CHARACTER SET utf8;3,授权主机GRANT ALL ON zabbix. TO 'zuser'@'ip' IDENTIFIED BY 'password';4,授权主机名GRANT ALL ON zabbix. TO 'zuser'@'本地主机名' IDENTIFIED BY 'password';5,FLUSH privileges;二,配置安装zabbix-server1,下载最新的zabbix yum库文件#wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm2,安装库文件#rpm -ivh zabbix-release-2.4-1.el6.noarch.rpm3,安装包组#yum install zabbix zabbix-server zabbix-web zabbix-agent zabbix-web-mysql zabbix-get zabbix-sender如果这里安装提示出错,请手动下载安装# wget http://repo.zabbix.com/non-supported/rhel/6/x86_64/fping-2.4b2-16.el6.x86_64.rpm # wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-web-2.4.6-1.el6.noarch.rpm # wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-server-mysql-2.4.6-1.el6.x86_64.rpm # yum localinstall zabbix-server-mysql-2.4.6-1.el6.x86_64.rpm zabbix-web-2.4.6-1.el6.noarch.rpm fping-2.4b2-16.el6.x86_64.rpm 4,查看zabbix文件是否已经存在# find /etc/httpd/conf.d/zabbix.conf /etc/httpd/conf.d/zabbix.conf5,启动httpd#service httpd start6,启动mysql#service mysqld start7,依次安装顺序导入sql脚本# mysql zabbix < /usr/share/doc/zabbix-server-mysql-2.4.6/create/schema.sql # mysql zabbix < /usr/share/doc/zabbix-server-mysql-2.4.6/create/images.sql # mysql zabbix < /usr/share/doc/zabbix-server-mysql-2.4.6/create/data.sql8,修改关键配置文件 #cp /etc/zabbix/zabbix_server.conf{,.bak}# vim /etc/zabbix/zabbix_server.confDBHost=192.168.233.130DBUser=zuserDBPassword=passwordDBSocket=/var/lib/mysql/mysql.sock9,修改时区# vim /etc/php.inidate.timezone = Asia/Shanghai10,再次重启# service httpd restart# service zabbix-server start11,开机启动配置# chkconfig --add zabbix-server# chkconfig zabbix-server on# chkconfig --add httpd # chkconfig httpd on# chkconfig --add mysqld# chkconfig mysqld on12,关闭selinux和iptables#selinux:setenforce 0#service iptables stop三,监控zabbix-server本机1,安装包:zabbix-sender zabbix-agent 2,修改配置文件#vim /etc/zabbix/zabbix-agentd.conf对于当前主机来讲,server端是本机,监控端也是本机127.0.0.1是不可以修改的。但是可以追加多项IPServer=127.0.0.1,{zabbix-server-ipadder} 服务端来获取数据的地址。ServerActive=127.0.0.1, 主动发向服务端的地址。Hostname=zabbix-agent 全局唯一,最好使用dns解析名。这里的hostname主要推送数据#service zabbix-agentd start#chkconfig --add zabbix-agent#chkconfig zabbix-agent on四,监控linux主机1,下载yum包#wget http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm#rpm -ivh zabbix-release-2.4-1.el6.noarch.rpm2,安装监控包# yum -y install zabbix-agent zabbix-sender zabbix3,配置文件#vim /etc/zabbix/zabbix-agentd.confServer=192.168.233.130 zabbix-server服务端IPServerActive=192.168.233.130 zabbix-server服务端IPHostname=zabbix-agent 全局唯一,最好使用dns解析名。这里的hostname主要推送数据#service zabbix-agentd start而后在web也没添加主机,这里省略五,监控windows主机1,在官网下载对应程序的安装包:# wget http://www.zabbix.com/downloads/2.4.1/zabbix_agents_2.4.1.win.zip# unzip zabbix_agents_2.4.1.win.zip2,而后将/bin下的win 64或win 32的三个文件复制至windows c盘3,并将conf下配置文件修改,如下提示:# cp zabbix_agentd.win.conf{,.bak}# vim zabbix_agentd.win.confServer=192.168.233.130 zabbix-server服务端IPServerActive=192.168.233.130 zabbix-server服务端IPHostname=zabbix-agent 全局唯一,最好使用dns解析名。这里的hostname主要推送数据4,修改配置完成后再将文件复制到windows c盘5,打开cmd切换到c盘,安装提示进行安装C:UsersAdministrator>cd c:<br />c:zabbix-agent 的目录2015/10/02 22:30 <DIR> .2015/10/02 22:30 <DIR> ..2015/10/02 22:19 401,408 zabbix_agentd.ex2015/10/02 22:22 7,263 zabbix_agentd.win.conf2015/10/02 22:19 129,536 zabbix_get.exe2015/10/02 22:19 164,352 zabbix_sender.ex 4 个文件 702,559 字节 2 个目录 68,952,412,160 可用字节安装c:zabbix-agent>zabbix_agentd.exe -c c:zabbix-agentzabbix_agentd.win.conf -izabbix_agentd.exe [6128]: service [Zabbix Agent] installed successfullyzabbix_agentd.exe [6128]: event source [Zabbix Agent] installed successfully启动c:zabbix-agent>zabbix_agentd.exe --startzabbix_agentd.exe [4848]: service [Zabbix Agent] started successfullyc:zabbix-agent>当你发现你的windows服务里面有个zabbix-agent已经启动,证明你已经OK而后在浏览器中输入zabbix的服务端地址:10051端口,如果出现ok则显示正常。