I need to run remote scripts on servers, but I wouldn't like to have a script on each remote server to run. Can I generate a single script on my zbbix server and run it through items created for each server?
Ad Widget
Collapse
Script Problem
Collapse
X
-
Tags: None
-
If you have installed zabbix agent on each server - yes.
-
Thanks for the feedback. Today I already use this function, but each script is on the host I want to monitor. My intention is for these scripts to be concentrated on the zabbix server, for this format I did not find ways to use system.run[]
If you have configuration examples and could share them, I would be grateful.Comment
-
For example:
You can also create a user macro with a script written in one line and insert it into the system.run callCode:system.run["powershell -c \"[Console]::OutputEncoding=[System.Text.Encoding]::GetEncoding('utf-8');$UninstallPath = 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\'; $softlist= Get-ChildItem $UninstallPath | ForEach-Object { $ProdID = ($_.Name -split '\\')[-1]; Get-ItemProperty -Path \"$UninstallPath\$ProdID\" -ea SilentlyContinue | Select-Object -Property @{n='IdentifyingNumber'; e={$ProdID}}, @{n='Name'; e={$_.DisplayName}}, @{n='Vendor'; e={$_.Publisher}}, @{n='Version'; e={$_.DisplayVersion}} , @{n='Caption'; e={$_.DisplayName}} }| ConvertTo-Json -Compress; [Console]::WriteLine( $softlist ) \" "]Last edited by Hamardaban; 28-03-2024, 09:11.Comment
Comment