目录
Zabbix安装配置... 1
Lamp环境搭建... 1
Apache. 1
Mysql2
Php. 2
配置apache. 2
Zabbix安装... 3
建用户用户组... 3
配置mysql3
Zabbix. 3
配置php. 4
客户端... 5
验证通信... 5
httpd-2.2.22.tar.gz
./configure--prefix=/home/zabbix/apache --with-apxs2=/usr/local/apache2/bin/apxs--disable-debug --enable-ftp--enable-inline-optimization --enable-magic-quotes --enable-mbstring--enable-mm=shared --enable-safe-mode --enable-track-vars --enable-trans-sid--enable-wddx=shared --enable-xml --with-dom --with-gd --with-gettext--with-mysql=/usr/local/mysql5-1/
Make && makeinstall
mysql-5.1.63.tar.gz
./configure--prefix=/home/zabbix/mysql --enable-assembler -with-mysqld-ldflags=-all-static--with-pthread --enable-static --with-big-tables --without-ndb-debug --with-charset=utf8--with-extra-charsets=all --with-innodb--with-unix-socket-path=/tmp/mysql5.sock
make && makeinstall
cd /usr/local/mysql
./bin/mysql_install_db
Cd /usr/local
chown -R root.mysql mysql
cd /usr/local/mysql
chown -R mysql.mysql var/
cpshare/mysql/my-medium.cnf my.cnf
cp share/mysql/mysql.servermysqlctl
修改mysql的root密码什么的,略了
php-5.3.5.tar.gz
./configure--prefix=/home/zabbix/php --with-apxs2=/home/zabbix/apache/bin/apxs--with-mysql=/home/zabbix/mysql/ --with-mysqli=/home/zabbix/mysql/bin/mysql_config--enable-thread-safe-client --enable-mbstring --with-zlib --enable-zip --with-gd --enable-bcmath --enable-xml--enable-sockets --enable-mbstring --with-gettext --with-jpeg-dir--with-freetype-dir
Make && makeinstall
Listen 8127
*在DirectoryIndex处添加 index.php
*在AddTypeapplication处添加
AddTypeapplication/x-httpd-php .php .phtml
AddTypeapplicatoin/x-httpd-php-source .phps
写个phpinfo页面
<?php
phpinfo();
?>
http://192.168.1.3:8127/访问下试试
ok,lamp结束
zabbix-2.0.2.tar.gz
[root@jiaofu-02 htdocs]#groupadd zabbix
[root@jiaofu-02 htdocs]#useradd zabbix -g zabbix
./bin/mysql--default-character-set=utf8
mysql> create databasezabbix character set utf8;
mysql> grant all onzabbix.* to zabbix@'%' identified by 'zabbix';
mysql> use zabbix;
mysql> source/home/zabbix/src/zabbix-2.0.2/database/mysql/schema.sql
mysql>source/home/zabbix/src/zabbix-2.0.2/database/mysql/images.sql
mysql> source /home/zabbix/src/zabbix-2.0.2/database/mysql/data.sql
use zabbix
select alias,passwdfrom users;这就是登陆的用户名和密码哦
初次登陆用户名密码为:adminzabbix
./configure--prefix=/usr/local/zabbix --enable-server --enable-agent --enable-proxy--with-mysql --enable-ipv6 --with-libcurl --with-net-snmp
Make install
我遇到一个错误configure:error: Invalid NET-SNMP directory - unable to find net-snmp-config
于是:yum installnet-snmp*
听说有人会遇到
checking for the version of libcurl... 7.12.1
checking for libcurl >= version 7.13.1... no
configure: error: Curl library not found
说明你curl的版本太低
配置参数说明:
--enable-server 安装 Zabbix Server --enable-proxy 安装 Zabbix Proxy --enable-agent 安装 Zabbix Agent --with-mysql 使用 mysql 做数据库服务器[mysql配置路径根据自己的情况来修改] --with-net-snmp 支持 SNMP --with-libcurl 支持 curl,用于 web 监控
cd zabbix-2.0.2
cpmisc/init.d/fedora/core5/zabbix_* /etc/init.d/
vim/etc/init.d/zabbix_server
ZABBIX_BIN="/home/zabbix/zabbix-2.0.2/sbin/zabbix_server"
vim/home/zabbix/zabbix-2.0.2/etc/zabbix_server.conf
LogFile=/tmp/zabbix_server.log
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
DBSocket=/tmp/mysql5_zabbix.sock
DBPort=3306
cp -a/home/zabbix/src/zabbix-2.0.2/frontends/php/* /home/zabbix/apache/htdocs/zabbix
改属主
chkconfig zabbix_server on
chkconfig zabbix_server --list
vim/home/zabbix/php/lib/php.ini
找到max_execution_time = 30
改成max_execution_time = 300
找到 ;date.timezone =
改成date.timezone ="Asia/Shanghai"
可以启动了
/etc/init.d/zabbix_server start
访问http://192.168.1.3:8127/zabbix/
groupadd zabbix
useradd zabbix -g zabbix
./configure--prefix=/usr/local/zabbix --enable-agent
make install
cpmisc/init.d/fedora/core5/zabbix_agentd /etc/init.d/
vim/etc/init.d/zabbix_agentd
ZABBIX_BIN="/usr/local/zabbix/sbin/zabbix_agentd"
vim/usr/local/zabbix/etc/zabbix_agent.conf
Server=192.168.1.3
Hostname=192.168.1.11
vim/usr/local/zabbix/etc/zabbix_agentd.conf
Server=192.168.1.3
ServerActive=192.168.1.3
/etc/init.d/zabbix_agentd start
chkconfig zabbix_agentd on
chkconfig zabbix_agentd �Clist
/usr/local/zabbix/bin/zabbix_get -s 192.168.1.11 -k"system.cpu.load[all,avg1]"