zabbix获取windows服务器上数据
C:zabbix_agentsconfzabbix_agentd.win.conf
UserParameter=conncount,d:\tools\online_conncount.bat
举例获取 mysql 用户数
@echo off set mysql="D: oolsmysql.exe" %mysql% --defaults-extra-file=d:\tools\my.cnf --default-character-set=utf8 -N -e "SELECT count(*) FROM `mysql`.`user`;"
mysql.exe 为:
C:Program FilesMySQLMySQL Server 5.7inmysql.exe
my.cnf 目的为了不显示 mysql 出现 [Warning] Using a password on the command line interface can be insecure. 的提示,影响 zabbix 取值
[client] user = root password = passwd host = 10.10.50.20
保证 zabbix server 端能正常取值即可实现监控
zabbix_get -s 10.10.50.20 -k conncount