zabbix(1)--服务器端安装及配置

1、zabbix-server配置

zabbix版本选择LTS的3.0版本、server端OS版本为RHEL 6.5

配置zabbix仓库,进行yum安装zabbix

~]# cd /etc/yum.repos.d/

yum.repos.d]# vim zabbix.repo

[zabbix]
name=zabbix repo
baseurl=http://repo.zabbix.com/zabbix/3.0/rhel/6/x86_64/
enabled=1
gpgcheck=0

安装mysql,进行配置修改并启动

~]# yum install mysql-server -y

~]# vim /etc/my.cnf 
[mysqld]
datadir=/home/mysqldata
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
skip_name_resolve=on
innodb_file_per_table=on

~]# service mysqld start

创建zabbix库,并授权链接

[[email protected] mysqldata]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> CREATE DATABASE zabbix CHARSET ‘utf8‘;
Query OK, 1 row affected (0.00 sec)

mysql> GRANT ALL ON zabbix.* TO [email protected]‘127.0.0.1‘ IDENTIFIED BY ‘*‘;
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL ON zabbix.* TO [email protected]‘10.%.%.%‘ IDENTIFIED BY ‘*‘;
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

安装zabbix相关组件并进行zabbix库初始化

~]# yum install zabbix-server-mysql zabbix-web zabbix-agent zabbix-web-mysql zabbix-sender zabbix-get

查看zabbix-mysql相关内容
~]# rpm -ql zabbix-server-mysql
/etc/init.d/zabbix-server
/etc/logrotate.d/zabbix-server
/etc/zabbix/zabbix_server.conf
/usr/lib/zabbix/alertscripts
/usr/lib/zabbix/externalscripts
/usr/sbin/zabbix_server_mysql
/usr/share/doc/zabbix-server-mysql-3.0.9
/usr/share/doc/zabbix-server-mysql-3.0.9/AUTHORS
/usr/share/doc/zabbix-server-mysql-3.0.9/COPYING
/usr/share/doc/zabbix-server-mysql-3.0.9/ChangeLog
/usr/share/doc/zabbix-server-mysql-3.0.9/NEWS
/usr/share/doc/zabbix-server-mysql-3.0.9/README
/usr/share/doc/zabbix-server-mysql-3.0.9/create.sql.gz
/usr/share/man/man8/zabbix_server.8.gz
/var/log/zabbix
/var/run/zabbix

zabbix库初始化操作

[[email protected] zabbix]# cd /usr/share/doc/zabbix-server-mysql-3.0.9/
[[email protected] zabbix-server-mysql-3.0.9]# gzip -d create.sql.gz 
[[email protected] zabbix-server-mysql-3.0.9]# ll
total 3752
-rw-r--r-- 1 root root  98 Apr 20 20:05 AUTHORS
-rw-r--r-- 1 root root  718465 Apr 20 20:05 ChangeLog
-rw-r--r-- 1 root root   17990 Apr 20 20:05 COPYING
-rw-r--r-- 1 root root 3086105 Apr 24 01:57 create.sql
-rw-r--r-- 1 root root  52 Apr 20 20:05 NEWS
-rw-r--r-- 1 root root 188 Apr 20 20:05 README
[[email protected] zabbix-server-mysql-3.0.9]# mysql -h127.0.0.1 -uzbxuser -p *** < create.sql 
Enter password: 

[[email protected] zabbix-server-mysql-3.0.9]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.

mysql> use zabbix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> SHOW tables;
+----------------------------+
| Tables_in_zabbix   |
+----------------------------+
| acknowledges   |
| actions|
| alerts |
| application_discovery  |
| application_prototype  |
| application_template   |
| applications   |
| auditlog   |
| auditlog_details   |
| autoreg_host   |
| conditions |
| config |
| dbversion  |
| dchecks|
| dhosts |
| drules |
| dservices  |
| escalations|
| events |
| expressions|
| functions  |
| globalmacro|
| globalvars |
| graph_discovery|
| graph_theme|
| graphs |
| graphs_items   |
| group_discovery|
| group_prototype|
| groups |
| history|
| history_log|
| history_str|
| history_text   |
| history_uint   |
| host_discovery |
| host_inventory |
| hostmacro  |
| hosts  |
| hosts_groups   |
| hosts_templates|
| housekeeper|
| httpstep   |
| httpstepitem   |
| httptest   |
| httptestitem   |
| icon_map   |
| icon_mapping   |
| ids|
| images |
| interface  |
| interface_discovery|
| item_application_prototype |
| item_condition |
| item_discovery |
| items  |
| items_applications |
| maintenances   |
| maintenances_groups|
| maintenances_hosts |
| maintenances_windows   |
| mappings   |
| media  |
| media_type |
| opcommand  |
| opcommand_grp  |
| opcommand_hst  |
| opconditions   |
| operations |
| opgroup|
| opinventory|
| opmessage  |
| opmessage_grp  |
| opmessage_usr  |
| optemplate |
| profiles   |
| proxy_autoreg_host |
| proxy_dhistory |
| proxy_history  |
| regexps|
| rights |
| screen_user|
| screen_usrgrp  |
| screens|
| screens_items  |
| scripts|
| service_alarms |
| services   |
| services_links |
| services_times |
| sessions   |
| slides |
| slideshow_user |
| slideshow_usrgrp   |
| slideshows |
| sysmap_element_url |
| sysmap_url |
| sysmap_user|
| sysmap_usrgrp  |
| sysmaps|
| sysmaps_elements   |
| sysmaps_link_triggers  |
| sysmaps_links  |
| timeperiods|
| trends |
| trends_uint|
| trigger_depends|
| trigger_discovery  |
| triggers   |
| users  |
| users_groups   |
| usrgrp |
| valuemaps  |
+----------------------------+
113 rows in set (0.00 sec)

启动zabbix-server进程

进程
/etc/init.d/zabbix-server

配置文件说明:
/etc/zabbix/zabbix_server.conf

指令有四类:
############ GENERAL PARAMETERS #################
############ ADVANCED PARAMETERS ################
####### LOADABLE MODULES #######
####### TLS-RELATED PARAMETERS #######

配置文档修改如下:
    ListenPort=10051
    SourceIP=
    LogType=file
    LogFile=/var/log/zabbix/zabbix_server.log
    LogFileSize=1024 #日志切换
    PidFile=/var/run/zabbix/zabbix_server.pid

    DBHost=127.0.0.1
    DBName=zabbix
    DBUser=zbxuser
    DBPassword=*****
    DBSocket=/var/lib/mysql/mysql.sock  #根据mysql具体配置设置

启动zabbix服务
[[email protected] ~]# service zabbix-server start
Starting Zabbix server:[  OK  ]
[[email protected] ~]# service zabbix-server status
zabbix_server (pid  10995) is running...

2、配置zabbix-web

由于zabbix-web对php版本有最低配置,首先对php相关组件进行处理

升级PHP
配置webtatic源
~]# rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpm
卸载旧版本php
~]# yum erase php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mcrypt php-mbstring php-devel php-pecl-memcached php-pecl-memcache  php-common php-pdo php-cli php-fpm libmemcached
安装新版本php
~]# yum install httpd php56w php56w-mysql php56w-gd php56w-imap php56w-ldap php56w-odbc php56w-pear php56w-xml php56w-xmlrpc php56w-mcrypt php56w-mbstring php56w-devel php56w-pecl-memcached  php56w-common php56w-pdo php56w-cli php56w-pecl-memcache php56w-bcmath php56w-fpm

配置php的时区指定

~]# vim /etc/php.ini
date.timezone = Asia/Shanghai
post_max_size = 32M
max_execution_time = 300
max_input_time = 300
always_populate_raw_post_data = -1

启动web server

service httpd start

创建zabbix的web资源,并授予相关权限

~]# mkdir /var/www/html/zabbix
~]# cd /usr/share/zabbix/
~]# cp -a . /var/www/html/zabbix/
~]# chown -R apache:apache /var/www/html/zabbix

配置结束后将相关服务添加至开启自启动(httpd,mysqld,zabbix-server,zabbix-agent)

chkconfig httpd on
chkconfig mysqld on
chkconfig zabbix-server on
chkconfig zabbix-agentd on

service zabbix-server restart

备注,启动http时有一个报错,修改相应权限后正常

[Mon May 22 15:39:53 2017] [error] [client 10.55.56.86] PHP Warning:  require_once(/etc/zabbix/web/maintenance.inc.php): failed to open stream: Permission denied in /var/www/html/zabbix/include/classes/core/ZBase.php on line 269

]# chmod -R 755 /etc/zabbix/web

配置完成后便可进入web进行配置,访问URL:http://server/zabbix

