server端侦听在10051端口,客户端侦听在10050端口。用户界面使用php开发。数据存储在MySQL里面。安装几次都要重新看,目前将Zabbix配置安装进行整理如下
Zabbix配置需要web、php、mysql、gcc等支持 请自行配置好 接下来我们开始操作 操作范例的操作系统为Centos 5.2
wgethttp://prdownloads.sourceforge.net/zabbix/zabbix-1.6.4.tar.gz?download(2009-04-22***版) tarzxvfzabbix-1.6.2.tar.gz mysql-uroot-p mysql>createdatabaseszabbix; mysql>GRANTALLPRIVILEGESONzabbix.*TOzabbix@localhostIDENTIFIEDBY‘zabbix’WITHGRANTOPTION; mysql>usezabbix; mysql>source/usr/local/src/zabbix-1.6.2/create/schema/mysql.sql mysql>source/usr/local/src/zabbix-1.6.2/create/data/data.sql mysql>source/usr/local/src/zabbix-1.6.2/create/data/images_mysql.sql cdzabbix-1.6.2
./configure –prefix=/usr/local/zabbix/ \ //指定安装目录 –enable-server \ //安装server,被监控节点不需要 –enable-agent \ //安装agent –with-mysql \ //需要mysql支持需要指定目录 –with-net-snmp //需要snmp支持需要指定目录 常用的编译选项如下,需要更多的可以看帮助
–enable-staticBuildstaticallylinkedbinaries –enable-serverTurnonbuildofserver –enable-proxyTurnonbuildofproxyserver –enable-agentTurnonbuildofagent –enable-ipv6TurnonsupportofIPv6 –with-mysql –with-oracle –with-pgsql –with-sqlite3 –with-jabber –with-net-snmp –with-ucd-snmp
Zabbix配置客户端只需执行: ./configure –prefix=/usr/local/zabbix –enable-agent make && make install
Zabbix配置安装过程没有报错基本就OK,接下来增加对应的端口:
vi /etc/services 加入
zabbix_agent10050/tcp#zabbixagent zabbix_agent10050/udp#zabbixagent zabbix_trapper10051/tcp#zabbixtrapper zabbix_trapper10051/udp#zabbixtrapper
复制配置文件和服务启动脚本 cp -rf misc/conf /opt/app/zabbix/etc -R 到 misc/init.d/ 选择一个自己合适自己环境的启动脚本,或者自己写一个 添加一个zabbix用户 useradd zabbix 然后用脚本启动
zabbix_server和zabbix_agentd [root@zabbix~]#ll/usr/local/zabbix/sbin/ total2344 -rwxr-xr-x1rootroot362581Apr1622:55zabbix_agent -rwxr-xr-x1rootroot425336Apr1622:55zabbix_agentd -rwxr-xr-x1rootroot136854Apr1622:55zabbix_get -rwxr-xr-x1rootroot163086Apr1622:55zabbix_sender -rwxr-xr-x1rootroot1284665Apr1622:55zabbix_server
Zabbix配置回到zabbix的编译目录: 生成配置文件: mkdir /etc/zabbix cp misc/conf/* /etc/zabbix/ vi frontends/php/include/db.inc.php 更改数据库相关内容:
$DB_TYPE="MYSQL"; $DB_SERVER="localhost"; $DB_DATABASE="zabbix"; $DB_USER="zabbix"; $DB_PWD="zabbix"; cp-rffrontends/php/var/www/html/zabbix-R
Zabbix配置访问web:http://localhost/zabbix进行安装 php环境需求
PHPversion:5.2.8Ok PHPMemorylimit:128MOk PHPpostmaxsize:8MOk PHPmaxexecutiontime:300secOk PHPDatabasessupport:MySQLOk PHPBCmathsupportyesOk GDVersion:bundled(2.0.34compatible)Ok Imageformats:PNGOk PHPTimezone:Asia/Shanghai
注:gd-devel没有安装上去将无法在web端安装过去,对应的其他也要安装,比如net-snmp,可通过yum来安装,方便。
[root@zabbix~]#rpm-qa|grepgd gd-devel-2.0.33-9.4.el5_1.1 gd-2.0.33-9.4.el5_1.1
安装php-bcmath yum -y install php-bcmath 修改时区 Vi /etc/php.ini date.timezone =Asia/Shanghai