docker run -d \
-p=10051:10051 \
-p=10052:10052 \
-p=80:80 \
-p=2812:2812 \
--name zabbix \
tmszabbix
docker run -d \
-p=10051:10051 \
-p=10052:10052 \
-p=80:80 \
-p=2812:2812 \
--name zabbix \
tmszabbix
保存这个脚本为sh文件
#!/bin/bash
/usr/local/mysql/bin/mysql -uzabbix -e ‘show slave status\G’ |grep -E “Slave_IO_Running|Slave_SQL_Running”|awk ‘{print $2}’|grep -c Yes
在zabbix_agentd.conf中下方加入以下一条语句:
UserParameter=mysql.slavestatus,/etc/zabbix/mysqlms.sh
重启zabbix-agent,在Zabbix-Server所在服务器执行以下语句,测试是否成功:
zabbix_get -s 192.168.1.106 -k mysql.slavestatus
Zabbix 监控windows 网卡流量(2008 64bit)
在windows客户端获取网卡参数列表:
typeperf -qx | find “Network Interface” | find “Bytes”
\Network Interface(Intel[R] 82574L Gigabit Network Connection)\Bytes Total/sec
\Network Interface(Intel[R] 82574L Gigabit Network Connection _2)\Bytes Total/sec
\Network Interface(Intel[R] 82574L Gigabit Network Connection)\Bytes Received/sec
\Network Interface(Intel[R] 82574L Gigabit Network Connection _2)\Bytes Received/sec
\Network Interface(Intel[R] 82574L Gigabit Network Connection)\Bytes Sent/sec
\Network Interface(Intel[R] 82574L Gigabit Network Connection _2)\Bytes Sent/sec
可直接保存为文件方便查看(typeperf -qx | find “Network Interface” | find “Bytes” > herb.txt )
由此看出 此台windows服务器有两块网卡在启用状态分别是
Network Interface(Intel[R] 82574L Gigabit Network Connection
Network Interface(Intel[R] 82574L Gigabit Network Connection _2
其实 这里也可以从如下图中看出 与那块网卡对应
在zabbix_agentd.conf添加
PerfCounter=Net_Incoming,“\Network Interface(Intel[R] 82574L Gigabit Network Connection)\Bytes Sent/sec”,5
PerfCounter=Net_Outgoing,“\Network Interface(Intel[R] 82574L Gigabit Network Connection)\Bytes Received/sec”,5
修改配置后重新启动zabbix_agentd.exe后通过
zabbix_get.exe -s 127.0.0.1 -k Net_Incoming
zabbix 添加监控项