Cacti / cacti

Cacti ™
http://www.cacti.net
GNU General Public License v2.0
1.65k stars 406 forks source link

Aggregate graph does not show other percentiles #5555

Closed DFlexy closed 12 months ago

DFlexy commented 1 year ago

I have a graph template that is applied to all graphs and aggregates, however when I create the normal graphs I can see the 95th and 99th ones but in the aggregates I cannot see this data as shown in the screenshots below

Normal graph image

Agregate graph image

Here model graph for aggregate image

TheWitness commented 1 year ago

Okay, you have two more files to download, and then you must again save the Template.

DFlexy commented 1 year ago

Good morning, let's get to the facts.

I deleted the aggregate model and created a new one. And I arrived at the following result.

When I added just 2 interfaces it worked ;) When I added just 4 interfaces, the percentiles disappeared. When I added more than 75 interfaces it worked.

And another point is that I am having several ERROR logs as below

Another point when passing Giga could make the information more summarized instead of 1590571.06 mbit

TEST WITH 2 INTERFACES image

TEST WITH 4 INTERFACES image

TEST WITH 75 INTERFACES (SLOW) image

ERROS LOG image

TheWitness commented 1 year ago

That's trace code. You may be one version off. I'll check to ensure it was committed. You too. You should not be seeing that debug code any longer.

DFlexy commented 1 year ago

I went to the aggregate template and clicked save and now the percentiles are gone again.

DFlexy commented 1 year ago

When I click on save, the aggregate of 75 interfaces works normally, only the other 2 and 4 interfaces no longer show the percentiles.

TheWitness commented 1 year ago

Funny and sad at the same time. If I were not laughing, I'd be crying otherwise.

Relative to speed, moving aggregate to a using VDEFs would make it way faster. Not in 1.2.x though. It's a big project.

TheWitness commented 1 year ago

I'm still horizontal. Once I get to a computer, I'll double check the code for the trace logic.

DFlexy commented 1 year ago

same template

image

TheWitness commented 12 months ago

I did miss one important update. Please apply it. You should probably take all three files from 1.2.x: lib/rrd.php, lib/graph_variables.php, and lib/api_aggregate.php. Your Cacti log should be clean afterwards. Keep me posted.

DFlexy commented 12 months ago

Logs clean ;)

DFlexy commented 12 months ago

Update with 20 interfaces

only 40 works 2 and 4 and 20 doesn't work

image

TheWitness commented 12 months ago

Okay, once my day cools, I'll look for more clues.

TheWitness commented 12 months ago

Okay, so on those failed cases, can you describe the Graphs that they are coming from? Are they the same Graph Template? In other words, do they all have the 4 percentiles or not. This is very important.

TheWitness commented 12 months ago

I'll be off tomorrow and we can do another round of interactive testing if you want. Even a zoom.

DFlexy commented 12 months ago

Good morning. The graphics are the same. The following is happening, when I create the graph, always using the template, the percentiles appear, however, after I click on save the graph or save the template, the graphs are losing the percentiles, except for the one with 40 interfaces.

TheWitness commented 12 months ago

Are you okay with a Zoom?

TheWitness commented 12 months ago

If so, send your details to thewitness@cacti.net and I'll send an invite this morning.

DFlexy commented 12 months ago

I don't speak English and my company's VPN only uses Teams

TheWitness commented 12 months ago

We don't need audio. Just send a compatible link out and I can join that way. We can use Chat. How are your vim skills?

TheWitness commented 12 months ago

@DFlexy, Update lib/api_aggregate.php. If it does not fix, consider sanitizing anything confidential and send me a dump of the database via Email. That way it's easier for me to reproduce.

DFlexy commented 12 months ago

Bug here again

image image

TheWitness commented 12 months ago

What line in what file?

TheWitness commented 12 months ago

Run the audit_database.php script and correct the issues.

TheWitness commented 12 months ago

Please send me your database dump if you want this fixed before the 1.2.26 release. You know where.

DFlexy commented 12 months ago

I made the exchange and ran the following tests.

When I create the aggregate it works normally However, when I save the template, the percentiles of the aggregate created only. But when you go to the created aggregate and remove it from the template model by clicking on Propagation Enabled and unchecking the option, the percentiles will return and it will be left out of the model

After creating the aggregate using the model image

image

After save model agregate image

After remove option Propagation Enabled image

image

image

TheWitness commented 12 months ago

Well, that's a very interesting development.

TheWitness commented 12 months ago

Is it possible to send the dump?

DFlexy commented 12 months ago

Is it possible to send the dump?

I tried to remove the database dump but I can't remove the confidential information. Do I need a specific table?

TheWitness commented 12 months ago

One thing you can do is edit the sql file and then search for confidential information. If you edit in VIM, you can replace as follows:

vim mydump.sql
# Assume you are searching to replace "ABC" with something else
:%s/ABC/randomsomething/g
# That above command replaces everything in the file that matches "ABC" with the string "randomsomething"

Just keep doing that until all the 'confidential' stuff is gone.

TheWitness commented 12 months ago

Another approach is just use sed

sed -i 's/ABC/somethingrandom/g' mydump.sql
TheWitness commented 12 months ago

Things confidential can be considered: ip addresses, snmp communities, site names, hostnames, and even interface names. I only have interest in the situation. I don't care about the rest.

TheWitness commented 12 months ago

The other route is this. When you view an aggregate graph, you find in the address bar and id like in the case below, it's 1032. That is the local graph id of the Aggregate graph. So, when the graphs are broken, run this SQL command below:

select task_item_id, value, text_format from graph_templates_item where local_graph_id=1032;

Then, fix them, and run the command again as above. Send the output from each to the ticket.

TheWitness commented 12 months ago

Here is my example:

MariaDB [cacti]> select task_item_id, value, text_format from graph_templates_item where local_graph_id=1032;                                        +--------------+--------------------------------------+----------------------------------------------------+
| task_item_id | value                                | text_format                                        |
+--------------+--------------------------------------+----------------------------------------------------+
|         2268 |                                      |                                                    |
|         2270 |                                      |                                                    |
|         2264 |                                      |                                                    |
|         2272 |                                      |                                                    |
|         2274 |                                      |                                                    |
|         2276 |                                      |                                                    |
|         2278 |                                      |                                                    |
|         2266 |                                      |                                                    |
|         2280 |                                      |                                                    |
|         2282 |                                      |                                                    |
|         2269 |                                      |                                                    |
|         2271 |                                      |                                                    |
|         2265 |                                      |                                                    |
|         2273 |                                      |                                                    |
|         2275 |                                      |                                                    |
|         2277 |                                      |                                                    |
|         2279 |                                      |                                                    |
|         2267 |                                      |                                                    |
|         2281 |                                      |                                                    |
|         2283 |                                      |                                                    |
|          123 |                                      | Total Inbound                                      |
|          123 |                                      | Current:                                           |
|          123 |                                      | Average:                                           |
|          123 |                                      | Maximum:                                           |
|          124 |                                      | Total Outbound                                     |
|          124 |                                      | Current:                                           |
|          124 |                                      | Average:                                           |
|          124 |                                      | Maximum:                                           |
|            0 |                                      |                                                    |
|          123 | |95:bits:0:aggregate_current_peak:2| | 95th Percentile                                    |
|          123 |                                      | (|95:bits:6:aggregate_current_peak:2| mbit in+out) |
|          123 | |98:bits:0:aggregate_current_peak:2| | 98th Percentile                                    |
|          123 |                                      | (|98:bits:6:aggregate_current_peak:2| mbit in+out) |
+--------------+--------------------------------------+----------------------------------------------------+
33 rows in set (0.001 sec)
DFlexy commented 12 months ago

This is the result of the aggregated graph of 75 interfaces that does not cause problems and always works

