From 3f06de6d5352a7549635454539b5bc74ca09bb23 Mon Sep 17 00:00:00 2001 From: Andreas Lindemark <andreas.lindemark@liu.se> Date: Thu, 3 Apr 2025 20:31:40 +0200 Subject: [PATCH] Changed a download link. Added empty lines after PowerShell code. And added a one-liner for the `RemoveZabbix.ps1` script. --- Windows/ZabbixAgent/README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/Windows/ZabbixAgent/README.md b/Windows/ZabbixAgent/README.md index 06e8740..ff0a1fa 100644 --- a/Windows/ZabbixAgent/README.md +++ b/Windows/ZabbixAgent/README.md @@ -36,9 +36,7 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; Stop-Service ### Manual Installation 1. **Download the script file to the computer, preferably to the `C:\Windows\System32\Tasks\` folder**: - ``` - https://gitlab.liu.se/andli86/snippets/-/raw/master/Windows/ZabbixAgent/CheckAndStartZabbixAgent2.ps1 - ``` + * https://gitlab.liu.se/andli86/snippets/-/raw/master/Windows/ZabbixAgent/CheckAndStartZabbixAgent2.ps1 2. **Configure a Scheduled Task**: - Open Task Scheduler. @@ -50,6 +48,7 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; Stop-Service 1. **From the command line in an elevated PowerShell session**: ```powershell schtasks /run /tn "CheckAndStartZabbixAgent2" # or whatever you named the task + ``` 2. **From Task Scheduler**: @@ -61,6 +60,7 @@ Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; Stop-Service 3. Run the script: ```powershell .\CheckAndStartZabbixAgent2.ps1 + ``` ### Script Details @@ -85,6 +85,13 @@ The script provides informative messages about its actions, such as: ## Scheduled Task Details The scheduled task `CheckAndStartZabbixAgent2` runs the script `C:\Windows\System32\Tasks\CheckAndStartZabbixAgent2.ps1` every three hours. +## If you have trouble with Zabbix Agent, you might have to uninstall, reboot and install Zabbix Agent again. This is a one-liner code to uninstall and reboot: + + ```powershell + Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force; $tempPath = [System.IO.Path]::Combine([System.Environment]::GetFolderPath('Desktop')); $script1 = "$tempPath\RemoveZabbix.ps1"; Invoke-WebRequest -Uri "https://gitlab.liu.se/andli86/snippets/-/raw/master/Windows/Chocolatey/RemoveZabbix.ps1" -OutFile $script1; & $script1; Remove-Item -Path $script1 -Force; + + ``` + ## License This project is licensed under the MIT License and is provided as-is without any warranty. Use at your own risk. -- GitLab