Skip to content

Commit

Permalink
Add metadata-checks to XML-result
Browse files Browse the repository at this point in the history
  • Loading branch information
tvdijen committed Nov 13, 2017
1 parent bfa2039 commit c77658c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions templates/monitor.xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
$store = $this->data['store'];
$state = $this->data['overall'];
$authsources = $this->data['authsources'];
$metadata = $this->data['metadata'];
$health_info = $this->data['health_info'];

$protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');
Expand Down Expand Up @@ -76,6 +77,19 @@
}
}

foreach ($metadata as $entityId => $entity_metadata) {
foreach ($entity_metadata as $check) {
list($health, $category, $subject, $summary) = $check;
list($health_state, $health_color) = $health_info[$health];

$output .= '<check category="' . $category . '">';
$output .= '<subject>' . $subject . '</subject>';
$output .= '<health>' . $health_state . '</health>';
$output .= '<summary>' . $summary . '</summary>';
$output .= '</check>';
}
}

$output .= "</checks>";
$output .= "</monitor>";

Expand Down

0 comments on commit c77658c

Please sign in to comment.