Navigator will not be updated when content changes
Describe the bug Navigator will not be updated when content changes.
To Reproduce Steps to reproduce the behavior:
- Go to 'Thold'
- Click on 'Device Status'
- See error
Expected behavior Navigator will be updated when content changes.
Plugin:
- Version: 1.8.1
- Source: GitHub
Desktop:
- OS: Ubuntu 24.04
- Browser: Chrome, Firefox
Additional context
It seems that the get_total_row_data() function causes the navigator to cache outdated information for 86400 seconds.
Cannot reproduce this. Try to update to 1.8.2, it was released yesterday
I just upgraded to the new version. The issue still exist:
There are 8 not-up devices, but the navbar shows 7 only.
If I change line 8072 in thold_functions.php from:
$total_rows = get_total_row_data($user_id, $sql, array(), 'thold_device');
to:
$total_rows = get_total_row_data($user_id, $sql, array(), 'thold_device', 10);
or:
$total_rows = db_fetch_cell($sql);
Narbar can update correctly, but this is not a good solution.
The narbar total_rows should be cached only before the next poller run, or just not cache it.
@skyjou, can you go to the plugins directory and do the following. Return what you find:
grep -r get_total_row_data *
I'm looking for see what plugin is redefining that function. We need to know what plugin is defining that function. It was likely written years ago for some customization that is no longer valid.
This is what I get:
[root@vmhost5 plugins]# grep -r get_total_row_data *
thold/thold_functions.php: if (function_exists('get_total_row_data') && $graph_id == 0) {
thold/thold_functions.php: $total_rows = get_total_row_data($user_id, $sql, array(), 'thold');
thold/thold_functions.php: if (function_exists('get_total_row_data') && $graph_id == 0) {
thold/thold_functions.php: $total_rows = get_total_row_data($user_id, $sql, array(), 'thold_log');
thold/thold_functions.php: if (function_exists('get_total_row_data') && $device_id == 0) {
thold/thold_functions.php: $total_rows = get_total_row_data($user_id, $sql, array(), 'thold_device');
You see that function is not in the thold plugin.
$ grep -r get_total_row_data *
thold/thold_functions.php: if (function_exists('get_total_row_data') && $graph_id == 0) {
thold/thold_functions.php: $total_rows = get_total_row_data($user_id, $sql, array(), 'thold');
thold/thold_functions.php: if (function_exists('get_total_row_data') && $graph_id == 0) {
thold/thold_functions.php: $total_rows = get_total_row_data($user_id, $sql, array(), 'thold_log');
thold/thold_functions.php: if (function_exists('get_total_row_data') && $device_id == 0) {
thold/thold_functions.php: /* $total_rows = get_total_row_data($user_id, $sql, array(), 'thold_device'); */
The only plugin I installed is thold:
$ ls -l
total 8
-rw-rw-r-- 1 www-data www-data 1586 Oct 7 2024 index.php
drwxrwxr-x 9 www-data www-data 4096 Oct 17 2024 thold
It seems that the function get_total_row_data is defined in lib/auth.php.
So, you must be using Cacti 1.3? I forgot to check that. Thanks for the heads up.
I'm still using version 1.2.28.
Okay, yea, we need to make that like 30 seconds.
Fixed now. Thanks for reporting and being patient.