分类: LINUX
2012-06-15 09:41:55
系统环境:
Centos5.8 x64
Iptables disabled
Selinux disabled
软件环境:
zabbix-2.0.0
下载zabbix
# wget
# yum -y install gcc gcc-c++ curl curl-devel net-snmp net-snmp-devel perl-DBI php php-gd php-mbstring php-xml php-bcmath mysql-server mysql-devel php-mysql httpd
# /etc/init.d/mysqld start
修改mysqlroot密码为000000
# mysqladmin -uroot -p password 000000
# mysql -uroot -p
Enter password:
mysql> create database zabbix character set utf8;
Query OK, 1 row affected (0.00 sec)
mysql> grant all on zabbix.* to zabbix@'%' identified by '123123';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> exit
Bye
# tar xf zabbix-2.0.0.tar.gz
# cd zabbix-2.0.0/database/mysql
# pwd
/mnt/zabbix-2.0.0/database/mysql
# ls
data.sql images.sql schema.sql
使用zabbix登录mysql,如果登录不进去可以试试如下操作:
mysql -uroot –p
mysql> use mysql;
mysql> select user,password,host from user;
+--------+------------------+-----------------------+
| user | password | host |
+--------+------------------+-----------------------+
| root | 4e469e355b706e6f | localhost |
| root | | localhost.localdomain |
| root | | 127.0.0.1 |
| | | localhost |
| | | localhost.localdomain |
| zabbix | 5668a61a05d9c04b | % |
+--------+------------------+-----------------------+
6 rows in set (0.00 sec)
mysql>delete from mysql.user where mysql.user.host='localhost.localdomain';
mysql> delete from mysql.user where mysql.user.host='127.0.0.1';
mysql> delete from mysql.user where mysql.user.user='';
mysql > flush privileges;
mysql> exit
使用zabbix登录mysql,依次导入三个sql数据,顺序不要乱
# mysql -uzabbix –p
mysql> use zabbix;
mysql> source /mnt/zabbix-2.0.0/database/mysql/schema.sql;
mysql> source /mnt/zabbix-2.0.0/database/mysql/data.sql;
mysql> source /mnt/zabbix-2.0.0/database/mysql/images.sql;
# cd /mnt/zabbix-2.0.0
编译安装zabbix
# ./configure --prefix=/usr/local/zabbix --enable-server --enable-agent --enable-proxy --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl
# make && make install
# cat >> /etc/services <<;EOF
> zabbix_agent 10050/tcp
> zabbix_trap 10051/tcp
> EOF
# cp -a frontends/php/* /var/www/html/
修改/etc/httpd/conf/httpd.conf
DirectoryIndex index.html index.html.var index.php
# /etc/init.d/httpd start
修改/usr/local/zabbix/etc/zabbix_server.conf参数:
DBName=zabbix
DBUser=zabbix
DBPassword=123123
# cp /mnt/zabbix-2.0.0/misc/init.d/redhat/8.0/zabbix_server /etc/init.d/
# cp /mnt/zabbix-2.0.0/misc/init.d/redhat/8.0/zabbix_agentd /etc/init.d/
# chmod +x /etc/init.d/zabbix_*
# vim /etc/init.d/zabbix_server
修改
progdir="/usr/local/zabbix/bin/"
为
progdir="/usr/local/zabbix/sbin/"
# vim /etc/init.d/zabbix_agentd
修改
progdir="/usr/local/zabbix/bin/"
为
progdir="/usr/local/zabbix/sbin/"
启动服务
# /etc/init.d/zabbix_server start
# /etc/init.d/zabbix_agentd start
设置开机启动
# chkconfig --add zabbix_server
# chkconfig --add zabbix_agentd
# chkconfig --level 35 zabbix_server on
# chkconfig --level 35 zabbix_agentd on
# vim /etc/php.ini
date.timezone = Asia/Shanghai
post_max_size = 32M
max_execution_time = 300
max_input_time = 300
默认的日志文件在
/tmp/zabbix_server.log
/tmp/zabbix_agentd.log
访问:
这里有个fail是因为conf目录没有写权限
# chmod 777 /var/www/html/conf
到这里安装就算完成了!(ps:chrome貌似有点问题,使用ie登陆)
Username:admin
Password:zabbix
如果想要看中文界面的话,点击右上角profile