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

Trees management screen not reporting correct number of trees #3850

Closed
netadmin101 opened this issue Oct 8, 2020 · 2 comments
Closed

Trees management screen not reporting correct number of trees #3850

netadmin101 opened this issue Oct 8, 2020 · 2 comments
Labels
bug Undesired behaviour
Milestone

Comments

@netadmin101
Copy link

netadmin101 commented Oct 8, 2020

Describe the bug

In the Tree management page, the header/footer where it shows "All # of Trees" does not show the correct count.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the console tab, click the Trees link under the Management section.
  2. The dark blue header and footer is showing a count that doesn't match up with how many trees are in the list.

Expected behavior

I would expect to see a count of the number of trees in the list on this screen.

Screenshot

This screenshot is from a fresh install of cacti 1.2.14. The first thing I did was went to the trees screen and added a new tree

image

Desktop (please complete the following information)

  • OS: Windows 10
  • Browser: Chrome/Firefox/IE

Additional context

In the file trees.php on line 1984, the following query appears to generate that number based off of the graph_tree_items table and a distinct count of how many trees are actively being used.

    $total_rows = db_fetch_cell("SELECT COUNT(DISTINCT(ti.graph_tree_id))
            FROM graph_tree AS t
            LEFT JOIN graph_tree_items AS ti
            ON t.id=ti.graph_tree_id
            $sql_where");

Would it be better to count how many trees are defined?
SELECT COUNT(DISTINCT(id)) from graph_tree;

@netadmin101 netadmin101 added bug Undesired behaviour unverified Some days we don't have a clue labels Oct 8, 2020
TheWitness added a commit that referenced this issue Oct 9, 2020
Trees management screen not reporting correct number of trees
@TheWitness TheWitness removed the unverified Some days we don't have a clue label Oct 9, 2020
@TheWitness TheWitness added this to the 1.2.15 milestone Oct 9, 2020
@TheWitness
Copy link
Member

Good catch!

@netadmin101
Copy link
Author

Thanks! Looks good now.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour
Projects
None yet
Development

No branches or pull requests

2 participants