Add more structure to host and service details

This commit is contained in:
Thomas Gelf 2014-03-21 18:56:55 +00:00
parent b0c2d9a0ac
commit b5b4d276d1
8 changed files with 69 additions and 13 deletions

View File

@ -3,7 +3,7 @@
$parts = explode('!', $object->check_command);
$command = array_shift($parts);
?><tr>
?><tr class="newsection">
<th><?= $this->translate('Command') ?></th>
<td><?= $this->escape($command) ?>
</tr>

View File

@ -29,11 +29,11 @@ foreach ($object->comments as $comment) {
);
$list[] = sprintf(
"<br />%s [%s] %s (%s): %s\n",
$iconForm,
'<tr><th>%s (%s)</th><td>%s (%s) %s</td></tr>',
$this->escape($comment->author),
$this->timeSince($comment->timestamp),
$comment->type,
$iconForm,
ucfirst($comment->type),
$text
);
}
@ -43,6 +43,6 @@ foreach ($object->comments as $comment) {
<th><?= $this->translate('Comments') ?></th>
<td>
<a href="<?= $this->href('monitoring/command/addComment', $data) ?>"><?= $this->icon('comment_petrol.png') ?> <?= $this->translate('Add comment') ?></a>
<?= implode('', $list) ?>
</td>
</tr>
<?= implode("\n", $list) ?>

View File

@ -32,12 +32,14 @@ foreach ($object->downtimes as $downtime) {
$deleteData
);
$text = $this->escape($downtime->comment);
$list[] = sprintf(
"<br />%s [%s] (%s): %s\n",
$iconForm,
'<tr><th>%s</th><td>%s %s: %s</td></tr>',
$this->escape($downtime->author),
$iconForm,
$state,
$this->escape($downtime->comment)
$text
);
}
@ -46,6 +48,6 @@ foreach ($object->downtimes as $downtime) {
<th><?= $this->translate('Downtimes') ?></th>
<td>
<a href="<?= $this->href('monitoring/command/scheduleDowntime', $data) ?>"><?= $this->icon('in_downtime_petrol.png') ?> <?= $this->translate('Schedule downtime') ?></a>
<?= implode('', $list) ?>
</td>
</tr>
<?= implode("\n", $list) ?>

View File

@ -9,7 +9,7 @@ $data = array(
);
?>
<tr>
<tr class="newsection">
<th>Passive Checks</th>
<td data-base-target="_self"><?= $cf->toggleSubmitForm(
'',

View File

@ -0,0 +1,49 @@
<?php
if (! $object->customvars || ! $object->customvars['GRAPHITEPREFIX']) { return; }
// [GRAPHITEPOSTFIX] => win-mem physical
// [GRAPHITEPREFIX] => monitoring.icinga-private-demo
// Graphitepostfix all-ping
// Graphiteprefix monitoring.icinga-private-demo
/*
monitoring.icinga-private-demo.
c1-dns-1
.all-ping.
rta
*/
$host = 'graphite.demo.netways.de';
$width = 450; // 586
$height = 100; // 308
$objectName = $object->host_name;
if ($object->service_description) {
$objectName .= '.' . $object->service_description;
}
$target = sprintf(
'%s.%s.%s.%s',
$object->customvars['GRAPHITEPREFIX'],
$object->host_name,
$object->customvars['GRAPHITEPOSTFIX'],
'*' // 'rta'
);
// hideAxes=false&hideYAxis=false&hideGrid=false&uniqueLegend=true&hideLegend=true
echo sprintf(
'<img src="http://%s/render/?width=%d&height=%d&_salt=%d&target=%s&lineMode=connected&graphOnly=false&lineWidth=1&from=-36hours&hideLegend=true&hideGrid=true&xFormat=%%25a+%%25H%%3A%%25M" height="%d" width="%d" />',
$host,
$width,
$height,
time(),
urlencode($target),
$height,
$width
);

View File

@ -5,7 +5,7 @@
<div class="content" data-base-target="_next">
<?= $this->render('show/components/output.phtml') ?>
<table class="avp">
<table class="avp newsection">
<tbody>
<?= $this->render('show/components/acknowledgement.phtml') ?>
<?= $this->render('show/components/comments.phtml') ?>

View File

@ -4,8 +4,9 @@
</div>
<div class="content" data-base-target="_next">
<?= $this->render('show/components/output.phtml') ?>
<?= $this->render('show/components/graph.phtml') ?>
<table class="avp">
<table class="avp newsection">
<tbody>
<?= $this->render('show/components/acknowledgement.phtml') ?>
<?= $this->render('show/components/comments.phtml') ?>

View File

@ -58,7 +58,7 @@ a {
}
table.avp {
table-layout: fixed;
table-layout: auto;
width: 100%;
font-size: 0.9em;
}
@ -85,6 +85,10 @@ table.avp > tbody > tr > td {
padding: 0em 0em 0em 0.5em;
}
table.avp.newsection, table.avp tr.newsection {
border-top: 1px solid #555;
}
.content table.avp dd, .content table.avp dd {
margin: 0;
padding: 0;