Hi All, I'm having an issue in Zabbix 6.4 where we are using a script to import an XML of hosts but it's not creating the missing host groups automatically. The import works great for any hosts we import that we are adding to existing host groups.
Error is: @{code=-32500; message=Application error.; data=Group "Clients/Client1" for host "test-host" does not exist.}
Below is an example of my XML file host section
The import script uses import params as follows (AUTHGUID is an actual string in my script):
Any help would be much appricated as my understanding was that having the following section would make this work?
(Documentation Ref: https://www.zabbix.com/documentation...uration/import)
Error is: @{code=-32500; message=Application error.; data=Group "Clients/Client1" for host "test-host" does not exist.}
Below is an example of my XML file host section
Code:
<hosts> <host> <host>test-host</host> <name>test-host</name> <status>ENABLED</status> <templates> <template> <name>ICMP Ping</name> </template> </templates> <groups> <group> <name>Routers - External</name> </group> <group> <name>Clients/Client1</name> </group> </groups> <interfaces> <interface> <ip>1.1.1.1</ip> <port>0</port> <interface_ref>if1</interface_ref> </interface> </interfaces> <inventory> <serialno_a>ABCDEFGHIJKL</serialno_a> <location_lat>-39.004519</location_lat> <location_lon>147.284774</location_lon> </inventory> </host>
Code:
$importparams= @{
jsonrpc = "2.0"
method = "configuration.import"
params = @{
format = "xml"
rules = @{
host_groups = @{
updateExisting = $true
createMissing = $true
}
hosts = @{
updateExisting = $true
createMissing = $true
}
templateLinkage = @{
createMissing = $true
}
valueMaps = @{
updateExisting = $true
createMissing = $true
}
}
source = "$xmlfile"
}
auth ="<AUTHGUID>"
id = 5
}
Any help would be much appricated as my understanding was that having the following section would make this work?
(Documentation Ref: https://www.zabbix.com/documentation...uration/import)
Code:
host_groups = @{
updateExisting = $true
createMissing = $true
}
Comment