MariaDB [cactidb]> select task_item_id, value, text_format from graph_templates_item where local_graph_id=1477;
+--------------+---------------------------------+----------------------------------------+
| task_item_id | value                           | text_format                            |
+--------------+---------------------------------+----------------------------------------+
|          130 |                                 |                                        |
|          131 |                                 |                                        |
|          132 |                                 |                                        |
|          133 |                                 |                                        |
|          134 |                                 |                                        |
|          135 |                                 |                                        |
|          182 |                                 |                                        |
|          183 |                                 |                                        |
|          212 |                                 |                                        |
|          213 |                                 |                                        |
|          214 |                                 |                                        |
|          215 |                                 |                                        |
|          216 |                                 |                                        |
|          217 |                                 |                                        |
|          228 |                                 |                                        |
|          229 |                                 |                                        |
|          230 |                                 |                                        |
|          231 |                                 |                                        |
|          232 |                                 |                                        |
|          233 |                                 |                                        |
|          306 |                                 |                                        |
|          307 |                                 |                                        |
|          312 |                                 |                                        |
|          313 |                                 |                                        |
|          322 |                                 |                                        |
|          323 |                                 |                                        |
|          324 |                                 |                                        |
|          325 |                                 |                                        |
|          326 |                                 |                                        |
|          327 |                                 |                                        |
|          328 |                                 |                                        |
|          329 |                                 |                                        |
|          330 |                                 |                                        |
|          331 |                                 |                                        |
|          332 |                                 |                                        |
|          333 |                                 |                                        |
|          382 |                                 |                                        |
|          383 |                                 |                                        |
|          384 |                                 |                                        |
|          385 |                                 |                                        |
|          386 |                                 |                                        |
|          387 |                                 |                                        |
|         2492 |                                 |                                        |
|         2493 |                                 |                                        |
|         2494 |                                 |                                        |
|         2495 |                                 |                                        |
|         2500 |                                 |                                        |
|         2501 |                                 |                                        |
|         2532 |                                 |                                        |
|         2533 |                                 |                                        |
|         2544 |                                 |                                        |
|         2545 |                                 |                                        |
|         2588 |                                 |                                        |
|         2589 |                                 |                                        |
|         2590 |                                 |                                        |
|         2591 |                                 |                                        |
|         2606 |                                 |                                        |
|         2607 |                                 |                                        |
|         2608 |                                 |                                        |
|         2609 |                                 |                                        |
|         2616 |                                 |                                        |
|         2617 |                                 |                                        |
|         2618 |                                 |                                        |
|         2619 |                                 |                                        |
|         2622 |                                 |                                        |
|         2623 |                                 |                                        |
|         2634 |                                 |                                        |
|         2635 |                                 |                                        |
|         2636 |                                 |                                        |
|         2637 |                                 |                                        |
|         2656 |                                 |                                        |
|         2657 |                                 |                                        |
|         2662 |                                 |                                        |
|         2663 |                                 |                                        |
|         2676 |                                 |                                        |
|         2677 |                                 |                                        |
|         2684 |                                 |                                        |
|         2685 |                                 |                                        |
|         2712 |                                 |                                        |
|         2713 |                                 |                                        |
|         2714 |                                 |                                        |
|         2715 |                                 |                                        |
|         2716 |                                 |                                        |
|         2717 |                                 |                                        |
|         2718 |                                 |                                        |
|         2719 |                                 |                                        |
|         2730 |                                 |                                        |
|         2731 |                                 |                                        |
|         2732 |                                 |                                        |
|         2733 |                                 |                                        |
|         2734 |                                 |                                        |
|         2735 |                                 |                                        |
|         2736 |                                 |                                        |
|         2737 |                                 |                                        |
|         2738 |                                 |                                        |
|         2739 |                                 |                                        |
|         2740 |                                 |                                        |
|         2741 |                                 |                                        |
|         2742 |                                 |                                        |
|         2743 |                                 |                                        |
|         2746 |                                 |                                        |
|         2747 |                                 |                                        |
|         2748 |                                 |                                        |
|         2749 |                                 |                                        |
|         2916 |                                 |                                        |
|         2917 |                                 |                                        |
|         2918 |                                 |                                        |
|         2919 |                                 |                                        |
|         2920 |                                 |                                        |
|         2921 |                                 |                                        |
|         2922 |                                 |                                        |
|         2923 |                                 |                                        |
|         2949 |                                 |                                        |
|         2950 |                                 |                                        |
|         2951 |                                 |                                        |
|         2952 |                                 |                                        |
|         2953 |                                 |                                        |
|         2954 |                                 |                                        |
|         2955 |                                 |                                        |
|         2956 |                                 |                                        |
|         2957 |                                 |                                        |
|         2958 |                                 |                                        |
|         3001 |                                 |                                        |
|         3002 |                                 |                                        |
|         3007 |                                 |                                        |
|         3008 |                                 |                                        |
|         3009 |                                 |                                        |
|         3010 |                                 |                                        |
|         3011 |                                 |                                        |
|         3012 |                                 |                                        |
|         3013 |                                 |                                        |
|         3014 |                                 |                                        |
|         3015 |                                 |                                        |
|         3016 |                                 |                                        |
|         3024 |                                 |                                        |
|         3025 |                                 |                                        |
|         3026 |                                 |                                        |
|         3027 |                                 |                                        |
|         3028 |                                 |                                        |
|         3029 |                                 |                                        |
|         3034 |                                 |                                        |
|         3035 |                                 |                                        |
|         3038 |                                 |                                        |
|         3039 |                                 |                                        |
|         3040 |                                 |                                        |
|         3041 |                                 |                                        |
|         3042 |                                 |                                        |
|         3043 |                                 |                                        |
|         3044 |                                 |                                        |
|         3045 |                                 |                                        |
|           66 |                                 | Total Inbound                          |
|           66 |                                 | Current:                               |
|           66 |                                 | Average:                               |
|           66 |                                 | Maximum:                               |
|           67 |                                 | Total Outbound                         |
|           67 |                                 | Current:                               |
|           67 |                                 | Average:                               |
|           67 |                                 | Maximum:                               |
|            0 |                                 |                                        |
|           66 | |95:bits:0:aggregate_current:2| | 95th Percentile In  ->                 |
|           66 |                                 | (|95:bits:6:aggregate_current:2| mbit) |
|           66 | |99:bits:0:aggregate_current:2| | 99th Percentile In  ->                 |
|           66 |                                 | (|99:bits:6:aggregate_current:2| mbit) |
|           66 | |95:bits:0:aggregate_current:2| | 95th Percentile Out ->                 |
|           67 |                                 | (|95:bits:6:aggregate_current:2| mbit) |
|           67 | |99:bits:0:aggregate_current:2| | 99th Percentile Out ->                 |
|           67 |                                 | (|99:bits:6:aggregate_current:2| mbit) |
+--------------+---------------------------------+----------------------------------------+
167 rows in set (0.00 sec)
DFlexy commented 12 months ago

