zabbix获评Gartner ITIM基础架构监控工具第一名
5518Zabbix获评Gartner ITIM基础架构监控工具第一名
View detailsSearch the whole station
Rhel 7.6 |
192.168.163.72 |
Rhel 6.5 |
192.168.163.61 |
均已配置操作安装光盘为YUM源
安装包准备如下图:
a.
源码安装zabbix,以及相关的nginx、PHP、mysql
b.
添加zabbix服务器自身到监控里
c.
添加一台agent客户端
#sed -ri ‘/^SELINUX=*/cSELINUX=disabled’ |
#setenforce 0 |
#systemctl stop |
#mkdir -pv /mnt/hg/{mysql-5.7.26,nginx-1.16.0,php-7.2.17,zabbix-4.2.1} |
#mkdir -pv /mnt/hg/mysql-5.7.26/data |
#ln -s /mnt/hg/mysql-5.7.26 /mnt/hg/mysql-last |
#ln -s /mnt/hg/nginx-1.16.0 /mnt/hg/nginx-last |
#ln -s /mnt/hg/php-7.2.17 /mnt/hg/php-last |
#ln -s /mnt/hg/zabbix-4.2.1 /mnt/hg/zabbix-last |
创建软链接的目的是方便日后升级维护使用
#useradd -s /sbin/nologin mysql |
#useradd -s /sbin/nologin nginx |
#useradd -s /sbin/nologin zabbix |
#tar -xvf mysql-5.7.26.tar.gz |
#tar -xvf |
#yum install -y |
#cd mysql-5.7.26 |
#cmake -DCMAKE_INSTALL_PREFIX=/mnt/hg/mysql-5.7.26 -DMYSQL_DATADIR=/mnt/hg/mysql/data -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_unicode_ci -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_EMBEDDED_SERVER=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_COLLATION=utf8_general_ci -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_DEBUG=0 -DWITH_BOOST=/mnt/hg/boost_1_59_0 |
#make -j4 && make install |
#mkdir -pv /mnt/hg/mysql-last/log |
#touch /mnt/hg/mysql-last/log/mariadb.log |
#touch /mnt/hg/mysql-last/log/mariadb.pid |
#cd /mnt/hg && chown mysql:mysql -R |
vim /etc/my.cnf
[mysqld] datadir=/mnt/hg/mysql-last/data #数据存储的地方 socket=/mnt/hg/mysql-last/mysql.sock #sock文件的路径 skip-grant-tables #跳过登录认证 user=mysql explicit_defaults_for_timestamp=true [mysqld_safe] log-error=/mnt/hg/mysql-last/log/mariadb.log #错误日志存放的地方 pid-file=/mnt/hg/mysql-last/log/mariadb.pid |
vim /etc/profile
####mysql path export PATH=$PATH:/mnt/hg/mysql-last/support-files export |
重新加载环境变量
#source |
#mysqld –initialize –user=mysql |
#mysql.server start |
#ln -s /mnt/hg/mysql-last/mysql.sock /tmp/ |
#tar -xvf zabbix-4.2.1.tar.gz |
#cd |
#mysql -u root |
在mysql里执行:
>use mysql; |
>create database zabbix default character set |
>update user set authentication_string = |
>use zabbix; |
>source schema.sql; |
>source images.sql; |
>source data.sql; |
>quit; |
vim /etc/my.cnf
去掉skip-grant-tables
重新启动mysql
#mysql.server |
添加lib文件
#echo “/mnt/hg/mysql-last/lib” |
#ldconfig -v |
#tar -xvf |
#./configure –prefix=/mnt/hg/nginx-1.16.0 |
#make -j4 |
#make install |
vim /etc/profile
####nginx path export |
重新加载环境变量
#source |
#cd /mnt/hg/ |
#chown nginx:nginx -R nginx-1.16.0 |
vim
/mnt/hg/nginx-last/conf/nginx.conf
user nginx; ####暂时仅修改启动用户即可 |
#nginx |
#tar -xvf |
#yum install -y |
#make -j4 |
#make install |
#cd /mnt/hg |
#chown nginx:nginx -R php-7.2.17 |
#cd ~/zabbix/php-7.2.17 |
#cp |
#cp |
#cp /mnt/hg/php-7.2.17/etc/php-fpm.d/www.conf{.default,} |
#cp php.ini-production |
vim /mnt/hg/php-last/lib/php.ini
post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = PRC |
#systemctl start php-fpm.service && systemctl |
vim
/mnt/hg/nginx-last/conf/nginx.conf
location ~ “.php$” { root
include } |
vim /mnt/hg/nginx-last/html/index.php
phpinfo(); ?> |
#nginx -s reload |
#yum localinstall -y libevent-devel-2.0.21-4.el7.x86_64.rpm |
#cd zabbix-4.2.1 |
#./configure –prefix=/mnt/hg/zabbix-4.2.1 |
#make -j4 |
#make install |
vim /etc/profile
####zabbix path export |
vim /mnt/hg/zabbix-last/etc/zabbix_server.conf
DBUser=root DBPassword=hg |
#cp -R |
#nginx -s reload |
默认账号admin,默认密码zabbix
#zabbix_server |
#zabbix_agentd |
#tar -xvf |
#mkdir /mnt/hg |
#./configure –prefix=/mnt/hg/zabbix-4.2.1 |
#make && |
#ln -s |
Vim /mnt/hg/zabbix-last/etc/zabbix_agentd.conf
Server=192.168.163.72 ServerActive=192.168.163.72 Hostname=hg62 |
#/mnt/hg/zabbix-last/sbin/zabbix_agentd |
更多zabbix技术文章,请关注乐维社区:https://forum.lwops.cn/
Zabbix与乐维监控对比分析专题系列文章的第六篇——图形图表篇,包括二者在模板图形及模板表格等功能的对比分析。
View details