mirror of
https://github.com/Cacti/cacti.git
synced 2026-10-27 07:13:15 +09:00
* 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>
31 lines
542 B
PHP
Executable File
31 lines
542 B
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
|
|
chdir(__DIR__ . '/../../');
|
|
|
|
$files = glob('./resource/*/*.xml');
|
|
|
|
$errors = 0;
|
|
|
|
foreach ($files as $file) {
|
|
libxml_use_internal_errors(true);
|
|
|
|
$xml = simplexml_load_file($file);
|
|
|
|
if ($xml === false) {
|
|
$errors++;
|
|
|
|
print "The Resource XML File: $file has Errors" . PHP_EOL;
|
|
|
|
foreach (libxml_get_errors() as $error) {
|
|
print 'Error: ' . $error->message;
|
|
}
|
|
|
|
libxml_clear_errors(); // Clear the error buffer
|
|
} else {
|
|
print "The Resource XML File: $file is well-formed." . PHP_EOL;
|
|
}
|
|
}
|
|
|
|
exit($errors);
|