Fix remaining spam issues and phpcs merge conflict marker
Spam fixes:
- Add ZFS pool category to hash with subtypes (pool_state, pool_usage,
pool_errors) so DEGRADED and usage-high on same pool get separate tickets
- Strip volatile percentages from LXC/ZFS usage titles ("usage high: 80.1%"
→ "usage high") and OSD counts from BlueStore slow-ops titles
("2 OSD(s) experiencing" → "OSD(s) experiencing") in hwmonDaemon.py
phpcs fix:
- Remove leftover merge conflict marker (<<<<<<< HEAD / >>>>>>>)
in create_ticket_api.php which caused phpcs to fail on bitshift
operator spacing
DB cleanup:
- Deleted 107 spam comments and 107 audit entries from tickets
357934698 (ZFS pool), 673679581 (BlueStore), 925498317 (LXC storage)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+15
-5
@@ -129,6 +129,21 @@ function generateTicketHash($data)
|
||||
|
||||
if (stripos($title, 'SMART issues') !== false) {
|
||||
$issueCategory = 'smart';
|
||||
} elseif (stripos($title, 'ZFS pool') !== false) {
|
||||
$issueCategory = 'zfs';
|
||||
// Extract pool name so each pool gets its own ticket
|
||||
if (preg_match("/ZFS pool '([^']+)'/i", $title, $poolMatch)) {
|
||||
$poolName = strtolower(preg_replace('/[^a-z0-9_]/i', '_', $poolMatch[1]));
|
||||
if (stripos($title, 'state:') !== false || preg_match('/DEGRADED|FAULTED|UNAVAIL|OFFLINE/i', $title)) {
|
||||
$issueSubtype = 'pool_state_' . $poolName;
|
||||
} elseif (stripos($title, 'usage') !== false) {
|
||||
$issueSubtype = 'pool_usage_' . $poolName;
|
||||
} elseif (stripos($title, 'errors') !== false) {
|
||||
$issueSubtype = 'pool_errors_' . $poolName;
|
||||
} else {
|
||||
$issueSubtype = 'pool_' . $poolName;
|
||||
}
|
||||
}
|
||||
} elseif (stripos($title, 'LXC') !== false || stripos($title, 'storage usage') !== false) {
|
||||
$issueCategory = 'storage';
|
||||
// Include the LXC container ID so each container gets its own ticket
|
||||
@@ -228,12 +243,7 @@ if ($existing) {
|
||||
|
||||
if ($existingStatus !== 'Closed') {
|
||||
// Ticket is still active — update title, escalate priority, and refresh
|
||||
<<<<<<< HEAD
|
||||
// the description with the latest sensor data if the new report is more severe
|
||||
// (lower priority number = higher severity).
|
||||
=======
|
||||
// description with latest sensor data.
|
||||
>>>>>>> development
|
||||
$changes = [];
|
||||
$updateSql = "UPDATE tickets SET updated_at = NOW(), updated_by = ?";
|
||||
$bindTypes = "i";
|
||||
|
||||
Reference in New Issue
Block a user