Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1151136
  • 博文数量: 188
  • 博客积分: 2267
  • 博客等级: 大尉
  • 技术积分: 1907
  • 用 户 组: 普通用户
  • 注册时间: 2011-08-01 11:17
文章分类

全部博文(188)

文章存档

2016年(16)

2015年(16)

2014年(12)

2013年(32)

2012年(45)

2011年(67)

分类: 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

访问:

clip_image002

clip_image004

clip_image006

clip_image008

clip_image010

 clip_image012

clip_image014

这里有个fail是因为conf目录没有写权限

# chmod 777 /var/www/html/conf

clip_image016

clip_image018

到这里安装就算完成了!(ps:chrome貌似有点问题,使用ie登陆)

Username:admin

Password:zabbix

如果想要看中文界面的话,点击右上角profile

clip_image020

clip_image022

阅读(3074) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

send_linux2012-08-27 17:19:48

好文章啊,哈哈