zabbix

zabbix4.0安装文档
导入yum源:rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
清除yum缓存:yum clean all
更换yum源:vim /etc/yum.repos.d/zabbix.repo
清华源:https://mirrors.tuna.tsinghua.edu.cn/zabbix
gpgcheck=0
安装zabbix:yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
安装数据库:yum install mariadb-server
启动数据库:systemctl start mariadb.service
设置开机自启:systemctl enable mariadb.service
优化数据库:mysql_secure_installation
Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
建库:create database zabbix character set utf8 collate utf8_bin;
授权:grant all privileges on zabbix.* to zabbix@localhost identified by ‘password’;
导入数据结构:zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
修改配置文件:vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=123456
启动:systemctl start zabbix-server
开机自启:systemctl enable zabbix-server
启动Web:systemctl start httpd
开机自启:systemctl enable httpd
修改时区:vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai
默认账户密码:Admin zabbix
zabbix_get -s 127.0.0.1 -k vda_tps

常用监控命令:
free -m
df -hT
df -hi
top
htop
uptime
iftop
iostat
iotop
vmstat
netstat

拾遗:
批量创建空文件 touch {1..10000}
wget 断点续传 -c 限速下载 –limit-rate=300k
根据命令查包:yum provides iostat
grep -c 计数
压力测试:ab -n 300000 -c 300 http://10.1.24.251/zabbix/index.php
获取剩余内存:free -m| awk ‘NR==2{print $NF}’
查找安装记录:yum history info 12

触发器表达式
{Zabbix server:system.users.num.last()}>3
{主机名:key名称.函数()}表达式
邮箱授权码:jhjpffgnyulbbcig
脚本位置:AlertScriptsPath=/usr/lib/zabbix/alertscripts
变量:{ALERT.SENDTO} {ALERT.SUBJECT} {ALERT.MESSAGE}
zabbix远程执行命令配置:EnableRemoteCommands=1 AllowRoot=1
乱码处理;/usr/share/zabbix/assets/fonts/graphfont.ttf

 

grafana安装:
wget https://mirrors.tuna.tsinghua.edu.cn/grafana/yum/rpm/grafana-6.4.3-1.x86_64.rpm
yum localinstall grafana-6.4.3-1.x86_64.rpm -y
systemctl start grafana-server
1.安装zabbix插件
查找插件:grafana-cli plugins list-remote| grep zabbix
安装:grafana-cli plugins install alexanderzobnin-zabbix-app
2.新建一个zabbix数据源
3.导入dashboard模板

dos: denied of service,防御:iptables 封IP;
ddos: 分布式dos攻击;高防IP,
优化TCP三次握手timewait: /etc/sysctl.conf
netstat -nat| grep -c ‘ESTABLISHED’

 

    原文作者:mysql
    原文地址: https://www.cnblogs.com/hanfuming/p/11739602.html
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