This is the other one that I removed from the unit to work

MariaDB [cactidb]> select task_item_id, value, text_format from graph_templates_item where local_graph_id=1483;
+--------------+---------------------------------+----------------------------------------+
| task_item_id | value                           | text_format                            |
+--------------+---------------------------------+----------------------------------------+
|         3007 |                                 |                                        |
|         3008 |                                 |                                        |
|         3009 |                                 |                                        |
|         3010 |                                 |                                        |
|         3011 |                                 |                                        |
|         3012 |                                 |                                        |
|         3013 |                                 |                                        |
|         3014 |                                 |                                        |
|         3015 |                                 |                                        |
|         3016 |                                 |                                        |
|           66 |                                 |                                        |
|           66 |                                 | Current:                               |
|           66 |                                 | Average:                               |
|           66 |                                 | Maximum:                               |
|           67 |                                 |                                        |
|           67 |                                 | Current:                               |
|           67 |                                 | Average:                               |
|           67 |                                 | Maximum:                               |
|            0 |                                 |                                        |
|           66 | |95:bits:0:aggregate_current:2| | 95th Percentile In  ->                 |
|           66 |                                 | (|95:bits:6:aggregate_current:2| mbit) |
|           66 | |99:bits:0:aggregate_current:2| | 99th Percentile In  ->                 |
|           66 |                                 | (|99:bits:6:aggregate_current:2| mbit) |
|           66 | |95:bits:0:aggregate_current:2| | 95th Percentile Out ->                 |
|           67 |                                 | (|95:bits:6:aggregate_current:2| mbit) |
|           67 | |99:bits:0:aggregate_current:2| | 99th Percentile Out ->                 |
|           67 |                                 | (|99:bits:6:aggregate_current:2| mbit) |
+--------------+---------------------------------+----------------------------------------+
27 rows in set (0.00 sec)
DFlexy commented 12 months ago

This is from a new chart that is still working without updating the template

MariaDB [cactidb]> select task_item_id, value, text_format from graph_templates_item where local_graph_id=1484;
+--------------+---------------------------------+----------------------------------------+
| task_item_id | value                           | text_format                            |
+--------------+---------------------------------+----------------------------------------+
|         2959 |                                 |                                        |
|         2960 |                                 |                                        |
|         2967 |                                 |                                        |
|         2968 |                                 |                                        |
|         2963 |                                 |                                        |
|         2964 |                                 |                                        |
|         2969 |                                 |                                        |
|         2970 |                                 |                                        |
|         3007 |                                 |                                        |
|         3008 |                                 |                                        |
|           66 |                                 |                                        |
|           66 |                                 | Current:                               |
|           66 |                                 | Average:                               |
|           66 |                                 | Maximum:                               |
|           67 |                                 |                                        |
|           67 |                                 | Current:                               |
|           67 |                                 | Average:                               |
|           67 |                                 | Maximum:                               |
|            0 |                                 |                                        |
|           66 | |95:bits:0:aggregate_current:2| | 95th Percentile In  ->                 |
|           66 |                                 | (|95:bits:6:aggregate_current:2| mbit) |
|           66 | |99:bits:0:aggregate_current:2| | 99th Percentile In  ->                 |
|           66 |                                 | (|99:bits:6:aggregate_current:2| mbit) |
|           66 | |95:bits:0:aggregate_current:2| | 95th Percentile Out ->                 |
|           67 |                                 | (|95:bits:6:aggregate_current:2| mbit) |
|           67 | |99:bits:0:aggregate_current:2| | 99th Percentile Out ->                 |
|           67 |                                 | (|99:bits:6:aggregate_current:2| mbit) |
+--------------+-------------
TheWitness commented 12 months ago

