zabbix-tools / zabbix-template-converter

Migrate Zabbix templates between versions
MIT License
45 stars 30 forks source link

unexpected tag "recovery_mode" error #3

Open wavelet123 opened 7 years ago

wavelet123 commented 7 years ago

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 commented 7 years ago

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

wavelet123 commented 7 years ago

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

cavaliercoder commented 7 years ago

Can you please share the template that fails to import?

wavelet123 commented 7 years ago

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

wavelet123 commented 7 years ago

mdb2.xml.gz 2.0 version thanks

cavaliercoder commented 7 years ago

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.

wavelet123 commented 7 years ago

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

cavaliercoder commented 7 years ago

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
wavelet123 commented 7 years ago

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

cavaliercoder commented 7 years ago

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.

funkt commented 6 years ago

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

arielzn commented 6 years ago

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

polak785 commented 6 years ago

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