zabbix-template-converter icon indicating copy to clipboard operation
zabbix-template-converter copied to clipboard

unexpected tag "recovery_mode" error

Open wavelet123 opened this issue 7 years ago • 13 comments

hi, I met the following error: zabbix unexpected tag "recovery_mode" when importing the 2.0 template.

Could you please take a look?

Thanks

wavelet123 avatar Jul 15 '17 09:07 wavelet123

Invalid tag "/zabbix_export/triggers/trigger(1)": unexpected tag "correlation_mode". also this error

wavelet123 avatar Jul 15 '17 09:07 wavelet123

Invalid tag "/zabbix_export/triggers/trigger(1)": unexpected tag "manual_close".

wavelet123 avatar Jul 15 '17 09:07 wavelet123

Can you please share the template that fails to import?

cavaliercoder avatar Jul 15 '17 09:07 cavaliercoder

mytemplate-mongodb-trap.xml.gz this is the 3.0 template.

wavelet123 avatar Jul 15 '17 09:07 wavelet123

mdb2.xml.gz 2.0 version thanks

wavelet123 avatar Jul 15 '17 09:07 wavelet123

I haven't been able to replicate this issue with either of the templates you provided. They both import fine for me on Zabbix 2.0.20.

Please advise precisely which Zabbix version you are trying to import into, and what zabbix-template-converter arguments you are using to convert the template.

cavaliercoder avatar Jul 15 '17 10:07 cavaliercoder

I just removed those lines and import successfully. I don't have privilege to log into the zabbix server to check the version.

wavelet123 avatar Jul 15 '17 10:07 wavelet123

I'm glad its working for you, but I'd like to fix it for other users also without having to manually edit the template files.

If you have access to the Zabbix web console to import the templates, the version should be printed in the bar at the bottom of the page.

screen shot 2017-07-15 at 6 11 40 pm

cavaliercoder avatar Jul 15 '17 10:07 cavaliercoder

sorry,it's my fault.just noticed the some guy have upgraded the zabbix to 3.2 version. Thank you for your help.

wavelet123 avatar Jul 15 '17 10:07 wavelet123

I'll leave this issue open, as recover tags should be removed in older versions (even though they don't cause an issue apparently). Thanks for reporting this.

cavaliercoder avatar Jul 15 '17 10:07 cavaliercoder

Thank you for making the template converter, it's going to make my life a lot easier. I got unexpected tag errors as well, including "recovery_mode" trying to change a template from 3.2 to 3.0. Here's what I did:

zabbix-template-converter -o 3.0 template_palo_alto.xml > template_palo_alto_3dot0.xml Applied: Template version string must be '3.0' Applied: Document timestamp must be updated Applied: HTTP Tests must not be exported before 3.2.0

Each time I tried to upload the template, I got a new error. I deleted the tags in question, and once they were all gone the template was able to be imported to Zabbix 3.0.11. Invalid tag "/zabbix_export/templates/template(1)/discovery_rules/discovery_rule(1)/trigger_prototypes/trigger_prototype(1)": unexpected tag "recovery_mode".

Invalid tag "/zabbix_export/templates/template(1)/discovery_rules/discovery_rule(1)/trigger_prototypes/trigger_prototype(1)": unexpected tag "correlation_mode".

Invalid tag "/zabbix_export/templates/template(1)/discovery_rules/discovery_rule(1)/trigger_prototypes/trigger_prototype(1)": unexpected tag "manual_close".

Invalid tag "/zabbix_export/templates/template(1)/discovery_rules/discovery_rule(1)/trigger_prototypes/trigger_prototype(1)": unexpected tag "tags".

3.2 template: template_palo_alto.xml.gz

funkt avatar Oct 17 '17 15:10 funkt

Hi,

I hitted these kind of errors also converting from 3.2 to 3.0, specifically

zabbix unexpected tag "recovery_mode"
zabbix unexpected tag "recovery_expression/"
zabbix unexpected tag "correlation_mode"
zabbix unexpected tag "correlation_tag"

But I noticed that they all came from exported triggers after the Templates section, i.e. in the xml file:

  <templates>
     ...
  </templates>
  <triggers>
       all the problematic tags where here
  </triggers>

So I just removed the triggers section and the templates were imported fine. I created the triggers manually afterwards.

This is related with #6

arielzn avatar Feb 22 '18 10:02 arielzn

Hello,

Same as @arielzn, I tried to convert a template from Zabbix 3.2 to 3.0 (Zabbix 3.0.15) and I had similar errors :

Invalid tag "/zabbix_export/triggers/trigger(3)": unexpected tag "recovery_mode".
Invalid tag "/zabbix_export/triggers/trigger(1)": unexpected tag "tags".
Invalid tag "/zabbix_export/triggers/trigger(1)": unexpected tag "manual_close".
Invalid tag "/zabbix_export/triggers/trigger(1)": unexpected tag "correlation_tag".
Invalid tag "/zabbix_export/triggers/trigger(1)": unexpected tag "correlation_mode".
Invalid tag "/zabbix_export/triggers/trigger(1)": unexpected tag "recovery_expression".

By removing the tags manually in the converted template file, the import works.

The template comes from https://github.com/fredprod/logstash-zabbix (Template_Logstash-32.xml) and the command used to convert is: zabbix-template-converter -o 3.0 Template_Logstash-32.xml > template.xml

polak785 avatar Mar 14 '18 09:03 polak785