zabbix

本文涉及的产品
RDS MySQL DuckDB 分析主实例,基础系列 4核8GB
RDS MySQL DuckDB 分析主实例,集群系列 4核8GB
RDS AI 助手,专业版
简介:

第一步:

http://www.iyunv.com/thread-41703-1-1.html

http://www.osyunwei.com/archives/7984.html

http://www.centoscn.com/image-text/install/2015/0827/6071.html

yum install php php-gd php-mysql php-bcmath php-mbstring php-xml curl curl-devel net-snmp   net-snmp-devel perl-DBI

yum install httpd mariadb*

#systemctl start mariadb.service

# mysql -u root -p

Enter password:

create database zabbix character set utf8;

insert into mysql.user(Host,User,Password)                      values('localhost','zabbix',password('zabbix'));

grant all on zabbix.* to 'zabbix'@'127.0.0.1' identified by 'zabbix' with grant option;

flush privileges;

# tar -zxvf zabbix-2.4.5.tar.gz

# cd zabbix-2.4.5

# ./configure --with-mysql=/usr/bin/mysql_config --with-net-snmp --with-libcurl --enable-server --enable-agent --enable-proxy --prefix=/usr/local/zabbix

    --prefix----> 指定zabbix安装目录

    --enable-server----> 支持zabbix服务器

    --enable-agent----> 支持zabbix代理

    --enable-proxy----> 支持zabbix代理服务器

    --with-libcurl----> 使用curl包

    --with-net-snmp----> 使用net-snmp软件包,选择性地指定路径NET-SNMP配置

    --with-mysql=/usr/bin/mysql_config 使用MySQL客户端库可以选择指定路径mysql_config

    注:如出现configure: error: MySQL library not found错误,是因为缺少mariadb-devel该软件包,yum install mariadb-devel进行安装

# make

# make install

# mysql -u root -p

use zabbix;

source /opt/wc/zabbix-2.4.5/database/mysql/schema.sql

source /opt/wc/zabbix-2.4.5/database/mysql/data.sql

source /opt/wc/zabbix-2.4.5/database/mysql/images.sql

quit

添加服务器对应的端口(可省略)

# cat /etc/services | grep zabbix

测试zabbix服务启动

# /usr/local/zabbix/sbin/zabbix_agentd    //客户端

zabbix_agentd [29191]: user zabbix does not exist

zabbix_agentd [29191]: cannot run as root!

# /usr/lcoal/zabbix/sbin/zabbix_server    //服务端

zabbix_agentd [29208]: user zabbix does not exist

zabbix_agentd [29208]: cannot run as root!


第二步:

# cd /usr/local/zabbix/etc

# vi /usr/local/zabbix/etc/zabbix_server.conf

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

ListenIP=127.0.0.1

AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts

# vi /usr/local/zabbix/etc/zabbix_agentd.conf

Include=/usr/local/zabbix/etc/zabbix_agentd.conf.d/

UnsafeUserParameters=1

# cp /opt/wc/zabbix-2.4.5/misc/init.d/fedora/core/zabbix_server /etc/init.d/zabbix_server

# cp /opt/wc/zabbix-2.4.5/misc/init.d/fedora/core/zabbix_agentd /etc/init.d/zabbix_agentd

# vi /etc/rc.d/init.d/zabbix_server

BASEDIR=/usr/local/zabbix/

# vi /etc/rc.d/init.d/zabbix_agentd

BASEDIR=/usr/local/zabbix/

# service zabbix_agentd start

# service zabbix_server start

cp -r /opt/wc/zabbix-2.4.5/frontends/php /var/www/html/zabbix

http://110.110.110.110:8888/zabbix/setup.php出来配置界面即可


第三步:

# vi /etc/php.ini

post_max_size =16M

max_execution_time =300

max_input_time =300

date.timezone = Asia/Shanghai

# vi /etc/php-fpm.d/www.conf

request_terminate_timeout = 300

# systemctl restart php-fpm.service

# systemctl restart httpd.service(重启php之后执行Retry没用就再执行apache就ok了)

最后一步报错:

Configuration file "/var/www/html/zabbix/conf/zabbix.conf.php" created: Fail

# cd /var/www/html/zabbix/conf

# cp zabbix.conf.php.example zabbix.conf.php

# vi zabbix.conf.php

<?php

global $DB;

$DB["TYPE"]                    = 'MYSQL';

$DB["SERVER"]                   = '127.0.0.1';(默认localhost修改)

$DB["PORT"]                    = '3306';(默认0修改为3306)

$DB["DATABASE"]                 = 'zabbix';

$DB["USER"]                    = 'zabbix';

$DB["PASSWORD"]                 = 'zabbix';(默认修改为自己的密码)

// Schema name. Used for IBM DB2 and PostgreSQL.

$DB["SCHEMA"]                   = '';

$ZBX_SERVER                    = 'localhost';

$ZBX_SERVER_PORT                = '10051';

$ZBX_SERVER_NAME                = '';

$IMAGE_FORMAT_DEFAULT   = IMAGE_FORMAT_PNG;

?>

# vi /var/www/html/zabbix/include/locales.inc.php

'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => false),

修改为

'zh_CN' => array('name' => _('Chinese (zh_CN)'), 'display' => true),


报错1:

zabbix server is not running:the information displayed may not be current

解决1:


本文转自 guowang327 51CTO博客,原文链接:http://blog.51cto.com/guowang327/1734571,如需转载请自行联系原作者

相关实践学习
自建数据库迁移到云数据库
本场景将引导您将网站的自建数据库平滑迁移至云数据库RDS。通过使用RDS,您可以获得稳定、可靠和安全的企业级数据库服务,可以更加专注于发展核心业务,无需过多担心数据库的管理和维护。
MySQL数据库入门学习
本课程通过最流行的开源数据库MySQL带你了解数据库的世界。 &nbsp; 相关的阿里云产品:云数据库RDS MySQL 版 阿里云关系型数据库RDS(Relational Database Service)是一种稳定可靠、可弹性伸缩的在线数据库服务,提供容灾、备份、恢复、迁移等方面的全套解决方案,彻底解决数据库运维的烦恼。 了解产品详情:&nbsp;https://www.aliyun.com/product/rds/mysql&nbsp;
相关文章
|
Linux
CentOS7下对非LVM类型的根分区进行扩容
CentOS7下对非LVM类型的根分区进行扩容
1164 0
CentOS7下对非LVM类型的根分区进行扩容
|
Linux 测试技术
非LVM磁盘分区根目录扩容操作参考
在操作系统部署时,根目录使用的是非LVM分区,后期空间不足又无法扩容。 提供一个思路是新增一块硬盘,创建为逻辑卷,把根目录迁移过去,然后引导以新分区启动。 迁移完成后,旧的根目录可以再格式化为逻辑卷,合并到新磁盘分区。 本操作仅在CentOS Linux release 7.9.2009实验过,其他环境可能不支持。
2939 0
|
存储 Linux KVM
Proxmox VE (PVE) 主要架构和重要服务介绍
Proxmox VE (PVE) 是一款开源的虚拟化平台,它基于 KVM (Kernel-based Virtual Machine) 和 LXC (Linux Containers) 技术,支持虚拟机和容器的运行。PVE 还提供高可用集群管理、软件定义存储、备份和恢复以及网络管理等企业级功能。
4386 7
|
Linux 数据安全/隐私保护 Windows
【JumpServer教程】简便添加Windows资产:JumpServer堡垒机使用指南
本文是JumpServer堡垒机使用指南,介绍了如何在JumpServer中简便添加Windows资产的步骤,包括准备工作、开启Windows远程设置、在JumpServer中配置Windows资产以及授权使用。
4236 1
【JumpServer教程】简便添加Windows资产:JumpServer堡垒机使用指南
|
弹性计算 安全 Windows
通过远程桌面连接Windows服务器提示“由于协议错误,会话将被中断,请重新连接到远程计算机”错误怎么办?
通过远程桌面连接Windows服务器提示“由于协议错误,会话将被中断,请重新连接到远程计算机”错误怎么办?
|
Kubernetes Cloud Native 容器
开放下载!《深入浅出Kubernetes》
一次搞懂6个核心原理吃透基础理论,一次学会6个典型问题的华丽操作
开放下载!《深入浅出Kubernetes》
|
Unix Linux 网络安全
这份MobaXterm使用指南,低调收藏!
这份MobaXterm使用指南,低调收藏!
3490 0

热门文章

最新文章