手动download并拷贝过去

初始密码:admin zabbix

时间: 2024-08-05 11:44:18

zabbix(1)--服务器端安装及配置的相关文章

OpenVPN 服务器端安装及配置

实验环境     VPN服务器:CentOS 6.X 64位系统     VPN内网IP:10.10.10.10/255.0.0.0     VPN外网IP:192.168.10.71     OpenVPN版本:OpenVPN 2.3.2 x86_64-RedHat-linux-gnu     VPN同网段其它server : 10.10.10.11  (测试时使用) 一.服务器端安装及配置 1.安装前准备 # 添加epel源 /usr/bin/wget -qO /etc/yum.repos.

Microsoft Visual Studio Team Foundation Server Express 2013 (一) 服务器端安装和配置

写此文,主要是为了记录自己的学习和使用心得. 记录的恰到好处,方便他人. 记录的平庸枯燥,谨此笔记. 注:本文是以TFS 2013 express版本为例,因为此版本为免费版本. 最多可供5个用户使用.更大的团队可使用 Visual Studio Team Foundation Server 2013. (一).Microsoft Visual Studio Team Foundation Server Express 2013  (一) 服务器端安装和配置 (二).Microsoft Visu

Zabbix最佳实践一:Zabbix Server 的安装与配置

一.概述 在开始之前,一些概念和定义需要我们提前了解一下(以下内容摘自官方网站). 1.1 几个概念 架构 Zabbix 由几个主要的功能组件组成,其职责如下所示. Server Zabbix server 是Zabbix agent 向其报告可用性.系统完整性信息和统计信息的核心组件.是存储所有配置信息.统计信息和操作信息的核心存储库. Zabbix Server 负责执行数据的主动轮询和被动获取,计算触发器条件,向用户发送通知.它是 Zabbix Agent 和 Proxy 报告系统可用性和

zabbix系列之六——安装后配置二Items

https://www.zabbix.com/documentation/3.4/manual/config/items/itemtypes/snmp 1Items 1.1creating items index detail note 1 Configuration->hosts 2 Click on Items in the row of the host 3 Click on Create item in the upper right corner of the screen 4 Ent

zabbix server服务安装与配置详情

1.环境工具yum groupinstall "Development tools" -yyum install wget -yyum install gcc* yum install lrzsz -y2.安装扩展yum install -y curl curl-devel net-snmp net-snmp-devel perl-DBI net-snmp-devel OpenIPMI OpenIPMI-devel rpm-build wget http://202.206.32.13

Linux下svn服务器端安装及配置教程

第一步,安装svn服务器端 1.直接使用yum安装,命令及截图如下 [[email protected] ~]# yum install -y subversion 2.安装成功之后,可以查看svn的版本 [[email protected] ~]# svnserve --version 3.创建svn目录,可以按照个人习惯指定目录位置 [[email protected] ~]# mkdir /usr/local/svn 4.创建svn版本库testsvn,版本库名称可以自己取 [[email

zabbix服务端安装与配置

1 安装zabbix yum install -y epel-release安装rpm包的lamp环境 yum install -y  httpd mysql mysql-libs php php-mysql mysql-server php-bcmath php-gd php-mbstring安装zabbix服务端: yum install -y zabbix20 zabbix20-agent zabbix20-server  zabbix20-server-mysql zabbix20-we

青蛙学Linux&mdash;Zabbix部署之安装和配置Zabbix

1.安装Zabbix Server Zabbix Server安装路径/usr/local/zabbix. 安装依赖环境: [[email protected] zabbix-3.4.15]# yum install net-snmp net-snmp-devel curl curl-devel libxml2 libevent libevent-devel 创建虚拟用户用于运行Zabbix守护进程(如果使用普通用户运行Zabbix,那么Zabbix会以该用户身份运行守护进程:如果以root用户

zabbix系列之八——安装后配置三Triggers

1Triggers(触发器) 描述 详细 备注 术语描述 1)触发器是评估监控项采集的数据的逻辑表达式,代表了当前系统状态. 2)触发器可定义一个什么数据是可接受的阈值,因此,如果接收的数据超过了可接受的状态,则触发器会被触发 - 或将状态更改为PROBLEM. 触发器状态:OK/PROBLEM 其他 如果在表达式中使用基于时间的函数(nodata(), date(), dayofmonth(), dayofweek(), time(), now()),触发器就会由Zabbix timer进程每