Ad Widget

Collapse

Check replication on powershell script run on zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • m.matkowski
    Junior Member
    • Sep 2014
    • 1

    #1

    Check replication on powershell script run on zabbix

    Hello

    I have problem with powershell script.

    Code:
    $Health = Get-VMReplication | Select-Object Name, State, Health
    foreach($State in $Health){
    
    if($state.Health -match "Normal"){
    $output = 0
    }else{
    
    $output = 1
    }
    
    }
    write-host $output
    I create
    UserParameter=vm.state,powershell.exe -NoProfile -ExecutionPolicy Bypass -file "c:\Zabbix\rep.ps1" on zabbix config and create item : system.run[powershell.exe -NonInteractive "C:\Zabbix\rep.ps1"]
    and triggers
    {Hyper_V_Template:system.run[powershell.exe -NonInteractive "C:\Zabbix\rep.ps1"].prev(0)}=1

    In the end I enable item and I get zabbix not supported.
    Any idea why won't work??
Working...