Test.ps1
Import-Module ./PSZabbix.psd1 -Force $baseUrl = "http://tools/zabbix/api_jsonrpc.php" $secpasswd = ConvertTo-SecureString "zabbix" -AsPlainText -Force $global:admin = New-Object System.Management.Automation.PSCredential ("Admin", $secpasswd) #$global:admin = if ($global:admin -eq $null) {Get-Credential "Admin"} else {$global:admin} $s = New-ZbxApiSession $baseUrl $admin # Publish-Module -Path . -NuGetApiKey "597cf921-a46e-4ee6-89f8-ea2455dee935" -ReleaseNotes "First release" Add-ZbxUserGroupPermission -HostGroups (Get-ZbxGroup CERBERE) -UserGroups (Get-ZbxUserGroup test2) -Permission Deny #(get-zbxuser pestertest572571240),(Get-zbxuser pestertest1308619158) | Add-ZbxUserGroupMembership (get-zbxusergroup test),(get-zbxusergroup test2) #95,73 | Add-ZbxUserGroupMembership 14,15 #Get-ZbxUserGroup "marsu*" | remove-zbxusergroup #New-ZbxUserGroup marsu1,marsu2,marsu3 #Disable-ZbxHost (Get-ZbxHost) #Get-ZbxHost | disable-ZbxHost #enable-ZbxHost (Get-ZbxHost) #Get-ZbxHost | enable-ZbxHost #Get-zbxhost -name "testhost*" | remove-zbxHost #New-ZbxHost -Name "testhost1" -Group (Get-ZbxGroup -Name ART_PACMAN) -Template (Get-ZbxTemplate -id 10108) -Dns localhost #Remove-zbxHostGroupMembership -Host (get-zbxhost -name "DTCAPRDCRO*") -Groups (get-zbxgroup -name ART_PACMAN),(get-zbxgroup -name CERBERE) #get-zbxhost -name "DTCAPRDCRO*" | Remove-zbxHostGroupMembership (get-zbxgroup -name ART_PACMAN),(get-zbxgroup -name CERBERE) #NEw-ZbxUser -Alias "toto1" -UserGroups (get-zbxusergroup) #Remove-ZbxUser (get-zbxusergroup -name toto1) #NEw-ZbxUser -Alias "toto7" -UserGroups (get-zbxusergroup) #Get-ZbxProxy #remove-zabbixHost -host (get-zabbixhost -name "new host50") #remove-zbxusergroup -UserGroup 13 #Get-ZabbixHost -Id 10118 #Get-ZabbixGroup #Get-ZabbixHost -Id 10118 #Get-ZabbixTemplate #New-ZabbixHost -Name "new host5" -Group (Get-ZabbixGroup $s -Id 9) -Template (Get-ZabbixTemplate $s -id 10108) -Dns "127.0.0.2" #New-ZabbixHost -Name "new host3" -GroupId 8 -TemplateId 10108 -Dns "marsu.com" #New-ZabbixGroup "marsu" #Get-ZabbixUser -Name fc4251 #Get-ZabbixAction #Pop-ZabbixUser -GroupId 21 -UserId 56 | ConvertTo-Json |