## linux客戶端的配置mysql
zabbix-agent安裝腳本linux
```bashnginx
#!/bin/bashsql
# 增長zabbix3yum源bash
cat > /etc/yum.repos.d/zabbix.repo <<EOF服務器
[zabbix3.0]ide
name=zabbix3.0url
baseurl=http://mirrors.aliyun.com/zabbix/zabbix/3.0/rhel/7/x86_64/spa
gpgcheck=0rest
EOF
#給被監控主機安裝zabbix客戶端
yum install zabbix-agent -y
```
編輯/etc/zabbix/zabbix_agentd.conf
```bash
# 容許哪些主機監控這臺主機,更改agent名字
# 124.207.65.***爲zabbix-server的地址
Server=127.0.0.1,124.207.65.***
# 每一個被監控主機Hostname名稱需不一樣
Hostname=ZabbixServer
# 容許執行action傳遞的命令
EnableRemoteCommands=1
```
啓動服務器,開機啓動
```bash
systemctl enable zabbix-agent.service
systemctl start zabbix-agent.service
```
受權zabbix用戶能夠執行某些特權指令時`visudo`
```bash
# allows 'zabbix' user to restart nginx without password.
zabbix ALL=NOPASSWD: /usr/local/nginx/sbin/nginx -s reload
# allows 'zabbix' user to check mysql without password.
zabbix ALL=NOPASSWD: /bin/mysqlslave.sh
```