Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Current orphan handling disrupts graphing transient indexes #3563

Closed
adamsla opened this issue May 18, 2020 · 5 comments
Closed

Current orphan handling disrupts graphing transient indexes #3563

adamsla opened this issue May 18, 2020 · 5 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@adamsla
Copy link

adamsla commented May 18, 2020

Describe the bug

If you have transient indexes in your system, the impact on re-indexing can disrupt graphing and generate excessive log messages, and becomes a burden to keep up with.

To Reproduce

Steps to reproduce the behavior:

  1. Create a Data Query where indexes periodically leave the system, like a wireless router

  2. Re-index and note a entries leave the system, the graphs stop working and warnings are generated periodically

Expected behavior

Cacti should mark them as orphans so that they are traceable, but should not bother the admin with excessive logging.

@adamsla adamsla added bug Undesired behaviour unverified Some days we don't have a clue labels May 18, 2020
@TheWitness TheWitness removed the unverified Some days we don't have a clue label May 18, 2020
@TheWitness TheWitness added this to the 1.2.13 milestone May 18, 2020
TheWitness added a commit that referenced this issue May 18, 2020
Current orphan handling disrupts graphing transient indexes.
@TheWitness TheWitness added the resolved A fixed issue label May 18, 2020
@TheWitness
Copy link
Member

I've done this in such a way as we don't need to update the cacti.sql. We should update the base sql though. Leave that here for discussion @netniV.

@ddb4github
Copy link
Contributor

create_complete_graph_from_template also call update_data_source_data_query_cache with column 'orphan'

@TheWitness
Copy link
Member

I don't think the API actually requires the orphan column. Should have not included it in the select.

@ddb4github
Copy link
Contributor

I don't think the API actually requires the orphan column. Should have not included it in the select.

  1. function update_data_source_data_query_cache operate dl.orphan:
<?php
...
lib/data_query.php:1654: function update_data_source_data_query_cache($local_data_id, $host_id = '', $data_query_id = '', $previous_index = '') {
...
lib/data_query.php:1691:     if ($data_query_id != 0 && $current_index != '' && $current_index != $previous_index) {
        /* set the index to the new index */
        db_execute_prepared('UPDATE data_local
            SET snmp_query_id = ?,
            snmp_index = ?,
            orphan = 0
            WHERE id = ?',
            array($data_query_id, $current_index, $local_data_id));

        /* update data source title cache */
  1. function create_complete_graph_from_template call update_data_source_data_query_cache
<?php
....
lib/template.php:1005: function create_complete_graph_from_template($graph_template_id, $host_id, $snmp_query_array, &$suggested_vals) {
....
lib/template.php:1230:                    /* now that we have put data into the 'data_input_data' table, update the snmp cache for ds's */
                    update_data_source_data_query_cache($cache_array['local_data_id'][$data_template['id']]);
  1. create_complete_graph_from_template is called by many files.

So I prefer to add add_orphan_support at begin of create_complete_graph_from_template function like run_data_query.

TheWitness added a commit that referenced this issue May 21, 2020
Current orphan handling disrupts graphing transient indexes
@TheWitness
Copy link
Member

Okay, I've made that change.

ddb4github added a commit to ddb4github/cacti that referenced this issue Jul 21, 2020
…m parallel process 'poller_reindex_hosts.php':

 - Add column 'orphan' during 1.2.13 upgrade
 - Remove function 'add_orphan_support'
netniV pushed a commit that referenced this issue Aug 2, 2020
* Fixed #3563: lots of "Error: Duplicate column name 'orphan'" from parallel process 'poller_reindex_hosts.php':
 - Add column 'orphan' during 1.2.13 upgrade
 - Remove function 'add_orphan_support'

* Fixed#3563: change upgrade script from 1.2.13 to 1.2.14

* Fixed#3563: change upgrade script from 1.2.13 to 1.2.14

* Fixed#3563: add new column into cacti.sql and audit_schema.sql
@github-actions github-actions bot locked and limited conversation to collaborators Aug 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

3 participants