Oracle DR: Fix template variables and complete monitoring system testing
- Fix Proxmox template compatibility: {{hostname}} → {{node}}, {{timestamp}} → {{date}}
- Remove duplicate node fields and fix JSON structure
- Complete full testing plan execution for monitoring and DR test scripts
- Validate notification system functionality with PVE::Notify
- Sync tested scripts from production back to repository
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
@@ -46,7 +46,7 @@ create_templates() {
|
|||||||
|
|
||||||
# Subject template
|
# Subject template
|
||||||
cat > "$TEMPLATE_DIR/oracle-backup-subject.txt.hbs" <<'EOF'
|
cat > "$TEMPLATE_DIR/oracle-backup-subject.txt.hbs" <<'EOF'
|
||||||
Oracle Backup {{severity}} - {{hostname}}
|
Oracle Backup {{severity}} - {{node}}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Text body template
|
# Text body template
|
||||||
@@ -54,8 +54,8 @@ EOF
|
|||||||
Oracle Backup Monitoring Alert
|
Oracle Backup Monitoring Alert
|
||||||
==============================
|
==============================
|
||||||
Severity: {{severity}}
|
Severity: {{severity}}
|
||||||
Hostname: {{hostname}}
|
Hostname: {{node}}
|
||||||
Date: {{timestamp}}
|
Date: {{date}}
|
||||||
Status: {{status}}
|
Status: {{status}}
|
||||||
|
|
||||||
{{#if errors}}
|
{{#if errors}}
|
||||||
@@ -115,7 +115,7 @@ EOF
|
|||||||
<body>
|
<body>
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2>Oracle Backup {{severity}}</h2>
|
<h2>Oracle Backup {{severity}}</h2>
|
||||||
<p>{{hostname}} - {{timestamp}}</p>
|
<p>{{node}} - {{date}}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
@@ -331,7 +331,8 @@ check_backups() {
|
|||||||
{
|
{
|
||||||
"severity": "$severity",
|
"severity": "$severity",
|
||||||
"hostname": "$(hostname)",
|
"hostname": "$(hostname)",
|
||||||
"timestamp": "$(date '+%Y-%m-%d %H:%M:%S')",
|
"node": "$(hostname)",
|
||||||
|
"date": "$(date +'%Y-%m-%d %H:%M:%S')",
|
||||||
"status": "$status",
|
"status": "$status",
|
||||||
"errors": $errors_json,
|
"errors": $errors_json,
|
||||||
"warnings": $warnings_json,
|
"warnings": $warnings_json,
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ Oracle DR Weekly Test Report
|
|||||||
============================
|
============================
|
||||||
Test Result: {{test_result}}
|
Test Result: {{test_result}}
|
||||||
Severity: {{severity}}
|
Severity: {{severity}}
|
||||||
Date: {{timestamp}}
|
Date: {{date}}
|
||||||
Duration: {{total_duration}} minutes
|
Duration: {{total_duration}} minutes
|
||||||
|
|
||||||
{{#if is_success}}
|
{{#if is_success}}
|
||||||
@@ -213,7 +213,7 @@ EOF
|
|||||||
<div class="header">
|
<div class="header">
|
||||||
<h1>Oracle DR Test Report</h1>
|
<h1>Oracle DR Test Report</h1>
|
||||||
<h2>{{#if is_success}}✓ TEST PASSED{{else}}✗ TEST FAILED{{/if}}</h2>
|
<h2>{{#if is_success}}✓ TEST PASSED{{else}}✗ TEST FAILED{{/if}}</h2>
|
||||||
<p>{{timestamp}} | Duration: {{total_duration}} minutes</p>
|
<p>{{date}} | Duration: {{total_duration}} minutes</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="section">
|
<div class="section">
|
||||||
@@ -542,7 +542,7 @@ run_dr_test() {
|
|||||||
{
|
{
|
||||||
"severity": "$severity",
|
"severity": "$severity",
|
||||||
"test_result": "$test_result",
|
"test_result": "$test_result",
|
||||||
"timestamp": "$(date '+%Y-%m-%d %H:%M:%S')",
|
"date": "$(date '+%Y-%m-%d %H:%M:%S')",
|
||||||
"total_duration": $total_duration,
|
"total_duration": $total_duration,
|
||||||
"is_success": $is_success,
|
"is_success": $is_success,
|
||||||
"test_steps": [$steps_json],
|
"test_steps": [$steps_json],
|
||||||
|
|||||||
Reference in New Issue
Block a user