From b5b4d276d1795b39983b71fb881cf4df1846d3c3 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 21 Mar 2014 18:56:55 +0000 Subject: [PATCH] Add more structure to host and service details --- .../scripts/show/components/command.phtml | 2 +- .../scripts/show/components/comments.phtml | 8 +-- .../scripts/show/components/downtime.phtml | 10 ++-- .../views/scripts/show/components/flags.phtml | 2 +- .../views/scripts/show/components/graph.phtml | 49 +++++++++++++++++++ .../application/views/scripts/show/host.phtml | 2 +- .../views/scripts/show/service.phtml | 3 +- public/css/icinga/main-content.less | 6 ++- 8 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 modules/monitoring/application/views/scripts/show/components/graph.phtml diff --git a/modules/monitoring/application/views/scripts/show/components/command.phtml b/modules/monitoring/application/views/scripts/show/components/command.phtml index ec70c50a5..715240679 100644 --- a/modules/monitoring/application/views/scripts/show/components/command.phtml +++ b/modules/monitoring/application/views/scripts/show/components/command.phtml @@ -3,7 +3,7 @@ $parts = explode('!', $object->check_command); $command = array_shift($parts); -?> +?> translate('Command') ?> escape($command) ?> diff --git a/modules/monitoring/application/views/scripts/show/components/comments.phtml b/modules/monitoring/application/views/scripts/show/components/comments.phtml index 454361691..73701c36c 100644 --- a/modules/monitoring/application/views/scripts/show/components/comments.phtml +++ b/modules/monitoring/application/views/scripts/show/components/comments.phtml @@ -29,11 +29,11 @@ foreach ($object->comments as $comment) { ); $list[] = sprintf( - "
%s [%s] %s (%s): %s\n", - $iconForm, + '%s (%s)%s (%s) %s', $this->escape($comment->author), $this->timeSince($comment->timestamp), - $comment->type, + $iconForm, + ucfirst($comment->type), $text ); } @@ -43,6 +43,6 @@ foreach ($object->comments as $comment) { translate('Comments') ?> icon('comment_petrol.png') ?> translate('Add comment') ?> - + diff --git a/modules/monitoring/application/views/scripts/show/components/downtime.phtml b/modules/monitoring/application/views/scripts/show/components/downtime.phtml index bb32f9c32..653d58e21 100644 --- a/modules/monitoring/application/views/scripts/show/components/downtime.phtml +++ b/modules/monitoring/application/views/scripts/show/components/downtime.phtml @@ -32,12 +32,14 @@ foreach ($object->downtimes as $downtime) { $deleteData ); + $text = $this->escape($downtime->comment); + $list[] = sprintf( - "
%s [%s] (%s): %s\n", - $iconForm, + '%s%s %s: %s', $this->escape($downtime->author), + $iconForm, $state, - $this->escape($downtime->comment) + $text ); } @@ -46,6 +48,6 @@ foreach ($object->downtimes as $downtime) { translate('Downtimes') ?> icon('in_downtime_petrol.png') ?> translate('Schedule downtime') ?> - + diff --git a/modules/monitoring/application/views/scripts/show/components/flags.phtml b/modules/monitoring/application/views/scripts/show/components/flags.phtml index 484d938e4..585520328 100644 --- a/modules/monitoring/application/views/scripts/show/components/flags.phtml +++ b/modules/monitoring/application/views/scripts/show/components/flags.phtml @@ -9,7 +9,7 @@ $data = array( ); ?> - + Passive Checks toggleSubmitForm( '', diff --git a/modules/monitoring/application/views/scripts/show/components/graph.phtml b/modules/monitoring/application/views/scripts/show/components/graph.phtml new file mode 100644 index 000000000..0bd98cce8 --- /dev/null +++ b/modules/monitoring/application/views/scripts/show/components/graph.phtml @@ -0,0 +1,49 @@ +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( + '', + $host, + $width, + $height, + time(), + urlencode($target), + $height, + $width +); + diff --git a/modules/monitoring/application/views/scripts/show/host.phtml b/modules/monitoring/application/views/scripts/show/host.phtml index b4a671a34..d21fed261 100644 --- a/modules/monitoring/application/views/scripts/show/host.phtml +++ b/modules/monitoring/application/views/scripts/show/host.phtml @@ -5,7 +5,7 @@
render('show/components/output.phtml') ?> - +
render('show/components/acknowledgement.phtml') ?> render('show/components/comments.phtml') ?> diff --git a/modules/monitoring/application/views/scripts/show/service.phtml b/modules/monitoring/application/views/scripts/show/service.phtml index fdf2fa5b3..49a0f0b0c 100644 --- a/modules/monitoring/application/views/scripts/show/service.phtml +++ b/modules/monitoring/application/views/scripts/show/service.phtml @@ -4,8 +4,9 @@
render('show/components/output.phtml') ?> +render('show/components/graph.phtml') ?> -
+
render('show/components/acknowledgement.phtml') ?> render('show/components/comments.phtml') ?> diff --git a/public/css/icinga/main-content.less b/public/css/icinga/main-content.less index e557df1f6..788cb6c43 100644 --- a/public/css/icinga/main-content.less +++ b/public/css/icinga/main-content.less @@ -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;