zabbix使用心得
1、监控mysql时设置一个具备select权限用户
grant select on mysql.* to monitor@'%' identified by 'monitor'; flush privileges;
2、
自定义一个文件,key一定要唯一,决定使用2个下划线写自定义的key
mysql__version,这个key可以用来判断mysql是否存活
[root@zabbix-2 ~]# mysql -umonitor -pmonitor -h127.0.0.1 -e 'select version();'|grep -v version 5.5.56-MariaDB [root@zabbix-2 ~]# [root@zabbix-2 ~]# mysql -umonitor -pmonitor -h127.0.0.1 -e 'select version();'|grep -v version|wc -l 1 [root@zabbix-2 ~]#
3、zabbix server部署中常用命令和一些常用包的安装
系统常用包
yum install lsof vim screen mtr nc nmap lrzsz openssl-devel gcc glibc gcc-c++ make zip dos2unix mysql sysstat wget rsync net-tools dstat setuptool system-config-* iptables ntsysv mlocate telnet tree -y
常用命令
systemctl stop firewalld.service systemctl disable firewalld.service echo 'alias cls="clear screen"'>>.bash_profile echo "alias grep='grep --colour=auto'" >>/etc/profile sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config setenforce 0 hostnamectl set-hostname zabbix-server
浙公网安备 33010602011771号