Custom Discovery PowerShell-Script: Unterschied zwischen den Versionen

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „== Example Monitor Windows Storage Mountpoints == === PowerShell-Script on the target System === Write a PowerShell-Script "Get-CSVsForDiscovery.ps1" with the…“)
 
Zeile 15: Zeile 15:
  
 
=== Zabbix Discovery ===
 
=== Zabbix Discovery ===
 +
Create a new Zabbix Discovery:<br>
 +
[[Datei:01-zabbix-custom-discovery-mountpoints.png]]
  
  
 
=== Zabbix Items Prototypes ===
 
=== Zabbix Items Prototypes ===
 +
Create new Zabbiy Item Prototypes:<br>
 +
[[Datei:02-zabbix-custom-discovery-mountpoints.png]]
  
  
 
=== Zabbix Triggers Prototypes ===
 
=== Zabbix Triggers Prototypes ===
 
+
Create new Zabbix Trigger Prototypes:<br>
 +
[[Datei:03-zabbix-custom-discovery-mountpoints.png]]
  
  

Version vom 3. Dezember 2019, 09:11 Uhr

Example Monitor Windows Storage Mountpoints

PowerShell-Script on the target System

Write a PowerShell-Script "Get-CSVsForDiscovery.ps1" with the following content and save this in "C:\Program Files\Zabbix Agent":

$json = (Get-ChildItem "C:\ClusterStorage\" | Select @{Name='{#CSVNAME}';Expression={$_.Name}} | ConvertTo-Json)
$final = ('{"data":'+$json+'}')
$final


Zabbix Agent Configuration (zabbix_agentd.conf)

Add the following line:

UserParameter=custom.discovery.csvnames,powershell -File "C:\Program Files\Zabbix Agent\Get-CSVsForDiscovery.ps1"


Zabbix Discovery

Create a new Zabbix Discovery:
01-zabbix-custom-discovery-mountpoints.png


Zabbix Items Prototypes

Create new Zabbiy Item Prototypes:
02-zabbix-custom-discovery-mountpoints.png


Zabbix Triggers Prototypes

Create new Zabbix Trigger Prototypes:
03-zabbix-custom-discovery-mountpoints.png