Error importing Mikrotik template - SOLVED

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
NeODarK
Posts: 5
Joined: Wed Apr 01, 2020 1:08 pm

Error importing Mikrotik template - SOLVED

Post by NeODarK »

Hi, I have installed cacti 1.2.2 on Debian 10 with "apt install cacti cacti-spine".

All works fine but I cant install latest Mikrotik plugin https://github.com/Cacti/plugin_mikrotik

I tried:

Copied the mikrotik plugin folder to plugins folder and renamed to mikrotik
execute this command: php import_package.php --filename='/usr/share/cacti/site/plugins/mikrotik/templates/MikroTik_Device.xml.gz'
And got this error:

Code: Select all

19/02/2021 20:23:21 - IMPORT NOTE: File is Signed Correctly
19/02/2021 20:23:21 - IMPORT Importing XML Data for MikroTik_Device.xml
19/02/2021 20:23:21 - ERROR PHP NOTICE: Undefined index:  in file: /usr/share/cacti/site/lib/import.php  on line: 164
19/02/2021 20:23:21 - CMDPHP PHP ERROR NOTICE Backtrace:  (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[371]:import_xml_data(), /lib/import.php[164]:CactiErrorHandler())
19/02/2021 20:23:21 - ERROR PHP NOTICE: Undefined index:  in file: /usr/share/cacti/site/lib/import.php  on line: 167
19/02/2021 20:23:21 - CMDPHP PHP ERROR NOTICE Backtrace:  (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[371]:import_xml_data(), /lib/import.php[167]:CactiErrorHandler())
Also tried:
Edit file include/global_arrays.php and include cacti versions 1.2.3 and 1.2.4 (I know this not affect in my case)

Code: Select all

        '1.2.1'  => '0101',
        '1.2.2'  => '0101',
        '1.2.3'  => '0102',
        '1.2.4'  => '0102',
);
Any got the same error and know how to fix it?

Thanks!!
Last edited by NeODarK on Sat Feb 20, 2021 2:21 am, edited 1 time in total.
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Error importing Mikrotik template

Post by cigamit »

https://github.com/Cacti/plugin_mikrotik#changelog
--- 2.5 ---
feature: Minimum version Cacti 1.2.11
Your going to need to use the repo for Mikrotik v2.4
https://github.com/Cacti/plugin_mikrotik/tree/v2.4
NeODarK
Posts: 5
Joined: Wed Apr 01, 2020 1:08 pm

Re: Error importing Mikrotik template

Post by NeODarK »

cigamit wrote: Fri Feb 19, 2021 10:55 pm https://github.com/Cacti/plugin_mikrotik#changelog
--- 2.5 ---
feature: Minimum version Cacti 1.2.11
Your going to need to use the repo for Mikrotik v2.4
https://github.com/Cacti/plugin_mikrotik/tree/v2.4
Hi, with
--- 2.5 --- feature: Minimum version Cacti 1.2.11
I understand minimal version of cacti 1.2.11 and I has 1.2.2....

Sorry, I forgot to tell it in the post... I also tried with v2.4 plugin version with the same result, now I tried again....

Code: Select all

root@Cacti-1:/usr/share/cacti/cli# php import_package.php --filename=/usr/share/cacti/site/plugins/mikrotik/templates/MikroTik_Device.xml.gz
Read 131125 bytes of Package data
PHP Notice:  Undefined index:  in /usr/share/cacti/site/lib/import.php on line 164
PHP Notice:  Undefined index:  in /usr/share/cacti/site/lib/import.php on line 167
root@Cacti-1:/usr/share/cacti/cli#
And this is that I got in cacti interface log:

Code: Select all

20/02/2021 05:14:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[371]:import_xml_data(), /lib/import.php[167]:CactiErrorHandler())
20/02/2021 05:14:48 - ERROR PHP NOTICE: Undefined index: in file: /usr/share/cacti/site/lib/import.php on line: 167
20/02/2021 05:14:48 - CMDPHP PHP ERROR NOTICE Backtrace: (/usr/share/cacti/cli/import_package.php[133]:import_package(), /lib/import.php[371]:import_xml_data(), /lib/import.php[164]:CactiErrorHandler())
20/02/2021 05:14:48 - ERROR PHP NOTICE: Undefined index: in file: /usr/share/cacti/site/lib/import.php on line: 164
NeODarK
Posts: 5
Joined: Wed Apr 01, 2020 1:08 pm

Re: Error importing Mikrotik template

Post by NeODarK »

hi, finally I solved, was trying v2.4 can´t install... v2.3 can´t install... and v2.2 can install

Cacti 1.2.2 working with mikrotik plugin v2.2

Thanks!!
cigamit
Developer
Posts: 3367
Joined: Thu Apr 07, 2005 3:29 pm
Location: B/CS Texas
Contact:

Re: Error importing Mikrotik template

Post by cigamit »

NeODarK wrote: Sat Feb 20, 2021 12:17 am Hi, with
--- 2.5 --- feature: Minimum version Cacti 1.2.11
I understand minimal version of cacti 1.2.11 and I has 1.2.2....
Just for future reference, we use a numerical sequencing, so 11 is newer than 2. You can think of it this way, you have version 1.2.02. As we are currently at 1.2.16, you are ~14 versions behind on Cacti.
NeODarK
Posts: 5
Joined: Wed Apr 01, 2020 1:08 pm

Re: Error importing Mikrotik template

Post by NeODarK »

cigamit wrote: Sat Feb 20, 2021 1:07 pm
NeODarK wrote: Sat Feb 20, 2021 12:17 am Hi, with
--- 2.5 --- feature: Minimum version Cacti 1.2.11
I understand minimal version of cacti 1.2.11 and I has 1.2.2....
Just for future reference, we use a numerical sequencing, so 11 is newer than 2. You can think of it this way, you have version 1.2.02. As we are currently at 1.2.16, you are ~14 versions behind on Cacti.
Oh, sorry for that, my mistake.... but now, working fine... Thanks for support!! :D
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests