Execute Bat File on Remote Windows Host with Zabbix Agent
Video Lecture
Description
In this video, I create a Windows batch 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
| @echo off
set d=%date%_%time%
set d=%d:.=%
set d=%d::=%
set d=%d:/=%
COPY c:\temp\abc.txt c:\temp\abc_%d%.txt >nul && (echo 1) || (echo 0)
|
Item
Property |
Value |
Name |
Backup Example |
Type |
Zabbix agent (active) |
Key |
system.run[C:/temp/example.bat] |
Useful Links
Zabbix Agent Items
Restricting Agent Checks