简单的zabbix配置
来源:互联网 发布:运动软件 佳明 编辑:程序博客网 时间:2024/06/05 00:18
Zabbix简介
zabbix是一个基于WEB界面的提供分布式系统监视以及网络监视功能的企业级的开源解决方案。
zabbix由zabbix server与可选组件zabbix agent两部门组成。
zabbix server可以通过SNMP,zabbix agent,ping,端口监视等方法提供对远程服务器/网络状态的监视。
zabbix agent需要安装在被监视的目标服务器上,它主要完成对硬件信息或与操作系统有关的内存,CPU等信息的收集。
Zabbix主要功能:
- CPU负荷 - 内存使用 - 磁盘使用 - 网络状况 - 端口监视
Zabbix安装
zabbix WEB环境搭建
zabbix的安装需要LAMP或者LNMP环境。
LAMP的搭建
linux环境:redhat7.2
搭建顺序:mysql –> apache –> php
mariadb 安装
yum install mariadb-server.x86_64 -ymysql_secure_installation #设置密码systemctl start mariadb
可以先设置mysql的授权
[root@lockey ~]# mysql -uroot -predhatWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 5Server version: 5.5.56-MariaDB MariaDB ServerCopyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> CREATE DATABASE zabbix CHARSET 'utf8'; #建立数据库Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> GRANT ALL ON zabbix.* TO 'zz'@'172.25.%.%' IDENTIFIED BY 'redhat'; #授权网段Query OK, 0 rows affected (0.00 sec)MariaDB [(none)]> GRANT ALL ON zabbix.* TO 'zz'@'localhost' IDENTIFIED BY 'redhat'; #授权lcoalhostQuery OK, 0 rows affected (0.00 sec)MariaDB [(none)]> flush privileges;Query OK, 0 rows affected (0.00 sec)
Apache安装
yum install -y httpd
PHP安装
groupadd wwwuseradd -s /sbin/nologin -g www -M www
tar jxf php-5.6.31.tar.bz2cd php-5.6.31./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mcrypt --with-mhash
因组件不全出现报错
yum install -y libmcrypt-2.5.7-5.el6.art.x86_64.rpm libmcrypt-devel-2.5.7-5.el6.art.x86_64.rpm net-snmp-devel
继续安装
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-openssl --with-snmp --with-gd --with-zlib --with-curl --with-libxml-dir --with-png-dir --with-jpeg-dir --with-freetype-dir --with-pear --with-gettext --with-gmp --enable-inline-optimization --enable-soap --enable-ftp --enable-sockets --enable-mbstring --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --with-mcrypt --with-mhashmake install
#修改fpm配置php-fpm.conf.default文件名称mv /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf#复制php.ini配置文件cp php.ini-production /usr/local/php/etc/php.ini#复制php-fpm启动脚本到init.dcp /usr/local/php/sbin/php-fpm /etc/init.d/php-fpm#赋予执行权限chmod +x /etc/init.d/php-fpm#启动/etc/init.d/php-fpm
安装zabbix
安装server端组件(方便测试proxy和server装在同一台主机):
yum install -y zabbix-get-3.4.2-1.el7.x86_64.rpm zabbix-proxy-mysql-3.4.2-1.el7.x86_64.rpm zabbix-server-mysql-3.4.2-1.el7.x86_64.rpm zabbix-web-3.4.2-1.el7.noarch.rpm zabbix-web-mysql-3.4.2-1.el7.noarch.rpm
Error: Package: zabbix-proxy-mysql-3.4.2-1.el7.x86_64 (/zabbix-proxy-mysql-3.4.2-1.el7.x86_64) Requires: fpingError: Package: zabbix-server-mysql-3.4.2-1.el7.x86_64 (/zabbix-server-mysql-3.4.2-1.el7.x86_64) Requires: fpingError: Package: zabbix-server-mysql-3.4.2-1.el7.x86_64 (/zabbix-server-mysql-3.4.2-1.el7.x86_64) Requires: libiksemel.so.3()(64bit) You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest
通过下面方法解决
yum install -y epel-releaseyum install -y iksemel fping libiksemel
配置
寻找zabbix建表所需要的sql语句
rpm -ql zabbix-server-mysql/etc/logrotate.d/zabbix-server/etc/zabbix/zabbix_server.conf/usr/lib/systemd/system/zabbix-server.service/usr/lib/tmpfiles.d/zabbix-server.conf/usr/lib/zabbix/alertscripts/usr/lib/zabbix/externalscripts/usr/sbin/zabbix_server_mysql/usr/share/doc/zabbix-server-mysql-3.4.2/usr/share/doc/zabbix-server-mysql-3.4.2/AUTHORS/usr/share/doc/zabbix-server-mysql-3.4.2/COPYING/usr/share/doc/zabbix-server-mysql-3.4.2/ChangeLog/usr/share/doc/zabbix-server-mysql-3.4.2/NEWS/usr/share/doc/zabbix-server-mysql-3.4.2/README/usr/share/doc/zabbix-server-mysql-3.4.2/create.sql.gz####/usr/share/man/man8/zabbix_server.8.gz/var/log/zabbix/var/run/zabbix
解压sql语句文件
cd /usr/share/doc/zabbix-server-mysql-3.4.2/gunzip create.sql.gz
执行数据库命令
mysql -uzz -h 172.25.21.250 -predhat zabbix</usr/share/doc/zabbix-server-mysql-3.4.2/create.sql
MariaDB [(none)]> use zabbixDatabase changedMariaDB [zabbix]> show tables; #查看
[root@foundation21 ~] sed -n '/#/!p' /etc/zabbix/zabbix_server.confListenPort=10051SourceIP=172.25.21.250LogType=fileLogFile=/var/log/zabbix/zabbix_server.logLogFileSize=0DebugLevel=3PidFile=/var/run/zabbix/zabbix_server.pidSocketDir=/var/run/zabbixDBHost=localhostDBName=zabbixDBUser=zzDBPassword=redhatDBSocket=/var/lib/mysql/mysql.sockDBPort=3306SNMPTrapperFile=/var/log/snmptrap/snmptrap.logTimeout=4AlertScriptsPath=/usr/lib/zabbix/alertscriptsExternalScripts=/usr/lib/zabbix/externalscriptsLogSlowQueries=3000
更改时区(两个文件)
vim /etc/php.ini date.timezone = Asia/Shanghaivim /etc/httpd/conf.d/zabbix.conf php_value date.timezone Asia/Shanghai
启动Zabbix Server进程
service zabbix-server start
服务端访问http://localhost/zabbix
全都为ok时点击下一步
填写配置
下一步
填写登陆帐户(admin)密码(zabbix)
登录成功页面
未完待续。。。
阅读全文
0 0
- 简单的zabbix配置
- sendmail 简单配置zabbix
- grafana-zabbix图形简单配置
- zabbix安装及简单配置
- zabbix 邮件报警简单配置
- Zabbix Agent的配置
- 简单搭建Zabbix的环境
- zabbix的安装和配置
- zabbix的安装和配置
- zabbix的安装和配置
- Zabbix的SNMPTrap监控配置
- Zabbix的安装和配置
- zabbix-配置zabbix agent
- Zabbix分布式监控(zabbix-proxy)的配置关键点
- Zabbix搭建笔记[2]--Zabbix Agent(Client)的安装配置
- Zabbix配置
- 简单的zabbix agent自动安装脚本
- zabbix的搭建和简单使用
- Linux下不能进入windows的NTFS分区之挂载错误问题(error mounting)
- 软件评测师笔记001--软件测试基础
- BLE协议栈的学习笔记
- java中常用的并发工具
- 深度学习进阶(四)--深度神经网络中梯度消失以及卷积神经网络初识
- 简单的zabbix配置
- Maven配置pom.xml的详细介绍
- 10.9(周一)
- 准确率(Accuracy), 精确率(Precision), 召回率(Recall)和F1-Measure
- 基于Faster-rcnn及FCN的中文OCR文本定位
- 基于GPS的城市管道精确定位系统的单片机控制
- 触发器里面before和after的区别
- 第四章 “字符串和多维数组”翻转学习任务
- Python3:《机器学习实战》之支持向量机(4)核函数及其实现