Thanks for that. There is an error in your template. Look at the screen shot below. 66 is in, 67 is out.

image

TheWitness commented 12 months ago

It's your Graph Template.

DFlexy commented 12 months ago

can help check here ?

image

TheWitness commented 12 months ago

You must first:

1) Edit the original Graph Template and fix the entry 2) Then go to the Aggregate Template and resave it.

Still waiting on the dump.

DFlexy commented 12 months ago

Good morning. I checked all chart template settings I removed the aggregate template again and created it again.

Here is what I identified. I created 3 new aggregates.

1 with 4 interfaces It works but after saving the aggregate template it stops working

1 with 10 interfaces It works but after saving the aggregate template it stops working

1 with 20 interfaces Works smoothly even after saving the aggregated template

DFlexy commented 12 months ago

AWAYS WORK | 66 | | | | 66 | | Current: | | 66 | | Average: | | 66 | | Maximum: | | 67 | | | | 67 | | Current: | | 67 | | Average: | | 67 | | Maximum: | | 0 | | | | 66 | |95:bits:0:aggregate_current:2| | 95th Percentile In -> | | 66 | | (|95:bits:6:aggregate_current:2| mbit) | | 66 | |99:bits:0:aggregate_current:2| | 99th Percentile In -> | | 66 | | (|99:bits:6:aggregate_current:2| mbit) | | 67 | |95:bits:0:aggregate_current:2| | 95th Percentile Out -> | | 67 | | (|95:bits:6:aggregate_current:2| mbit) | | 67 | |99:bits:0:aggregate_current:2| | 99th Percentile Out -> | | 67 | | (|99:bits:6:aggregate_current:2| mbit) | +--------------+---------------------------------+----------------------------------------+

DONT WORK +--------------+-------+-------------+ | task_item_id | value | text_format | +--------------+-------+-------------+ | 2408 | | | | 2409 | | | | 2576 | | | | 2577 | | | | 2959 | | | | 2960 | | | | 2969 | | | | 2970 | | | | 66 | | | | 66 | | Current: | | 66 | | Average: | | 66 | | Maximum: | | 67 | | | | 67 | | Current: | | 67 | | Average: | | 67 | | Maximum: | +--------------+-------+-------------+

DONT WORK +--------------+-------+-------------+ | task_item_id | value | text_format | +--------------+-------+-------------+ | 2975 | | | | 2976 | | | | 2977 | | | | 2978 | | | | 2979 | | | | 2980 | | | | 2981 | | | | 2982 | | | | 2987 | | | | 2988 | | | | 2989 | | | | 2990 | | | | 2991 | | | | 2992 | | | | 2993 | | | | 2994 | | | | 2995 | | | | 2996 | | | | 3036 | | | | 3037 | | | | 66 | | | | 66 | | Current: | | 66 | | Average: | | 66 | | Maximum: | | 67 | | | | 67 | | Current: | | 67 | | Average: | | 67 | | Maximum: | +--------------+-------+-------------+

DFlexy commented 12 months ago

I believe it has something to do with the number of interfaces

DFlexy commented 12 months ago

image

DFlexy commented 12 months ago

New test with 30 interfaces also stopped working, only the one with 20 interfaces that works anyway

TheWitness commented 12 months ago

The only way I'll be able to go further on this is to have a db dump.

TheWitness commented 12 months ago

Ope! I just reproduced it in my local environment!

TheWitness commented 12 months ago

Okay, it's fixed now. Just re-save the Template once updated. Thanks for your patience.

TheWitness commented 12 months ago

I've logged this enhancement as well.

https://github.com/Cacti/cacti/issues/5595

DFlexy commented 12 months ago

Woohoo Thank you very much for your patience and I really appreciate your effort. Working perfectly. I played the file and the graphics worked without problems. Thank you and that I have everything good

image