Hello guys, im pretty new to Zabbix and recently tried to Monitor the Windows Real Time Protection Status (if its enabled or not) so i made a powershell script that does just that
Code:
after i did this i generated an SSH key pair in the Zabbix Machine
then i created an Item in the WIndows Host
Type: SSH Agent
Key:
system.run[powershell -File "C:\Users\Administrator\Desktop\AntiVirusStatu s.ps 1", -i /root/.ssh/id_rsa.pub]
then i put in the Login Data..
Then the expression:
powershell -File "C:\Users\Administrator\AntiVirusStatus.ps1"
This worked out fine, no biggie..
Now when i wanted to add the trigger i got into trouble...
As Expression i used
I tried various variations of this (i did use chat gpt in the end because i was frustrated
)
If anyone is able to help me with this, id appreciate it
Code:
Code:
$realtimeProtectionStatus = (Get-MpPreference).RealTimeProtectionEnabled
if ($realtimeProtectionStatus -eq $true) {
Write-Host "Echtzeit Ueberwachung ist aktiviert."
} else {
Write-Host "Echtzeit Ueberwachung ist deaktiviert!!"
}
Code:
ssh-keygen -t rsa
Code:
ssh-copy-id user@windows-machine
Code:
ssh user@windows-machine
Type: SSH Agent
Key:
system.run[powershell -File "C:\Users\Administrator\Desktop\AntiVirusStatu s.ps 1", -i /root/.ssh/id_rsa.pub]
then i put in the Login Data..
Then the expression:
powershell -File "C:\Users\Administrator\AntiVirusStatus.ps1"
This worked out fine, no biggie..
Now when i wanted to add the trigger i got into trouble...
As Expression i used
Code:
{hostname:system.run[powershell -File "C:\Users\Administrator\Desktop\AntiVirusStatus.ps1"].str("deaktiviert").nodata(600)}=0
)If anyone is able to help me with this, id appreciate it
Comment