Zabbix Version = 7.4.0
New to Zabbix, as will come apparent in the following lines.
MAIN QUESTION:
How in the world do you have a custom monitoring script run on multiple machines without copying the script to each machine's local storage?
EXAMPLE:
Let's say I have 50 Win11 machines and they all have Zabbix Agent 2 (Passive) on them.
The Zabbix Server is running on Linux (take your pick of Linux OS as I don't think it is relevant to my question).
The goal is to run a PowerShell script on all 50 machines that returns a string as the result (Forget value mapping and all that gibberish for now, I just want the raw data to show up on my Zabbix Server's Dashboard.)
MY CURRENT PROCESS:
Based on everything I'm finding, this is only accomplished the following way:
1. Place the PowerShell script on the endpoint device (let's say "C:\Program Files\Zabbix Agent 2\Scripts\MyScriptName.ps1")
2. Modify the agent config file ("C:\Program Files\Zabbix Agent 2\zabbix_agent2.conf") on the endpoint device
2a. Insert a one liner under "####### USER-DEFINED MONITORED PARAMETERS #######" that follows the following format: UserParameter=<key>,<shell command>
Example: UserParameter=MyScriptKeyName,powershell.exe -NoProfile -ExecutionPolicy bypass -File "C:\Program Files\Zabbix Agent 2\Scripts\MyScriptName.ps1"
3. Restart the Zabbix Agent 2 Service on the endpoint device.
4. Locate the endpoint device on your Zabbix Server Web UI within the "Data Collection > Hosts" page.
5. To the right of your Hostname in the list of available hosts, click "Items" followed by "Create Item"
6. Give it a name.
7. Give it the same key you used under 2a (MyScriptKeyName)
8. "Type of information" = Text (This is specific to my example since I said it returned a string).
9. Finish by clicking "Add".
PROBLEM:
This works... but what about the 49 other machines?
Do I go to each machine and perform the same steps?
What happens when I need to update the script? Does that involve going to each machine and modifying it?
WHAT I WANT:
The file would need to live on the Zabbix Server or some form of shared storage within the intranet of the company.
It would need to be remotely executed from the server side in case the endpoint device was not actively on the same network as the storage method (for example a Laptop sitting at someone's house).
Processing would be done on the endpoint device.
WRAP UP:
I must be missing something simple but every video tutorial or documentation I find points to doing custom scripts this way.
I imagine templates come into play here but I can't find the connection between them and custom scripts if I can't place the script on the Zabbix Server (which I tried).
I've rubbed my 2 brain cells together for far too long on this, please help me understand. Thanks!
New to Zabbix, as will come apparent in the following lines.
MAIN QUESTION:
How in the world do you have a custom monitoring script run on multiple machines without copying the script to each machine's local storage?
EXAMPLE:
Let's say I have 50 Win11 machines and they all have Zabbix Agent 2 (Passive) on them.
The Zabbix Server is running on Linux (take your pick of Linux OS as I don't think it is relevant to my question).
The goal is to run a PowerShell script on all 50 machines that returns a string as the result (Forget value mapping and all that gibberish for now, I just want the raw data to show up on my Zabbix Server's Dashboard.)
MY CURRENT PROCESS:
Based on everything I'm finding, this is only accomplished the following way:
1. Place the PowerShell script on the endpoint device (let's say "C:\Program Files\Zabbix Agent 2\Scripts\MyScriptName.ps1")
2. Modify the agent config file ("C:\Program Files\Zabbix Agent 2\zabbix_agent2.conf") on the endpoint device
2a. Insert a one liner under "####### USER-DEFINED MONITORED PARAMETERS #######" that follows the following format: UserParameter=<key>,<shell command>
Example: UserParameter=MyScriptKeyName,powershell.exe -NoProfile -ExecutionPolicy bypass -File "C:\Program Files\Zabbix Agent 2\Scripts\MyScriptName.ps1"
3. Restart the Zabbix Agent 2 Service on the endpoint device.
4. Locate the endpoint device on your Zabbix Server Web UI within the "Data Collection > Hosts" page.
5. To the right of your Hostname in the list of available hosts, click "Items" followed by "Create Item"
6. Give it a name.
7. Give it the same key you used under 2a (MyScriptKeyName)
8. "Type of information" = Text (This is specific to my example since I said it returned a string).
9. Finish by clicking "Add".
PROBLEM:
This works... but what about the 49 other machines?
Do I go to each machine and perform the same steps?
What happens when I need to update the script? Does that involve going to each machine and modifying it?
WHAT I WANT:
The file would need to live on the Zabbix Server or some form of shared storage within the intranet of the company.
It would need to be remotely executed from the server side in case the endpoint device was not actively on the same network as the storage method (for example a Laptop sitting at someone's house).
Processing would be done on the endpoint device.
WRAP UP:
I must be missing something simple but every video tutorial or documentation I find points to doing custom scripts this way.
I imagine templates come into play here but I can't find the connection between them and custom scripts if I can't place the script on the Zabbix Server (which I tried).
I've rubbed my 2 brain cells together for far too long on this, please help me understand. Thanks!

Comment