2 Commits
Author SHA1 Message Date
5183440eba Add bulk change data source profile functionality with automatic RRD rebuild (#6495)
* Update data_sources.php

feat: Add bulk change data source profile functionality with automatic RRD rebuild

- Add new action option "Change Profile" in data source bulk actions menu
- Implement profile change with automatic RRD file handling:
  - Update data_template_data, data_template_rrd, and poller_item tables
  - Automatically backup and remove RRD files when step value changes
  - RRD files will be recreated with new parameters at next polling cycle
- Add form configuration for profile selection in bulk action dialog
- Add logging for RRD file backup operations

This feature allows administrators to bulk change data source profiles,
automatically handling the RRD file recreation when polling intervals change.
Old RRD files are backed up with timestamp before removal for safety.

Affects: data_sources.php

* Update data_sources.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update CHANGELOG.md for PR #6495

* Fix code style issues

* Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Refactor loop to use foreach for selected_items

The foreach loop is much easier to read.

* Refactor data source profile updates and checks

Refactor data source profile handling to use cacti_sizeof for checking profile existence and update multiple database tables for remote connections.

* Refactor SQL query for fetching current step value

Also correct for a syntax error.

* Remove unnecessary blank lines in data_sources.php

* Change comment style from block to single line

Copilot does not know how to generate correct comments.

---------

Co-authored-by: TheWitness <thewitness@cacti.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-13 02:28:54 -05:00
TheWitnessandCopilot fb1d7ea006 Put the Scripts Directory in Scope for Quality Checks (#6584)
* Allow form_selectable_cell to more easily port

* Removing exclusion for scripts directory

* More fixes for scripts

* Some issues with ss_host_disk.php that passed locally

* More issues not detected locally

* Issues with typing in cacti_snmp_walk

* Adding base files for non-savy composer users

* One more try on ss_host_disk.php

* Aparantly I have to add the lock file

* More changes to lib/snmp.php after testing

* More changes to lib/snmp.php after testing

* Fix number script from Copilot review

* More Composer reviews

* Update scripts/ss_apache_stats.php

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update scripts/motorola_surfboard_SB6141.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update scripts/motorola_surfboard_SB6141.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Changing syntax of PHP requirement

* Updating composer

* Attempt to quiet some warnings

* Add Syntax Check

* Wrong file name

* Wrong file name

* Better to report before and after

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-01-30 08:04:27 -05:00