Skip to content

Sopholos/Zabbix-ScheduledTask

 
 

Repository files navigation

Zabbix-ScheduledTask

Step 1:

Copy the file DiscoverScheduledTasks.ps1 for folder of Zabbix Agent

Normally is in "C:\Program Files\Zabbix Agent 2"\

Step 2:

Add host level macro {$TASKPATHS} (open host properties and look for the "Macros" tab) and specify your tasks location(s) in Task Scheduler Library, root is "/", custom folder may be "/CustomFolder/", several locations will be comma-separated: "/,/CustomFolder/"

Step 3:

In the configuration file of Zabbix Agent add the following parameters:

`Timeout=30`

for Powershell < 7.x

`UserParameter=TaskSchedulerMonitoring[*],powershell -NoProfile -ExecutionPolicy Bypass -File "C:\Zabbix\DiscoverScheduledTasks.ps1" "$1" "$2" "$3"`

for Powershell > 7.x

`UserParameter=TaskSchedulerMonitoring[*],"C:\Program Files\PowerShell\7\pwsh.exe" -NoProfile -ExecutionPolicy Bypass -File "c:\Services\Zabbix\scripts\DiscoverScheduledTasks.ps1" "$1"  "$2" "$3"`

Step 4:

Verify if your Windows Hosts is enable for execute scripts, if no, run in powershell:

Set-ExecutionPolicy RemoteSigned

Step 5:

Restart the Zabbix Agent

Step 6:

Bind the Template Windows Task Scheduled in host.

About

Monitoring Task Scheduled from Zabbix

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PowerShell 100.0%