zabbix 安装rpm

zabbix安装 

1 安装数据库

#yum install mariadb-server  -y

配置配置文件

#vim /etc/my.cnf

  skip_name_resolve=on

  innodb_file_per_table=on

#systemctl  start  mariadb.service     启动服务

#systemctl   enable   mariadb.service    开机自启服务

链接数据库创建数据库 ,创建账户权限

#mysql

> create  database  zabbix  CHARSET 'utf8';

>grant  all  on  zabbix.*  to  'zbuser'@'192.168.0.%'  identified  by 'zbpass';

>grant  all  on  zabbix.*  to  'zbuser'@'127.0.0.1'  identified  by 'zbpass';

>grant  all  on  zabbix.*  to  'zbuser'@'localhost'  identified  by 'zbpass';

>flush  privileges;

安装zabbix服务

安装zabbix的epel

#rpm –i https://repo.zabbix.com/zabbix/3.0/rhel/7/x86_64/zabbix-release-3.0-1.el7.noarch.rpm

#yum  install  zabbix-server-mysql   zabbix-agent

安装web依赖软件包

#yum  install  httpd  php  php-mysql  php-mbstring  php-gd  php-bcmath  php-ldap  php-xml

#yum install zabbix-web-mysql.noarch

 导入数据可执行的脚本 

/usr/share/doc/zabbix-server-mysql/create.sql.gz

#gzip -d create.sql.gz

#mysql  -uzbuser  -h127.0.0.1  -pzbpass  zabbix <  ./create.sql

配置zabbix-server配置文件

vim  /etc/zabbix/zabbix_server.conf

GENERAL PARAMETERS    通用端参数有

Mandatory:  no   是不是强制的

      Range :1024-32767    范围

      ListenPort  :10051  端口

      Option: SourceIP    用来采集的ip地址 如果只有一个ip地址可以不定义

Option: LogType =file   日志格式

      Option: LogFile =      日志文件路径

      Option: LogFileSize =0      0表示禁止滚动

      Option: DebugLevel =3     一般3表示正常级别 详细级别

      Option: DBHost = ;     指明存储地址

      Option: DBName =zabbix      数据库名

           DBUser=             链接数据库用户

           DBPassword=       密码

           DBPort= 3306

           DBSocket=         如果本地数据库的socket文件

#setenforce 0

#systemctl start zabbix-server.service  启动

配置web

vim /etc/httpd/conf.d/zabbix.conf

  php_value date.timezone Asia/shanghai  定义时区设定

systemctl start httpd.service         启动服务

访问 http://192.168.0.103/zabbix

登录用户名密码:admin/zabbix

修改汉语

安装agent

yum install  zabbix-agent zabbix-sender

vim  配置文件 配置文件也有4段配置

##### Active checks related      主动监控相关配置 客户端是主动的

      ServerActive=192.168.1.105            服务器地址

      Hostname=localhost     本地主机名

##### Passive checks related      被动监控   客户端被动

           Server= 192.168.1.105

######USER-DEFINED  MONITOREO  PARAMETERS  ## 用户自定义监控参数

      用UserParamter 这个参数来定义

systemctl start zabbix-agent.service     启动服务

10050 端口监听

猜你喜欢

转载自www.cnblogs.com/huxl1/p/10722692.html