Skip to content

Saving a bad Data Template can damage Data Sources #4480

@TheWitness

Description

@TheWitness

Describe the bug

Cacti's Data Templates are very versatile, but there are dark corners that are not well explained or understood that can lead to catastrophic consequences if the author of the Data Template is not aware of them. Cacti should not allow these type of dark corners negatively impact the system as often as possible.

One such case is when you have a Data Template based upon a Data Query. For Data Queries, there are three "Custom Data" fields where the Checkbox to the left of the fields MUST be checked in order to not damage the Data Template. Just about all rookies, and even experts forget to check these checkboxes and as a result, months even years later, they may go back and re-save a Data Template, and damage all of their Graphs and Data Sources using that Data Template.

The same can be said of "Custom Data" using Special Type Codes, from the Device. There is really no case where these Special Type codes should not be applied, so that checkbox to the left of the field should always be checked.

Lastly, when editing a Data Template, a user should be warned that if they uncheck the checkbox, for Data Templates that already have Data Sources, that they may experience data loss.

To Reproduce

Steps to reproduce the behavior:

  1. Create Data Query Graphs from a Data Source

  2. Verify that you have Poller Items for these new Data Sources

  3. Edit the Data Template and Set Input Type, Input Value, Object Type ID checkboxes "off"

  4. Save the Data Template

  5. View the Poller Item again and notice that they have disappeared

Expected behavior

  • Cacti should not allow this negative behavior as much as possible
  • Since the problem can be undone, at least with Data Queries, provide repair tools to correct this problem for legacy templates that are structured well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUndesired behaviourresolvedA fixed issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions