在线安装文档
http://www.zabbix.com/documentation/1.8/manual/installation
软件包 :
http://www.zabbix.com/download.php 目前已经更新到1.8.5版本了
系统环境 :FreeBSD 6.2-RELEASE
搭建LAMP环境 :
php 5.2.3 【必须有GD,bcmath支持】
mysql 5.0.51b
httpd 2.2.9
添加用户和用户组
pw groupadd zabbix
adduser zabbix
创建数据库
/usr/local/mysql/bin/mysql -uUSER -pPASSWORD
mysql> create database zabbix;
mysql> grant all on zabbix.* to zabbix@localhost identified by 'Password';
mysql> flush privileges;
mysql> quit
导入数据
cat /home/sysadmin/zabbix/zabbix-1.8/create/schema/mysql.sql |mysql -uUSER -pPASSWORD zabbix
cat /home/sysadmin/zabbix/zabbix-1.8/create/data/data.sql |mysql -uUSER -pPASSWORD zabbix
cat /home/sysadmin/zabbix/zabbix-1.8/create/data/images_mysql.sql |mysql -uUSER -pPASSWORD zabbix
编译安装
zabbix-1.8]#./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp(可选)
zabbix-1.8]#make && make install
<!-- [if gte mso 9]><xml><w:WordDocument><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery><w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery><w:DocumentKind>DocumentNotSpecified</w:DocumentKind><w:DrawingGridVerticalSpacing>7.8</w:DrawingGridVerticalSpacing><w:View>Normal</w:View><w:Compatibility></w:Compatibility><w:Zoom>0</w:Zoom></w:WordDocument></xml><![endif]-->
配置文件: /etc/services 【可以不操作,但推荐这样做】
zabbix-agent 10050/tcp # Zabbix Agent
zabbix-agent 10050/udp # Zabbix Agent
zabbix-trapper 10051/tcp # Zabbix Trapper
zabbix-trapper 10051/udp # Zabbix Trapper
编辑主配置文件 zabbix_server.conf
[root@mx2 ~]# mkdir /etc/zabbix
[root@mx2 ~]# cp -r /home/sysadmin/zabbix/zabbix-1.8/misc/conf/ /etc/zabbix/
<!-- [if gte mso 9]><xml><w:WordDocument><w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel><w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery><w:DisplayVerticalDrawingGridEvery>2</w:DisplayVerticalDrawingGridEvery><w:DocumentKind>DocumentNotSpecified</w:DocumentKind><w:DrawingGridVerticalSpacing>7.8</w:DrawingGridVerticalSpacing><w:View>Normal</w:View><w:Compatibility></w:Compatibility><w:Zoom>0</w:Zoom></w:WordDocument></xml><![endif]-->
DBName=zabbix
DBUser=
DBPassword=
制作启动脚本
cp -r /home/sysadmin/zabbix/zabbix-1.8/misc/init.d/freebsd/zabbix_server /usr/local/bin/
vi /usr/local/bin/zabbix_server
原:command="${prefix:-"/usr/local"}/bin/${name}"
改:command="${prefix:-"/usr/local/zabbix"}/sbin/${name}"
配置环境变量
echo "zabbix_server_enable="YES" ">> /etc/rc.conf
vi /home/sysadmin/.profile
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin:$HOME/bin:/usr/local/zabbix/sbin:/usr/local/zabbix/sbin ; export PATH
开机自启动
echo "/usr/local/bin/zabbix_server start" >> /etc/rc.local
配置web页面
cp -r /home/sysadmin/zabbix/zabbix-1.8/frontends/php/ /usr/local/apache/htdocs/zabbix/
vi /usr/local/Zend/etc/php.ini
mbstring.func_overload = 2
max_execution_time = 300
post_max_size = 20M #不小于16M
date.timezone =Asia/Shanghai
web的配置另作讲解 ,请看下篇