[ZBX-11594] Problem with importing trigger on hosts from xml Created: 2016 Dec 14 Updated: 2017 May 30 Resolved: 2016 Dec 14 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Frontend (F) |
Affects Version/s: | 3.2.2 |
Fix Version/s: | None |
Type: | Incident report | Priority: | Major |
Reporter: | Gojko Bozic | Assignee: | Unassigned |
Resolution: | Duplicate | Votes: | 0 |
Labels: | templates, triggers | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
CentOS 7 x64 |
Attachments: |
![]() ![]() |
||||||||
Issue Links: |
|
Description |
I am having problems when importing hosts from XML. It doesn't import triggers from discovery. Here is error: Undefined offset: 0 [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Invalid argument supplied for foreach() [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Undefined offset: 0 [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Invalid argument supplied for foreach() [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Undefined offset: 0 [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Invalid argument supplied for foreach() [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Undefined offset: 0 [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Invalid argument supplied for foreach() [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Undefined offset: 0 [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Invalid argument supplied for foreach() [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] Undefined offset: 0 [conf.import.php:176 ? CFrontendApiWrapper->import() ? CApiWrapper->__call() ? CFrontendApiWrapper->callMethod() ? CApiWrapper->callMethod() ? CFrontendApiWrapper->callClientMethod() ? CLocalApiClient->callMethod() ? call_user_func_array() ? CConfiguration->import() ? CConfigurationImport->import() ? CConfigurationImport->processHosts() ? CHostImporter->import() ? CTemplate->massAdd() ? CHostGeneral->link() ? CTriggerGeneral->syncTemplates() ? CTriggerGeneral->inherit() ? CTriggerGeneral->inheritOnHost() ? CTriggerGeneral->createReal() in include/classes/api/services/CTriggerGeneral.php:893] |
Comments |
Comment by Aleksandrs Saveljevs [ 2016 Dec 14 ] |
Could you please post the XML that produces this problem? |
Comment by Gojko Bozic [ 2016 Dec 14 ] |
I attached Zabbix-Hosts and template which i use |
Comment by Aleksandrs Saveljevs [ 2016 Dec 14 ] |
Thank you! How did you obtain these files? Did you export them from Zabbix (if so, which version), downloaded from somewhere or generated manually? |
Comment by Gojko Bozic [ 2016 Dec 14 ] |
Mikrotik template firstly i downloaded from your site : https://share.zabbix.com/network_devices/mikrotik/mikrotik-routeros |
Comment by Aleksandrs Saveljevs [ 2016 Dec 14 ] |
If we fix the XML by removing extra newlines in host names and IP addresses in "Zabbix-Hosts.xml", then that XML imports normally. Still, we should probably fix the frontend/API to better validate XML and not allow the following: <host> <host>Yellow_house 10.10.10.10 </host> <name>Yellow_house 10.10.10.10 </name> <description/> ... <interfaces> <interface> <default>1</default> <type>2</type> <useip>1</useip> <ip>10.10.10.10 </ip> <dns/> <port>161</port> <bulk>1</bulk> <interface_ref>if1</interface_ref> </interface> </interfaces> ... </host> |
Comment by Alexander Vladishev [ 2016 Dec 14 ] |
Closed as duplicate of ZBX-3783 |