Cacti / plugin_mikrotik

Mikrotik Plugin for Cacti
GNU General Public License v2.0
60 stars 24 forks source link

XML parse error on Import Template #44

Closed rirozizo closed 3 years ago

rirozizo commented 4 years ago

Describe the bug A clear and concise description of what the bug is.

I get an XML parse error when I try to import the MikroTik_Device.xml file

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Import/Export'
  2. Click on 'Import Templates'
  3. Click on 'Select a File'
  4. Select the 'MikroTik_Device.xml' file
  5. Click on 'Import'

Expected behavior It should import the template, maybe give me a new device type?

Screenshots If applicable, add screenshots to help explain your problem.

cacti

Plugin (please complete the following information):

Desktop (please complete the following information):

Additional context Cacti Logs say the following:

2020-06-23 15:43:27 - IMPORT ERROR: Import or Preview failed!
2020-06-23 15:43:27 - IMPORT parse_xml_hash ERROR wrong hash format for hash: info
rirozizo commented 4 years ago

Using SSH, I tried the following command:

php -q /<cactidir>/cli/import_template.php --filename=/<cactidir>/site/plugins/mikrotik/templates/MikroTik_Device.xml --with-template-rras

It leads to the same error in Cacti's Log:

IMPORT parse_xml_hash ERROR wrong hash format for hash: info
frituurpan commented 3 years ago

I made the same mistake, but if you use import_package.php, it works.

php cli/import_package.php --filename=/cacti/plugins/mikrotik/templates/MikroTik_Device.xml

https://github.com/Cacti/cacti/issues/3320#issuecomment-596222571

TheWitness commented 3 years ago

Import package for an XML file seems odd. If it was an xml.gz file, then all is good.