Importing templates overwrites existing settings

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Importing templates overwrites existing settings

Post by skatter »

How can I stop the template import process from overwriting my existing settings? I select "Use defaults for this installation (Recommended)" which I expected to retain my system's settings and only import the new data, but now all of the below "[update]" entries have munged up my existing settings.

Data Template
[success] Interface - Traffic [update]
[success] Interface - Errors/Discards [update]
[success] Interface - Unicast Packets [update]
[success] Interface - Non-Unicast Packets [update]

Graph Template
[success] Interface - Traffic (bits/sec) [update]
[success] Interface - Errors/Discards [update]
[success] Interface - Unicast Packets [update]
[success] Interface - Non-Unicast Packets [update]
[success] Interface - Traffic (bytes/sec) [update]
[success] Interface - Traffic (bits/sec, 95th Percentile) [update]
[success] Interface - Traffic (bits/sec, Total Bandwidth) [update]
[success] Interface - Traffic (bytes/sec, Total Bandwidth) [update]

Data Query
[success] SNMP - Interface Statistics [update]
skatter
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Re: Importing templates overwrites existing settings

Post by skatter »

Anyone?
skatter
skatter
Cacti User
Posts: 153
Joined: Fri Oct 22, 2004 2:55 am
Contact:

Re: Importing templates overwrites existing settings

Post by skatter »

So if I'm interpreting this correctly, the "Use defaults ..." checkbox is just for retaining the installation's RRA values, but not for retaining existing template information.

Is there a way to import a host template without overwriting existing templates such as Interface - Traffic bits/sec?
skatter
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Importing templates overwrites existing settings

Post by noname »

At the moment, Cacti can't verify templates before importing.
(Perhaps it should be posted as feature requests..)
The template which has same hash code as existing template will overwrite it.
skatter wrote:Is there a way to import a host template without overwriting existing templates such as Interface - Traffic bits/sec?
For example -- but it may be very troublesome -- as a workaround:

1) Setup another installation of Cacti as test environment
2) Import new host template to Cacti (test environment)
3) Duplicate all dependencies (host template, graph template, data template, data query, etc.) and bind each other
4) Export the "duplicated" host template
5) Import it to original Cacti (= production environment)

// But I've never tested this way..
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: Importing templates overwrites existing settings

Post by gandalf »

noname wrote:At the moment, Cacti can't verify templates before importing.
(Perhaps it should be posted as feature requests..)
It's a known feature request, created by myself. But it's hard to implement.
The template which has same hash code as existing template will overwrite it.
We call that a feature. This way, you will be able to e.g. import modified/fixed templates

R.
Patas007
Posts: 4
Joined: Mon Oct 15, 2012 9:11 am

Re: Importing templates overwrites existing settings

Post by Patas007 »

gandalf wrote:
noname wrote:At the moment, Cacti can't verify templates before importing.
(Perhaps it should be posted as feature requests..)
It's a known feature request, created by myself. But it's hard to implement.
Gandalf, would it be possible to setup import with checkboxes so user can check which templates included in the import file will be imported (overwritten) in Cacti?
gandalf wrote:
The template which has same hash code as existing template will overwrite it.
We call that a feature. This way, you will be able to e.g. import modified/fixed templates

R.
To be honest this "feature" is giving user another overhead with correction of the templates which were overwritten by such "unwanted" import.

My idea "how to add only new templates from given file" or "how to preserve existing templates from being overwritten during template import"

1. export all existing templates (backup)
2. import of new templates (some of existing templates can be overwritten)
3. import templates from backup (this will reverse back the templates overwritten in step 2. New templates will remain added)

Do you agree with this solution?

thank you
PAT
bigrow
Posts: 49
Joined: Wed Jun 20, 2012 10:02 am

Re: Importing templates overwrites existing settings

Post by bigrow »

I've done the same thing.......

if this works it sounds good......
Nadou21
Posts: 15
Joined: Tue Mar 09, 2021 11:33 am

Re: Importing templates overwrites existing settings

Post by Nadou21 »

Thank's @Patas007, I tried your method and it works perfectly :D
Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests