当前位置:网站首页>RedHat 6.2 配置 Zabbix
RedHat 6.2 配置 Zabbix
2022-07-03 16:58:00 【星哥玩云】
1.搭建本地YUM源。
# yum -y install httpd php php-MySQL mysql-server mysql-client curl curl-devel net-snmp net-snmp-devel perl-DBI php-gd php-xml php-bcmath zlib-devel mysql-devel glibc-devel gcc automake libidn-devel openssl-devel net-snmp-devel rpm-devel OpenIPMI-devel php-mbstring
2.添加用户 [[email protected] src]# useradd zabbix [[email protected] src]# passwd zabbix
3.配置zabbix的MYSQL数据库 #service mysqld start [[email protected] src]# mysql -u root -p
mysql> create database zabbix; Query OK, 1 row affected (0.02 sec) mysql> grant all on zabbix.* to [email protected] identified by 'zabbix'; Query OK, 0 rows affected (0.08 sec) mysql> quit
解压下的zabbix的源码包 #tar zxvf zabbix-1.8.13.tar.gz #cd zabbix-1.8.13 #mysql -u root zabbix < create/schema/mysql.sql #mysql -u root zabbix < create/data/data.sql #mysql -u root zabbix < create/data/images_mysql.sql
4.安装 #./configure -prefix=/opt/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber=/usr/local/ --with-libcurl --with-openipmi --enable-agent
可能会报jabber相关的错误 解决:安装iksemel。 #wget http://iksemel.googlecode.com/files/iksemel-1.4.tar.gz #tar zxvf iksemel-1.4.tar.gz #cd iksemel-1.4 #./configure #make #make install
再次执行 #./configure -prefix=/opt/zabbix --enable-server --with-mysql --with-net-snmp --with-jabber=/usr/local/ --with-libcurl --with-openipmi --enable-agent
#make install
安装成功会有提示
5.修改/etc/services文件 # cat >> /etc/services << EOF zabbix-trapper 10051/tcp Zabbix Trapper zabbix-trapper 10051/udp Zabbix Trapper EOF
6.配置zabbix #cd zabbix-1.8.13 6.1 #cp misc/init.d/RedHat/zabbix_server_ctl /etc/init.d/zabbix_server # mkdir /etc/zabbix # cp misc/conf/* /etc/zabbix/ # vi /etc/zabbix/zabbix_server.conf DBName=zabbix DBUser=zabbix DBPassword=zabbix
6.2复制PHP的WEB应用 # mkdir /var/www/html/zabbix # cp -r frontends/php/* /var/www/html/zabbix
6.3修改/etc/zabbix/zabbix_server.conf的 PidFile= 与/etc/init.d/zabbix_server 里的变量 PIDFILE= 相互一致,注意保存目录的权限问题,才能生成pid文件,否则不能正常start,stop,restart服务。
6.4添加到启动服务: 编辑/etc/init.d/zabbix_server文件,在文件头部的#!/bin/sh行下添加如下两行: #chkconfig: 35 95 95 #description:zabbix server 执行 #chkconfig --add zabbix_server
7.启动 Zabbix Server #service zabbix_server start
启动时可能报错: libiksemel.so.3: cannot open shared object file: No such file or directory
解决: #updatedb #locate libiksemel.so.3 #ldd zabbix_server
8.访问http://<服务器ip>/zabbix 进行配置页面,一步步走。最后zabbix会给一个配置文件,把配置文件上传zabbix的WEB应用的conf目录。即可。
可能出现问题。 php-mbstring 不OK
解决:安装 #yum install php-mbstring
9.http://<服务器ip>/zabbix 的登录用户名密码是admin/zabbix
客户端的安装 一、直接下载agent包安装过程 zabbix_agents_1.8.5.linux2_6.amd64.tar.gz
1. #groupadd zabbix #useradd zabbix -g zabbix
2. #mkdir /usr/local/zabbix/ #tar -zxvf zabbix_agents_1.8.5.linux2_6.amd64.tar.gz -C /usr/local/zabbix/
或下载源码包,解压后,执行 #./configure --prefix=/usr/local/zabbix --enable-agent #make #make install
3.配置zabbix * 服务端口定义: 编辑 /etc/services,在后面追加: #cat >> /etc/services << EOF zabbix-agent 10050/tcp Zabbix Agent zabbix-agent 10050/udp Zabbix Agent EOF
* 复制配置文件: #mkdir /etc/zabbix 从zabbix Server上拷贝一份zabbix.agentd.conf
* 安装启动脚本 #下载并拷贝启动脚本zabbix_agentd到/etc/init.d目录下 #chmod a+x /etc/init.d/zabbix_agentd * 修改 /etc/init.d/zabbix_agentd 变量定义: BASEDIR=/usr/local/zabbix
*修改/etc/zabbix/zabbix.agentd.conf的 PidFile= 与/etc/init.d/zabbix_agentd 里的变量 PIDFILE= 相互一致,注意保存目录的权限问题,才能生成pid文件,否则不能正常start,stop,restart服务。
* 添加到启动服务: 编辑/etc/init.d/zabbix_agentd文件,在文件头部的#!/bin/sh行下添加如下两行: #chkconfig: 35 95 95 #description:zabbix Agent server 执行 #chkconfig --add zabbix_agentd
* 启动 Zabbix Agentd /etc/init.d/zabbix_agentd start
边栏推荐
- [try to hack] active detection and concealment technology
- 2022.02.14_ Daily question leetcode five hundred and forty
- Unreal_ Datatable implements ID self increment and sets rowname
- Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
- 聊聊接口优化的几个方法
- The most complete postman interface test tutorial in the whole network, API interface test
- Central South University | through exploration and understanding: find interpretable features with deep reinforcement learning
- Data driving of appium framework for mobile terminal automated testing
- CC2530 common registers
- Overview of satellite navigation system
猜你喜欢
Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
Simulink oscilloscope data is imported into Matlab and drawn
Arduino esp32: overall framework of lvgl project (I)
Processing strategy of message queue message loss and repeated message sending
arduino-esp32:LVGL项目(一)整体框架
Thread pool: the most common and error prone component of business code
What is your income level in the country?
线程池:业务代码最常用也最容易犯错的组件
13mnnimo5-4 German standard steel plate 13MnNiMo54 boiler steel 13MnNiMo54 chemical properties
Build your own website (23)
随机推荐
C语言字符串练习
Visual studio "usually, each socket address (Protocol / network address / port) can only be used once“
比亚迪、长城混动市场再“聚首”
浅谈拉格朗日插值及其应用
The word backspace key cannot delete the selected text, so you can only press Delete
聊聊接口优化的几个方法
PHP converts a one-dimensional array into a two-dimensional array
CC2530 common registers
On Lagrange interpolation and its application
Yu Wenwen, Hu Xia and other stars take you to play with the party. Pipi app ignites your summer
How to promote cross department project collaboration | community essay solicitation
The most complete postman interface test tutorial in the whole network, API interface test
斑馬識別成狗,AI犯錯的原因被斯坦福找到了
Recommendation of good books on learning QT programming
utfwry. Dat PHP, about ThinkPHP's method of IP location using utfwry address Library
CC2530 common registers for timer 1
Necessary ability of data analysis
网络安全web渗透技术
C语言按行修改文件
Informatics Olympiad all in one YBT 1175: divide by 13 | openjudge noi 1.13 27: divide by 13