Skip to content

Commit c77658c

Browse files
committed
Add metadata-checks to XML-result
1 parent bfa2039 commit c77658c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

templates/monitor.xml.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
$store = $this->data['store'];
88
$state = $this->data['overall'];
99
$authsources = $this->data['authsources'];
10+
$metadata = $this->data['metadata'];
1011
$health_info = $this->data['health_info'];
1112

1213
$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
@@ -76,6 +77,19 @@
7677
}
7778
}
7879

80+
foreach ($metadata as $entityId => $entity_metadata) {
81+
foreach ($entity_metadata as $check) {
82+
list($health, $category, $subject, $summary) = $check;
83+
list($health_state, $health_color) = $health_info[$health];
84+
85+
$output .= '<check category="' . $category . '">';
86+
$output .= '<subject>' . $subject . '</subject>';
87+
$output .= '<health>' . $health_state . '</health>';
88+
$output .= '<summary>' . $summary . '</summary>';
89+
$output .= '</check>';
90+
}
91+
}
92+
7993
$output .= "</checks>";
8094
$output .= "</monitor>";
8195

0 commit comments

Comments
 (0)