Cacti / plugin_thold

Thold Plugin for Cacti
GNU General Public License v2.0
68 stars 61 forks source link

Navigator will not be updated when content changes #707

Open skyjou opened 1 month ago

skyjou commented 1 month ago

Describe the bug Navigator will not be updated when content changes.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Thold'
  2. Click on 'Device Status'
  3. See error

Expected behavior Navigator will be updated when content changes.

Plugin:

Desktop:

Additional context It seems that the get_total_row_data() function causes the navigator to cache outdated information for 86400 seconds.

xmacan commented 1 month ago

Cannot reproduce this. Try to update to 1.8.2, it was released yesterday

skyjou commented 1 month ago

I just upgraded to the new version. The issue still exist:

Screenshot from 2024-10-17 14-59-31

There are 8 not-up devices, but the navbar shows 7 only.

skyjou commented 1 month ago

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.