zabbix rpm安装的怎么没有zabbix
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix rpm安装的怎么没有zabbix相关的知识,希望对你有一定的参考价值。
参考技术A yum和rpm安装zabbix 2.0.9,从2.0.4开始zabbix官方提供了从rpm包和yum仓库安装的方法,近来有空特地参考了官方文档进行了尝试,安装过程记录如下1、安装zabbix 官方的软件配置仓库包
rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm
2、安装zabbix server mysql php 等
yum install zabbix-server-mysql zabbix-web-mysql
结果如下(根据机型系统不同显示或有不同):
Installed:
libjpeg-turbo.x86_64 0:1.2.1-1.el6 zabbix-server-mysql.x86_64 0:2.0.9-1.el6 zabbix-web-mysql.noarch 0:2.0.9-1.el6
Dependency Installed:
OpenIPMI-libs.x86_64 0:2.0.16-14.el6 fping.x86_64 0:2.4b2-16.el6 iksemel.x86_64 0:1.4-2.el6
libXpm.x86_64 0:3.5.10-2.el6 lm_sensors-libs.x86_64 0:3.1.1-17.el6 net-snmp.x86_64 1:5.5-44.el6_4.4
net-snmp-libs.x86_64 1:5.5-44.el6_4.4 php.x86_64 0:5.3.3-23.el6_4 php-bcmath.x86_64 0:5.3.3-23.el6_4
php-cli.x86_64 0:5.3.3-23.el6_4 php-common.x86_64 0:5.3.3-23.el6_4 php-gd.x86_64 0:5.3.3-23.el6_4
php-mbstring.x86_64 0:5.3.3-23.el6_4 php-mysql.x86_64 0:5.3.3-23.el6_4 php-pdo.x86_64 0:5.3.3-23.el6_4
php-xml.x86_64 0:5.3.3-23.el6_4 unixODBC.x86_64 0:2.2.14-12.el6_3 zabbix.x86_64 0:2.0.9-1.el6
zabbix-server.x86_64 0:2.0.9-1.el6 zabbix-web.noarch 0:2.0.9-1.el6
Replaced:
libjpeg.x86_64 0:6b-46.el6
3、安装agent
yum install zabbix-agent -y
结果如下:
Installed:
zabbix-agent.x86_64 0:2.0.9-1.el6
Complete!
4、创建zabbix 数据库(mysql)
4、1 安装mysql等(如果已安装请略过)
yum -y install mysql-server mysql mysql-dev
结果:
Installed:
mysql-server.x86_64 0:5.1.69-1.el6_4
Dependency Installed:
perl-DBD-MySQL.x86_64 0:4.013-3.el6
Updated:
mysql.x86_64 0:5.1.69-1.el6_4
Dependency Updated:
mysql-devel.x86_64 0:5.1.69-1.el6_4 mysql-libs.x86_64 0:5.1.69-1.el6_4
Complete!
4、2 启动mysql
service mysqld start
首次启动显示:
Initializing MySQL database: Installing MySQL system tables...
OK
Filling help tables...
OK
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h h210 password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /usr/bin/mysqlbug script!
[ OK ]
Starting mysqld: [ OK ]
4、3 创建库和导入
创建
mysql -uroot
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
mysql> exit
导入模式和数据
cd /usr/share/doc/zabbix-server-mysql-2.0.9/create
mysql -uroot zabbix < schema.sql
mysql -uroot zabbix < images.sql
mysql -uroot zabbix < data.sql
5、启动zabbix-server 进程
编辑配置文件zabbix_server.conf
vi /etc/zabbix/zabbix_server.conf
保证下列配置,保存退出
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
启动
service zabbix-server start
6、配置zabbix web前端
6、1 配置php
vi /etc/httpd/conf.d/zabbix.conf
保证如下设置
php_value max_execution_time 300
php_value memory_limit 128M
php_value post_max_size 16M
php_value upload_max_filesize 2M
php_value max_input_time 300
php_value date.timezone Asia/Shanghai
6、2 启动apache
service httpd start
6、3 登录zabbix web前端
浏览器输入 http://serverip/zabbix进入最后的检查和配置
配置完成登录系统默认admin/zabbix
7、启动zabbix server上的zabbix_agentd
zabbix_agentd本回答被提问者和网友采纳
1Zabbix RPM包安装
zaibbix RPM包下载地址:http://repo.zabbix.com/zabbix/
根据需求下载不同的版本。我这里以Zabbix 2.2.10为例,服务器系统为CentOS6.75
安装Zabbix源
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
安装完成后,在/etc/yum.repos.d目录下会生成一个zabbix.repo的yum源
[[email protected] yum.repos.d]# ll total 28 -rw-r--r--. 1 root root 1991 Aug 4 00:13 CentOS-Base.repo -rw-r--r--. 1 root root 647 Aug 4 00:13 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 289 Aug 4 00:13 CentOS-fasttrack.repo -rw-r--r--. 1 root root 630 Aug 4 00:13 CentOS-Media.repo -rw-r--r--. 1 root root 6259 Aug 4 00:13 CentOS-Vault.repo -rw-r--r-- 1 root root 401 Nov 12 2013 zabbix.repo
安装前的准备:
1、关闭防火墙
service iptables stop
2、禁用selinux
setenforce 0 ##设置为告警模式,只给出提示,不会阻止操作,不用重启就生效
getenforce ##获取当前SElinux的运行状态
永久关闭selinux
vim /etc/sysconfig/selinux # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
3、安装mysql
yum -y install mysql-server
安装Zabbix Server
#yum -y install zabbix zabbix-agent zabbix-get zabbix-server zabbix-server-mysql zabbix-web zabbix-web-mysql zabbix-sender
修改MySQL配置文件
vim /etc/my.cnf
[mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 character-set-server = utf8 ##设置字符集为utf8 innodb_file_per_table = 1 ##让innodb的每个表文件单独存储 default_table_type = InnoDB ##设置MySQL表引擎为InnoDB
启动mysql
chkconfig mysqld on service mysqld start
创建Zabbix数据库
设置MySQL数据库的root密码
mysql -uroot password 123456
登录数据库,创建zabbix数据库和用户
#mysql -uroot -p 123456
mysql>create database zabbix character set utf8 collate utf8_bin; mysql>grant all privileges on zabbix.* to [email protected] identified by ‘zabbix‘; mysql>flush privileges; mysql>\q
注意:这里容易出现的问题是创建Zabbix的数据库字符集不为utf8,这会导致web界面切换到中文时出现乱码。
导入zabbix数据
注意:版本不同,路径也不相同
cd /usr/share/doc/zabbix-server-mysql-2.2.13/create/ mysql -uroot -p123456 zabbix < schema.sql mysql -uroot -p123456 zabbix < images.sql mysql -uroot -p123456 zabbix < data.sql
配置zabbix_server.conf中的数据库配置
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix
mkdir -p /etc/zabbix/alertscripts /etc/zabbix/externalscripts
php配置
vim /etc/httpd/conf.d/zabbix.conf
php_value max_execution_time 300 php_value memory_limit 128M php_value post_max_size 16M php_value upload_max_filesize 2M php_value max_input_time 300 php_value date.timezone Asia/Shanghai
更改php的timezone(此处如果步更改会报错)
vim /etc/php.ini date.timezone = Asia/Shanghai
启动apache
chkconfig httpd on service httpd start
启动zabbix和agent
chkconfig zabbix-server on service zabbix-server start chekconfig zabbix-agent on service zabbix-agent start
浏览器输入http://172.16.206.131/zabbix配置
点击下一步依次检测php组件,数据库等配,最后输入默认账号密码Admin/zabbix登陆
本文出自 “zengestudy” 博客,谢绝转载!
以上是关于zabbix rpm安装的怎么没有zabbix的主要内容,如果未能解决你的问题,请参考以下文章