Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update-ZbxHost Zabbix 4.0 #3

Open
l2aggron opened this issue Nov 23, 2018 · 0 comments
Open

Update-ZbxHost Zabbix 4.0 #3

l2aggron opened this issue Nov 23, 2018 · 0 comments

Comments

@l2aggron
Copy link

l2aggron commented Nov 23, 2018

Update-ZbxHost returns error with zabbix 4.0, with 3.4 works fine.

$zbx_addr = "http://192.168.1.100/api_jsonrpc.php"
$zbx_login = "zabbix_internal_admin"
$zbx_pass = "zabbix_5trong_pass"
$zbx_sec_pass = ConvertTo-SecureString $zbx_pass -AsPlainText -Force
$zbx_creds = New-Object System.Management.Automation.PSCredential ($zbx_login, $zbx_sec_pass)

if (!$zbx_session) {
    $zbx_session = New-ZbxApiSession -ApiUri $zbx_addr -auth $zbx_creds
}

$testhost = Get-ZbxHost | ? {$_.host -eq "hostname"} 
$testhost | % { $_.description = ($_.description + "test") ; $_ } | Update-ZbxHost


$zbx_session.Clear()
$zbx_session = $null

returns:

WARNING: Connected to Zabbix version 4.0.0
Invoke-ZabbixApi : Invalid params. Incorrect input parameters.
At C:\Program Files\WindowsPowerShell\Modules\PSZabbix\1.2.0\PSZabbix.psm1:596 char:9
+         Invoke-ZabbixApi $session "host.update" $Hosts | select -Expa ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : -32602,Invoke-ZabbixApi
@l2aggron l2aggron changed the title Host-Update Zabbix 4.0 Update-ZbxHost Zabbix 4.0 Nov 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant