Skip to content


 Zabbix
 Grafana
 Prometheus
 Threejs and TypeScript
 SocketIO and TypeScript
 Blender Topological Earth
 Sweet Home 3D
 Design Patterns Python
 Design Patterns TypeScript
   
 Course Coupon Codes
Three.js and TypeScript
Kindle Edition
$9.99 $14.99 Paperback 
$29.99 $34.99




Design Patterns in TypeScript
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99




Design Patterns in Python
Kindle Edition
$9.99 $14.99 Paperback
$19.99 $24.99




Execute Bat File on Remote Windows Host with Zabbix Agent

Video Lecture

Execute Bat File on Remote Windows Host with Zabbix Agent Execute Bat File on Remote Windows Host with Zabbix Agent Execute Bat File on Remote Windows Host with Zabbix Agent

Description

Note

  • Zabbix Agents pre 5.02. In the zabbix_agentd.conf for the remote host, add EnableRemoteCommands=1 and then restart the agent process.

  • Zabbix Agents 5.0 and 5.01. Comment out the DenyKey parameter which blocks system.run by default, add EnableRemoteCommands=1 and then restart the agent process.

  • Zabbix Agents 5.02 and later. Either,

    • Comment out the DenyKey and add AllowKey=system.run[*]

    • or Comment out the DenyKey and add EnableRemoteCommands=1 (EnableRemoteCommands is now deprecated so it is no longer recommended and will eventually stop working as versions are updated)

See Restricting agent checks for more info.

To get the version of the agent on Windows, open a CMD prompt in the folder containing zabbix_agentd.exe and run

zabbix_agentd -V

In this video, I create a bat file that backups a file. I then execute it and read the response from the remote Zabbix Agent host using the system.run item key.

example.bat

1
2
@echo off
COPY c:\temp\abc.txt c:\temp\123.txt >nul && (echo 1) || (echo 0)

Zabbix Agent Items

Restricting Agent Checks

Download Zabbix Agents