Skip to content
Snippets Groups Projects
Commit 3f06de6d authored by Andreas Lindemark's avatar Andreas Lindemark
Browse files

Changed a download link.

Added empty lines after PowerShell code.
And added a one-liner for the `RemoveZabbix.ps1` script.
parent 75587d39
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment