File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ Cacti CHANGELOG
2727-issue#5181: Poller functions can cause SQL errors in some cases when working with remote data collectors
2828-issue#5182: Graph Image does not have check for Remote Agent
2929-issue#5184: Cacti permission checks generate SQL errors is the user has been deleted
30+ -issue#5185: Repair Database does not prune old Poller Item Records
3031
31321.2.23
3233-security#4920: Add .htaccess file to scripts folder
Original file line number Diff line number Diff line change 255255 print 'NOTE: Found No Data Input Data hostname or host_id Type Code issues ' . PHP_EOL ;
256256}
257257
258+ print 'NOTE: Repairing orphaned Poller Items. ' . PHP_EOL ;
259+
260+ db_execute ('DELETE pi
261+ FROM poller_item AS pi
262+ LEFT JOIN data_local AS dl
263+ ON pi.local_data_id = dl.id
264+ WHERE dl.id IS NULL ' );
265+
266+ $ fixes = db_affected_rows ();
267+ if ($ fixes ) {
268+ printf ('NOTE: Found and Repaired %s Poller Items ' . PHP_EOL , $ fixes );
269+ } else {
270+ print 'NOTE: Found No Problems with orphaned Poller Items ' . PHP_EOL ;
271+ }
272+
258273print PHP_EOL . '------------------------------------------------------------------------ ' . PHP_EOL ;
259274print 'Detailed Checks. Use --force to repair if found. ' . PHP_EOL . PHP_EOL ;
260275
You can’t perform that action at this time.
0 commit comments