mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 23:34:08 +02:00
commit
cd41cb2306
@ -1,7 +1,10 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
<!--[if lt IE 7]>
|
||||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
<!--[if IE 7]>
|
||||||
|
<html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||||
|
<!--[if IE 8]>
|
||||||
|
<html class="no-js lt-ie9"> <![endif]-->
|
||||||
<!--[if gt IE 8]><!-->
|
<!--[if gt IE 8]><!-->
|
||||||
<html class="no-js"> <!--<![endif]-->
|
<html class="no-js"> <!--<![endif]-->
|
||||||
<head>
|
<head>
|
||||||
@ -33,7 +36,8 @@
|
|||||||
<!--[if IE 7]>
|
<!--[if IE 7]>
|
||||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/font-awesome-ie7.min.css') ?>">
|
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/font-awesome-ie7.min.css') ?>">
|
||||||
<![endif]-->
|
<![endif]-->
|
||||||
<script data-main="<?php echo $this->baseUrl('js/main.js')?>" src="<?php echo $this->baseUrl('js/vendor/require.js') ?>"></script>
|
<script data-main="<?php echo $this->baseUrl('js/main.js')?>"
|
||||||
|
src="<?php echo $this->baseUrl('js/vendor/require.js') ?>"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body class="cranberry">
|
<body class="cranberry">
|
||||||
|
@ -18,8 +18,11 @@
|
|||||||
<b class="caret"></b>
|
<b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><?= $this->qlink($this->translate('Preferences'), 'preference'); ?></li>
|
<li>
|
||||||
<li><?= $this->qlink($this->translate('Logout'), 'authentication/logout'); ?></li>
|
<a href="<?= $this->href('/preference'); ?>"><?= $this->translate('Preferences'); ?> </a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="<?= $this->href('/authentication/logout'); ?>"><?= $this->translate('Logout'); ?></a>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
// @codingStandardsIgnoreStart
|
// @codingStandardsIgnoreStart
|
||||||
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
/**
|
/**
|
||||||
* Icinga 2 Web - Head for multiple monitoring frontends
|
* This file is part of Icinga 2 Web.
|
||||||
|
*
|
||||||
|
* Icinga 2 Web - Head for multiple monitoring backends.
|
||||||
* Copyright (C) 2013 Icinga Development Team
|
* Copyright (C) 2013 Icinga Development Team
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
@ -21,25 +22,27 @@
|
|||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
*
|
*
|
||||||
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
||||||
|
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||||
* @author Icinga Development Team <info@icinga.org>
|
* @author Icinga Development Team <info@icinga.org>
|
||||||
*/
|
*/
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
// {{{ICINGA_LICENSE_HEADER}}}
|
||||||
|
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
|
|
||||||
class Zend_View_Helper_QUrl extends Zend_View_Helper_Abstract
|
/**
|
||||||
|
* Helper class for creating absolute links from relative strings
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class Zend_View_Helper_Href extends Zend_View_Helper_Abstract
|
||||||
{
|
{
|
||||||
public function qUrl()
|
|
||||||
{
|
|
||||||
$params = func_get_args();
|
|
||||||
$url = array_shift($params);
|
|
||||||
if (isset($params[0])) {
|
|
||||||
$params = $params[0];
|
|
||||||
} else {
|
|
||||||
$params = array();
|
|
||||||
}
|
|
||||||
return Url::fromPath($url, $params);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// @codingStandardsIgnoreStop
|
/**
|
||||||
|
* Turn the relative link $link into absolute one
|
||||||
|
*
|
||||||
|
* @param $link
|
||||||
|
*/
|
||||||
|
public function href($link, array $params = array()) {
|
||||||
|
return Url::fromPath($link, $params)->getAbsoluteUrl();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// @codingStandardsIgnoreEnd
|
@ -1,124 +0,0 @@
|
|||||||
<?php
|
|
||||||
// @codingStandardsIgnoreStart
|
|
||||||
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
|
||||||
/**
|
|
||||||
* Icinga 2 Web - Head for multiple monitoring frontends
|
|
||||||
* Copyright (C) 2013 Icinga Development Team
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*
|
|
||||||
* @copyright 2013 Icinga Development Team <info@icinga.org>
|
|
||||||
* @author Icinga Development Team <info@icinga.org>
|
|
||||||
*/
|
|
||||||
// {{{ICINGA_LICENSE_HEADER}}}
|
|
||||||
|
|
||||||
use Icinga\Web\Url;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class Zend_View_Helper_Qlink
|
|
||||||
* TODO: Search for the best and safest quoting
|
|
||||||
* TODO: Check whether attributes are safe. Script, title in combination with
|
|
||||||
* Hover-Tips etc. Eventually create a whitelist for a few options only.
|
|
||||||
*/
|
|
||||||
class Zend_View_Helper_Qlink extends Zend_View_Helper_Abstract
|
|
||||||
{
|
|
||||||
|
|
||||||
public function qlink($htmlContent, $urlFormat, array $uriParams = array(),
|
|
||||||
array $properties = array())
|
|
||||||
{
|
|
||||||
$quote = true;
|
|
||||||
$attributes = array();
|
|
||||||
$baseUrl = null;
|
|
||||||
foreach ($properties as $key => $val) {
|
|
||||||
if ($key === 'baseUrl' ) {
|
|
||||||
// $baseUrl = filter_var($val, FILTER_SANITIZE_URL) . '/';
|
|
||||||
$baseUrl = $val; //rawurlencode($val) . '/';
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($key === 'quote') {
|
|
||||||
$quote = $val;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($key === 'target') {
|
|
||||||
$attributes[] = 'target="'.$val.'"';
|
|
||||||
}
|
|
||||||
if ($key === 'style' && is_array($val)) {
|
|
||||||
if (empty($val)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$parts = array();
|
|
||||||
foreach ($val as $k => $v) {
|
|
||||||
$parts[] = "$k: $v";
|
|
||||||
}
|
|
||||||
$attributes[] = 'style="' . implode('; ', $parts) . '"';
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
$attributes[] = sprintf(
|
|
||||||
'%s="%s"',
|
|
||||||
//filter_var($key, FILTER_SANITIZE_URL),
|
|
||||||
rawurlencode($key),
|
|
||||||
//filter_var($val, FILTER_SANITIZE_FULL_SPECIAL_CHARS)
|
|
||||||
rawurlencode($val)
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
if ($urlFormat instanceof Url) {
|
|
||||||
$url = $urlFormat;
|
|
||||||
$uriParams = $url->getParams() + $uriParams;
|
|
||||||
} else {
|
|
||||||
$url = Url::fromPath($urlFormat);
|
|
||||||
}
|
|
||||||
$url->setParams($uriParams);
|
|
||||||
if ($baseUrl) {
|
|
||||||
$url->setBaseUrl($baseUrl);
|
|
||||||
}
|
|
||||||
return sprintf(
|
|
||||||
'<a href="%s"%s>%s</a>',
|
|
||||||
// $this->getFormattedUrl($urlFormat, $uriParams, $baseUrl),
|
|
||||||
$url,
|
|
||||||
!empty($attributes) ? ' ' . implode(' ', $attributes) : '',
|
|
||||||
$quote
|
|
||||||
? filter_var(
|
|
||||||
$htmlContent,
|
|
||||||
FILTER_SANITIZE_FULL_SPECIAL_CHARS,
|
|
||||||
FILTER_FLAG_NO_ENCODE_QUOTES
|
|
||||||
)
|
|
||||||
// Alternativ: htmlentities($htmlContent)
|
|
||||||
: $htmlContent
|
|
||||||
);
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
public function getFormattedUrl($urlFormat, $uriParams, $baseUrl = null)
|
|
||||||
{
|
|
||||||
$params = $args = array();
|
|
||||||
foreach ($uriParams as $name => $value) {
|
|
||||||
if (is_int($name)) {
|
|
||||||
$params[] = rawurlencode($value);
|
|
||||||
} else {
|
|
||||||
$args[] = rawurlencode($name) . '=' . rawurlencode($value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$url = $urlFormat;
|
|
||||||
$url = vsprintf($url, $params);
|
|
||||||
if (! empty($args)) {
|
|
||||||
$url .= '?' . implode('&', $args);
|
|
||||||
}
|
|
||||||
return is_null($baseUrl) ? $this->view->baseUrl($url) : $baseUrl.$url;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
// @codingStandardsIgnoreStop
|
|
@ -1,140 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Zend_View_Helper_Container_State {
|
|
||||||
private $CONTROL_BOX_CLASS = "container-controls";
|
|
||||||
private $features = array();
|
|
||||||
private $elementId = "";
|
|
||||||
private $iframeFallback = false;
|
|
||||||
private $url;
|
|
||||||
private $class = "";
|
|
||||||
private $id = "";
|
|
||||||
private $refreshInterval = 0;
|
|
||||||
private $view;
|
|
||||||
public function __construct($containerid,array $flags,$view) {
|
|
||||||
$this->view = $view;
|
|
||||||
$this->id = $containerid;
|
|
||||||
|
|
||||||
foreach ($flags as $type => $value) {
|
|
||||||
if ($type === 'elementId') {
|
|
||||||
$this->elementId = $value;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($type === 'refreshInterval') {
|
|
||||||
$this->refreshInterval = intval($type);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($type == 'detachable' && $value == true) {
|
|
||||||
$this->features["detachable"] = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($type == 'expandable' && $value == true) {
|
|
||||||
$this->features["expandable"] = true;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($type == "icingaUrl") {
|
|
||||||
$this->url = $value;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if ($type == "iframeFallback") {
|
|
||||||
$this->iframeFallback = true;
|
|
||||||
}
|
|
||||||
if ($type == 'class') {
|
|
||||||
$this->class = $value;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
public function beginContent()
|
|
||||||
{
|
|
||||||
ob_start();
|
|
||||||
return $this;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function endContent()
|
|
||||||
{
|
|
||||||
$content = ob_get_contents();
|
|
||||||
ob_end_clean();
|
|
||||||
return $this->buildDOM($content);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function buildDOM($content = "")
|
|
||||||
{
|
|
||||||
$additional = "";
|
|
||||||
if ($this->refreshInterval > 0)
|
|
||||||
$additional .= " container-refresh-interval='{$this->refreshInterval}' ";
|
|
||||||
if ($this->elementId)
|
|
||||||
$additional .= " id='$this->elementId'";
|
|
||||||
$url = "";
|
|
||||||
if ($this->url) {
|
|
||||||
$url = $this->view->baseUrl($this->url);
|
|
||||||
$additional .= "icinga-url='{$url}'";
|
|
||||||
if($this->iframeFallback) {
|
|
||||||
$content = "
|
|
||||||
<noscript><iframe src='$url' style='height:100%;width:100%'></iframe></noscript>
|
|
||||||
";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$controls = $this->getControlDOM();
|
|
||||||
|
|
||||||
$html = "
|
|
||||||
<div class='icinga-container {$this->class}' container-id='{$this->id}' $additional >
|
|
||||||
$controls
|
|
||||||
$content
|
|
||||||
</div>
|
|
||||||
";
|
|
||||||
|
|
||||||
return $html;
|
|
||||||
}
|
|
||||||
|
|
||||||
private function getControlDOM()
|
|
||||||
{
|
|
||||||
if(empty($this->features))
|
|
||||||
return "";
|
|
||||||
$features = "";
|
|
||||||
foreach($this->features as $feature=>$enabled) {
|
|
||||||
if(!$enabled)
|
|
||||||
continue;
|
|
||||||
if($feature == "detachable") {
|
|
||||||
$url = $this->view->baseUrl($this->url ? $this->url : Zend_Controller_Front::getInstance()->getRequest()->getRequestUri());
|
|
||||||
$features .= "
|
|
||||||
<a href='$url' class='container-detach-link' target='_blank' title='detach'><i class='icon-share'></i></a>";
|
|
||||||
}
|
|
||||||
if($feature == "expandable") {
|
|
||||||
$url = $this->url ? $this->url : Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
|
|
||||||
$features .= "
|
|
||||||
<a href='$url' class='container-expand-link' target='_self' title='expand'><i class='icon-fullscreen'></i></a>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return "<div class='{$this->CONTROL_BOX_CLASS}'>$features</div>";
|
|
||||||
}
|
|
||||||
|
|
||||||
public function registerTabs($tabHelper)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __toString() {
|
|
||||||
return $this->endContent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Zend_View_Helper_Container extends Zend_View_Helper_Abstract
|
|
||||||
{
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $id
|
|
||||||
* @param array $flags
|
|
||||||
* @return Zend_View_Helper_Container
|
|
||||||
*/
|
|
||||||
public function container($containerid, $flags = array())
|
|
||||||
{
|
|
||||||
return new Zend_View_Helper_Container_State($containerid,$flags,$this->view);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Zend_View_Helper_DetailTabs extends Zend_View_Helper_Abstract
|
|
||||||
{
|
|
||||||
const URL_PARAMS = "urlParams";
|
|
||||||
const URL_SUFFIX = "urlSuffix";
|
|
||||||
const MODULE = "module";
|
|
||||||
|
|
||||||
|
|
||||||
public function detailTabs($settings,$params = array())
|
|
||||||
{
|
|
||||||
$urlParams = array();
|
|
||||||
$url_suffix = "";
|
|
||||||
$module = "";
|
|
||||||
if(isset($params[self::URL_PARAMS]))
|
|
||||||
$urlParams = $params[self::URL_PARAMS];
|
|
||||||
if(isset($params[self::URL_SUFFIX]))
|
|
||||||
$url_suffix = $params[self::URL_SUFFIX];
|
|
||||||
if(isset($params[self::MODULE]))
|
|
||||||
$module = $params[self::MODULE];
|
|
||||||
|
|
||||||
|
|
||||||
$tabs = array(
|
|
||||||
'host' => $settings->qlink(
|
|
||||||
'Host',
|
|
||||||
$module.'/detail/show',
|
|
||||||
$urlParams + array('active' => 'host')
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($settings->service) {
|
|
||||||
$tabs['service'] = $settings->qlink(
|
|
||||||
'Service',
|
|
||||||
$module.'/detail/show',
|
|
||||||
$urlParams
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$tabs['history'] = $settings->qlink(
|
|
||||||
'History',
|
|
||||||
$module.'/history',
|
|
||||||
$urlParams
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$tabs['hostservices'] = $settings->qlink(
|
|
||||||
'Services',
|
|
||||||
$module.'/hostservices',
|
|
||||||
$urlParams
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
$html = '<ul class="nav nav-tabs">';
|
|
||||||
|
|
||||||
foreach ($tabs as $name => $tab) {
|
|
||||||
$class = $name === $settings->active ? ' class="active"' : '';
|
|
||||||
$html .= "<li $class>$tab</li>";
|
|
||||||
}
|
|
||||||
$html .= "</ul>";
|
|
||||||
|
|
||||||
|
|
||||||
return $html;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
class Zend_View_Helper_Expandable extends Zend_View_Helper_Abstract
|
|
||||||
{
|
|
||||||
private $CONTROL_BOX_CLASS = "expand-controls";
|
|
||||||
|
|
||||||
const ADD_CLASS = "class";
|
|
||||||
const STYLE = "style";
|
|
||||||
const IS_EXPANDED = "isExpanded";
|
|
||||||
|
|
||||||
public function expandable($title, $content = "",$params = array()) {
|
|
||||||
if (empty($title)) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
$class = "";
|
|
||||||
$style = "";
|
|
||||||
$expanded = "collapsed";
|
|
||||||
if(isset($params[self::ADD_CLASS]))
|
|
||||||
$class = $params[self::ADD_CLASS];
|
|
||||||
if(isset($params[self::STYLE]))
|
|
||||||
$style = $params[self::STYLE];
|
|
||||||
if(isset($params[self::IS_EXPANDED]))
|
|
||||||
$expanded = $params[self::IS_EXPANDED] ? "" : "collapsed";
|
|
||||||
if (isset($params['collapsed']) && $params['collapsed'] === false) {
|
|
||||||
$expanded = '';
|
|
||||||
}
|
|
||||||
if(empty($content) || $content === $title) {
|
|
||||||
return "\n<div class='expandable $class' style='$style'>
|
|
||||||
<div class='expand-title'>$title</div>
|
|
||||||
</div>";
|
|
||||||
}
|
|
||||||
$controls = $this->getControlDOM();
|
|
||||||
$skeleton = "
|
|
||||||
<div class='expandable $expanded $class' style='$style'>
|
|
||||||
<div class='expand-title'>$title $controls</div>
|
|
||||||
|
|
||||||
<div class='expand-content'>
|
|
||||||
$content
|
|
||||||
</div>
|
|
||||||
</div>";
|
|
||||||
return $skeleton;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getControlDOM() {
|
|
||||||
|
|
||||||
$features = "
|
|
||||||
<a href='#' class='expand-link' target='_self' title='"._('Click to expand')."'>
|
|
||||||
<i class='icon-chevron-up'></i>
|
|
||||||
</a>
|
|
||||||
<a href='#' class='collapse-link' target='_self' title='"._('Click to collapse')."'>
|
|
||||||
<i class='icon-chevron-down'></i>
|
|
||||||
</a>
|
|
||||||
";
|
|
||||||
|
|
||||||
|
|
||||||
return "<div class='{$this->CONTROL_BOX_CLASS}'>$features</div>";
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,2 +1,2 @@
|
|||||||
<h1>Welcome to Icinga!</h1>
|
<h1>Welcome to Icinga!</h1>
|
||||||
You should install/configure some <?= $this->qlink('modules', 'modules/overview') ?> now!
|
You should install/configure some <a href="<?= $this->href('config/moduleoverview');?>">modules</a> now!
|
||||||
|
@ -235,6 +235,8 @@ class ActionController extends ZfController
|
|||||||
{
|
{
|
||||||
if ($url instanceof Url) {
|
if ($url instanceof Url) {
|
||||||
$url = $url->getRelativeUrl();
|
$url = $url->getRelativeUrl();
|
||||||
|
} else {
|
||||||
|
$url = Url::fromPath($url)->getRelativeUrl();
|
||||||
}
|
}
|
||||||
$this->_helper->Redirector->gotoUrlAndExit($url);
|
$this->_helper->Redirector->gotoUrlAndExit($url);
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
use Icinga\Application\Benchmark;
|
use Icinga\Application\Benchmark;
|
||||||
use Icinga\Application\Icinga;
|
use Icinga\Application\Icinga;
|
||||||
use \Monitoring\Backend;
|
use \Icinga\Module\Monitoring\Backend;
|
||||||
use \Icinga\Application\Config;
|
use \Icinga\Application\Config;
|
||||||
use Icinga\Application\Logger;
|
use Icinga\Application\Logger;
|
||||||
use Icinga\Authentication\Manager;
|
use Icinga\Authentication\Manager;
|
||||||
|
@ -85,7 +85,6 @@ class Monitoring_ShowController extends ModuleActionController
|
|||||||
}
|
}
|
||||||
$this->view->object = $object;
|
$this->view->object = $object;
|
||||||
$this->createTabs();
|
$this->createTabs();
|
||||||
$this->prepareTicketHook();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -302,7 +301,6 @@ class Monitoring_ShowController extends ModuleActionController
|
|||||||
->where('object_type', 'host')
|
->where('object_type', 'host')
|
||||||
->fetchPairs();
|
->fetchPairs();
|
||||||
$this->view->object->prefetch();
|
$this->view->object->prefetch();
|
||||||
$this->prepareTicketHook();
|
|
||||||
$this->prepareGrapherHook();
|
$this->prepareGrapherHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -359,52 +357,6 @@ class Monitoring_ShowController extends ModuleActionController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Ticets actions
|
|
||||||
*/
|
|
||||||
public function ticketAction()
|
|
||||||
{
|
|
||||||
if (Hook::has('ticket')) {
|
|
||||||
// TODO: Still hardcoded, should ask for URL:
|
|
||||||
$id = $this->_getParam('ticket');
|
|
||||||
$ticketModule = 'rt';
|
|
||||||
$this->render();
|
|
||||||
$this->redirect(
|
|
||||||
'ticket',
|
|
||||||
'show',
|
|
||||||
$ticketModule,
|
|
||||||
array(
|
|
||||||
'id' => $id
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function prepareTicketHook()
|
|
||||||
{
|
|
||||||
if (Hook::has('ticket')) {
|
|
||||||
$object = $this->view->object;
|
|
||||||
$params = array(
|
|
||||||
'host' => $object->host_name
|
|
||||||
);
|
|
||||||
if ($object instanceof Service) {
|
|
||||||
$params['service'] = $object->service_description;
|
|
||||||
}
|
|
||||||
|
|
||||||
$params['ticket'] = '__ID__';
|
|
||||||
$this->view->ticket_link = preg_replace(
|
|
||||||
'~__ID__~',
|
|
||||||
'\$1',
|
|
||||||
$this->view->qlink('#__ID__',
|
|
||||||
'monitoring/show/ticket',
|
|
||||||
$params
|
|
||||||
)
|
|
||||||
);
|
|
||||||
// TODO: Global ticket pattern config (or per environment)
|
|
||||||
$this->view->ticket_pattern = '~#(\d{4,6})~';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function prepareGrapherHook()
|
protected function prepareGrapherHook()
|
||||||
{
|
{
|
||||||
if ($grapher = Hook::get('grapher')) {
|
if ($grapher = Hook::get('grapher')) {
|
||||||
@ -482,17 +434,8 @@ class Monitoring_ShowController extends ModuleActionController
|
|||||||
'urlParams' => $params,
|
'urlParams' => $params,
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
if ($this->action_name === 'ticket') {
|
|
||||||
$tabs->add(
|
|
||||||
'ticket',
|
|
||||||
array(
|
|
||||||
'title' => 'Ticket',
|
|
||||||
'icon' => 'img/classic/ticket.gif',
|
|
||||||
'url' => 'monitoring/show/ticket',
|
|
||||||
'urlParams' => $params + array('ticket' => $this->_getParam('ticket')),
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
$tabs->extend(new OutputFormat())
|
$tabs->extend(new OutputFormat())
|
||||||
->extend(new DashboardAction())
|
->extend(new DashboardAction())
|
||||||
|
@ -2,7 +2,9 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<?php foreach($this->commands as $command): ?>
|
<?php foreach($this->commands as $command): ?>
|
||||||
<li>
|
<li>
|
||||||
<?= $this->qlink($command, 'monitoring/command/'. $command); ?>
|
<a href="<?= $this->href('monitoring/command/'. $command); ?>">
|
||||||
|
<?= $this->escape($command); ?>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
@ -16,7 +16,7 @@ function formatDateString($self,$dateString){
|
|||||||
$paginator = $downtimes->paginate();
|
$paginator = $downtimes->paginate();
|
||||||
$downtimes = $downtimes->fetchAll();
|
$downtimes = $downtimes->fetchAll();
|
||||||
?>
|
?>
|
||||||
<form method="get" action="<?= $this->qUrl(
|
<form method="get" action="<?= $this->href(
|
||||||
'monitoring/list/downtimes?',
|
'monitoring/list/downtimes?',
|
||||||
array(
|
array(
|
||||||
'action' => 'downtimes'
|
'action' => 'downtimes'
|
||||||
@ -70,6 +70,7 @@ $downtimes = $downtimes->fetchAll();
|
|||||||
<th> Trigger ID</th>
|
<th> Trigger ID</th>
|
||||||
<th> Duration</th>
|
<th> Duration</th>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<?php foreach ($downtimes as $downtime): ?>
|
<?php foreach ($downtimes as $downtime): ?>
|
||||||
<tr class="<?= $downtime->downtime_is_in_effect == 0 ? 'ok' : 'warning' ?>">
|
<tr class="<?= $downtime->downtime_is_in_effect == 0 ? 'ok' : 'warning' ?>">
|
||||||
<td>
|
<td>
|
||||||
@ -77,12 +78,15 @@ $downtimes = $downtimes->fetchAll();
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="img-box">
|
<div class="img-box">
|
||||||
|
|
||||||
<?php if ($downtime->object_type == 'service'): ?>
|
<?php if ($downtime->object_type == 'service'): ?>
|
||||||
<img title="Service" src="<?='../../img/classic/service.png'?>"/>
|
<img title="Service" src="<?='../../img/classic/service.png'?>"/>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($downtime->object_type == 'host'): ?>
|
<?php if ($downtime->object_type == 'host'): ?>
|
||||||
<img title="Host" src="<?='../../img/classic/server.png'?>"/>
|
<img title="Host" src="<?='../../img/classic/server.png'?>"/>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@ -126,32 +130,6 @@ $downtimes = $downtimes->fetchAll();
|
|||||||
<?= $this->util()->showHourMin(intval($downtime->downtime_duration)); ?>
|
<?= $this->util()->showHourMin(intval($downtime->downtime_duration)); ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php
|
|
||||||
if (empty($downtime->service_description)) {
|
|
||||||
echo $this->qlink(
|
|
||||||
'',
|
|
||||||
'monitoring/show/host',
|
|
||||||
array(
|
|
||||||
'host' => $downtime->host_name
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'class' => 'row-action'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
echo $this->qlink(
|
|
||||||
'',
|
|
||||||
'monitoring/show/service',
|
|
||||||
array(
|
|
||||||
'host' => $downtime->host_name,
|
|
||||||
'service' => $downtime->service_description
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'class' => 'row-action'
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
@ -7,7 +7,6 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
|
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
|
||||||
|
|
||||||
<table class="statustable action hosts">
|
<table class="statustable action hosts">
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="3">Status</th>
|
<th colspan="3">Status</th>
|
||||||
@ -24,53 +23,61 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
<?php if ($host->host_icon_image) : ?>
|
<?php if ($host->host_icon_image) : ?>
|
||||||
<img src="<?= $host->host_icon_image; ?>"/>
|
<img src="<?= $host->host_icon_image; ?>"/>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
<?php $trimArea->end(); ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||||
|
|
||||||
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
||||||
<a href="#" title="<?= 'Unhandled host' ?>">
|
<a href="#" title="<?= 'Unhandled host' ?>">
|
||||||
<i class="icon-warning-sign"></i>
|
<i class="icon-warning-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||||
<i class="icon-ok-sign"></i>
|
<i class="icon-ok-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($host->host_is_flapping): ?>
|
<?php if ($host->host_is_flapping): ?>
|
||||||
<a href="#" title="<?= 'Flapping' ?>">
|
<a href="#" title="<?= 'Flapping' ?>">
|
||||||
<i class="icon-random"></i>
|
<i class="icon-random"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (!$host->host_notifications_enabled): ?>
|
<?php if (!$host->host_notifications_enabled): ?>
|
||||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||||
<i class="icon-volume-off"></i>
|
<i class="icon-volume-off"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($host->host_in_downtime): ?>
|
<?php if ($host->host_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'In downtime' ?>">
|
<a href="#" title="<?= 'In downtime' ?>">
|
||||||
<i class="icon-wrench"></i>
|
<i class="icon-wrench"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
|
||||||
|
<?php $trimArea->end(); ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
||||||
<div class="statetext">
|
<div class="statetext">
|
||||||
<?= $this->qlink(
|
<a href="<?= $this->href('monitoring/show/history', array('host' => $host->host_name)); ?>">
|
||||||
"<b>".ucfirst($viewHelper->monitoringState($host, 'host')).'</b>'.
|
<b> <?= ucfirst($viewHelper->monitoringState($host, 'host')); ?> </b>
|
||||||
'<div class="nowrap"> since '.
|
|
||||||
$this->timeSince($host->host_last_state_change),
|
<div class="nowrap"> since
|
||||||
'monitoring/show/history', array(
|
<?= $this->timeSince($host->host_last_state_change); ?>
|
||||||
'host' => $host->host_name
|
|
||||||
),
|
|
||||||
array('quote' => false)
|
|
||||||
);?>
|
|
||||||
<?php if ($host->host_state_type == 0): ?>
|
<?php if ($host->host_state_type == 0): ?>
|
||||||
<a href="#" title="<?= 'Soft state' ?>">
|
<a href="#" title="<?= 'Soft state' ?>">
|
||||||
<i class="icon-gears"></i>
|
<i class="icon-gears"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
@ -80,17 +87,12 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
<i class="icon-comment"> </i>
|
<i class="icon-comment"> </i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?= $this->qlink(
|
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>"
|
||||||
'<b>'.$host->host_name.'</b><br/>'.
|
class="row-action">
|
||||||
'<i>'.$host->host_address.'</i>',
|
<b><?= $host->host_name; ?></b>
|
||||||
'monitoring/show/host', array(
|
<br/>
|
||||||
'host' => $host->host_name
|
<i><?= $host->host_address; ?></i>
|
||||||
), array(
|
</a>
|
||||||
'class' => 'row-action',
|
|
||||||
'quote' => false
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php if ($host->host_action_url != ''): ?>
|
<?php if ($host->host_action_url != ''): ?>
|
||||||
<a href="<?= $host->host_action_url; ?>">Action</a>
|
<a href="<?= $host->host_action_url; ?>">Action</a>
|
||||||
|
@ -5,11 +5,7 @@ $hosts = $this->hosts->paginate();
|
|||||||
$viewHelper = $this->getHelper('MonitoringState');
|
$viewHelper = $this->getHelper('MonitoringState');
|
||||||
$trimArea = $this->getHelper('Trim');
|
$trimArea = $this->getHelper('Trim');
|
||||||
?>
|
?>
|
||||||
<form method="get" action="<?= $this->qUrl(
|
<form method="get" action="<?= $this->href('monitoring/list/hosts', $this->hosts->getAppliedFilter()->toParams());?>">
|
||||||
'monitoring/list/hosts?' . http_build_query($this->hosts->getAppliedFilter()->toParams()),
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
?>">
|
|
||||||
Sort by <?= $this->formSelect(
|
Sort by <?= $this->formSelect(
|
||||||
'sort',
|
'sort',
|
||||||
$this->sort,
|
$this->sort,
|
||||||
@ -19,7 +15,7 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
'host_last_state_change' => 'Last state change',
|
'host_last_state_change' => 'Last state change',
|
||||||
'host_name' => 'Host',
|
'host_name' => 'Host',
|
||||||
)
|
)
|
||||||
) ?>
|
); ?>
|
||||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||||
</form>
|
</form>
|
||||||
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
|
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
|
||||||
@ -35,80 +31,87 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<?php foreach($hosts as $host): ?>
|
<?php foreach($hosts as $host): ?>
|
||||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>">
|
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>">
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="img-box"><?php $trimArea->start(); ?>
|
<div class="img-box">
|
||||||
|
<?php $trimArea->start(); ?>
|
||||||
|
|
||||||
<?php if ($host->host_icon_image) : ?>
|
<?php if ($host->host_icon_image) : ?>
|
||||||
<img src="<?= $host->host_icon_image; ?>"/>
|
<img src="<?= $host->host_icon_image; ?>"/>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
|
||||||
|
<?php $trimArea->end(); ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
<div class="icon-box">
|
||||||
|
<?php $trimArea->start(); ?>
|
||||||
|
|
||||||
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
||||||
<a href="#" title="<?= 'Unhandled host' ?>">
|
<a href="#" title="<?= 'Unhandled host' ?>">
|
||||||
<i class="icon-warning-sign"></i>
|
<i class="icon-warning-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||||
<i class="icon-ok-sign"></i>
|
<i class="icon-ok-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($host->host_is_flapping): ?>
|
<?php if ($host->host_is_flapping): ?>
|
||||||
<a href="#" title="<?= 'Flapping' ?>">
|
<a href="#" title="<?= 'Flapping' ?>">
|
||||||
<i class="icon-random"></i>
|
<i class="icon-random"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (!$host->host_notifications_enabled): ?>
|
<?php if (!$host->host_notifications_enabled): ?>
|
||||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||||
<i class="icon-volume-off"></i>
|
<i class="icon-volume-off"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($host->host_in_downtime): ?>
|
<?php if ($host->host_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'In downtime' ?>">
|
<a href="#" title="<?= 'In downtime' ?>">
|
||||||
<i class="icon-wrench"></i>
|
<i class="icon-wrench"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
<?php $trimArea->end(); ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
||||||
<div class="statetext">
|
<div class="statetext">
|
||||||
<?= $this->qlink(
|
<b><?= ucfirst($viewHelper->monitoringState($host, 'host')); ?></b>
|
||||||
"<b>".ucfirst($viewHelper->monitoringState($host, 'host'))."</b>".
|
|
||||||
'<div class="nowrap"> since '.
|
<div class="nowrap"> since
|
||||||
$this->timeSince($host->host_last_state_change),
|
<?= $this->timeSince($host->host_last_state_change); ?>
|
||||||
'monitoring/show/history', array(
|
|
||||||
'host' => $host->host_name
|
|
||||||
),
|
|
||||||
array('quote' => false)
|
|
||||||
);?>
|
|
||||||
<?php if ($host->host_state_type == 0): ?>
|
<?php if ($host->host_state_type == 0): ?>
|
||||||
<a href="#" title="<?= 'Soft state' ?>">
|
<a href="#" title="<?= 'Soft state' ?>">
|
||||||
<i class="icon-gears"></i>
|
<i class="icon-gears"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="hostname">
|
<td class="hostname">
|
||||||
|
|
||||||
<?php if ($host->host_last_comment !== null): ?>
|
<?php if ($host->host_last_comment !== null): ?>
|
||||||
<a href="#" title="<?= 'Comments' ?>">
|
<a href="#" title="<?= 'Comments' ?>">
|
||||||
<i class="icon-comment"> </i>
|
<i class="icon-comment"> </i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?= $this->qlink(
|
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>" class="row-action">
|
||||||
"<b>".$host->host_name."</b><br/>".
|
<b> <?= $host->host_name ?></b><br/>
|
||||||
"<i>".$host->host_address."</i>",
|
<i> <?= $host->host_address ?></i>
|
||||||
'monitoring/show/host', array(
|
</a>
|
||||||
'host' => $host->host_name
|
|
||||||
), array(
|
|
||||||
'class' => 'row-action',
|
|
||||||
'quote' => false
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
|
|
||||||
|
|
||||||
<?php if ($host->host_action_url != ""): ?>
|
<?php if ($host->host_action_url != ""): ?>
|
||||||
<a href="<?= $host->host_action_url; ?>">Action</a>
|
<a href="<?= $host->host_action_url; ?>">Action</a>
|
||||||
@ -117,6 +120,7 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
<?php if ($host->host_notes_url != ""): ?>
|
<?php if ($host->host_notes_url != ""): ?>
|
||||||
<a href="<?= $host->host_notes_url; ?>">Notes</a>
|
<a href="<?= $host->host_notes_url; ?>">Notes</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td class="expand-full">
|
<td class="expand-full">
|
||||||
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
|
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
|
||||||
|
@ -7,12 +7,13 @@ $formatter = $this->getHelper('MonitoringProperties');
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<form method="get" action="<?=
|
<form method="get" action="<?=
|
||||||
Url::fromPath(
|
$this->href(
|
||||||
'monitoring/list/notifications',
|
'monitoring/list/notifications',
|
||||||
$this->notifications->getAppliedFilter()->toParams()
|
$this->notifications->getAppliedFilter()->toParams()
|
||||||
)->getAbsoluteUrl();
|
);
|
||||||
?>">
|
?>">
|
||||||
Sort by <?= $this->formSelect(
|
Sort by <?=
|
||||||
|
$this->formSelect(
|
||||||
'sort',
|
'sort',
|
||||||
$this->sort,
|
$this->sort,
|
||||||
array(
|
array(
|
||||||
@ -66,25 +67,6 @@ echo $this->paginationControl($notifications, null, null, array('preserve' => $t
|
|||||||
<td>
|
<td>
|
||||||
<?= $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?>
|
<?= $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
|
||||||
<?php if (intval($notification->notification_type) === 0): ?>
|
|
||||||
<a href="<?=
|
|
||||||
Url::fromPath(
|
|
||||||
'monitoring/show/host',
|
|
||||||
array('host' => $notification->host_name)
|
|
||||||
)->getAbsoluteUrl();
|
|
||||||
?>" class="row-action"> </a>
|
|
||||||
|
|
||||||
<?php else: ?>
|
|
||||||
<a href="<?=
|
|
||||||
Url::fromPath('monitoring/show/service',
|
|
||||||
array(
|
|
||||||
'host' => $notification->host_name,
|
|
||||||
'service' => $notification->service_description
|
|
||||||
)
|
|
||||||
)->getAbsoluteUrl(); ?>" class="row-action"></a>
|
|
||||||
<?php endif; ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -1,171 +0,0 @@
|
|||||||
<?= $this->tabs ?>
|
|
||||||
<?php
|
|
||||||
|
|
||||||
$paginator = $services->paginate();
|
|
||||||
|
|
||||||
function getRowProperties(&$service, &$last_host, $scope) {
|
|
||||||
if ($last_host !== $service->host_name) {
|
|
||||||
$host_col = '<b>' . $scope->qlink(
|
|
||||||
$service->host_name,
|
|
||||||
'monitoring/show/host',
|
|
||||||
array('host' => $service->host_name)
|
|
||||||
) . ':</b><span style="font-size: 0.7em">'
|
|
||||||
. (isset($service->host->address) ? ' ( ' . $scope->escape($service->host->address) . ')' : '')
|
|
||||||
. '</span>';
|
|
||||||
$last_host = $service->host_name;
|
|
||||||
} else {
|
|
||||||
$host_col = ' ';
|
|
||||||
}
|
|
||||||
$icons = array();
|
|
||||||
if ($service->service_acknowledged) {
|
|
||||||
$icons['ack.gif'] = 'Problem has been acknowledged';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($service->service_in_downtime) {
|
|
||||||
$icons['downtime.gif'] = 'Service is in a scheduled downtime';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($service->host_problems) {
|
|
||||||
$icons['server.png'] = 'This services host has a problem';
|
|
||||||
}
|
|
||||||
|
|
||||||
$state_classes = array($scope->monitoringState($service));
|
|
||||||
|
|
||||||
if ($service->service_handled) {
|
|
||||||
$state_classes[] = 'handled';
|
|
||||||
}
|
|
||||||
if ($service->service_last_state_change > (time() - 600)) {
|
|
||||||
$state_classes[] = 'new';
|
|
||||||
}
|
|
||||||
$state_title = strtoupper($scope->monitoringState($service))
|
|
||||||
. ' since '
|
|
||||||
. date('Y-m-d H:i:s', $service->service_last_state_change);
|
|
||||||
if ($scope->grapher && $scope->grapher->hasGraph($service->host_name, $service->service_description)) {
|
|
||||||
$graph = $scope->grapher->getSmallPreviewImage(
|
|
||||||
$service->host_name,
|
|
||||||
$service->service_description
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
$graph = '';
|
|
||||||
}
|
|
||||||
return array($host_col,$icons,$state_classes,$state_title,$graph);
|
|
||||||
}
|
|
||||||
|
|
||||||
$fparams = $this->services->getAppliedFilter()->toParams();
|
|
||||||
if ($this->preserve === null) {
|
|
||||||
$this->preserve = $fparams;
|
|
||||||
} else {
|
|
||||||
$this->preserve += $fparams;
|
|
||||||
}
|
|
||||||
$last_host = null;
|
|
||||||
$always = array();
|
|
||||||
if (isset($_GET['sort'])) {
|
|
||||||
$always['sort'] = $_GET['sort'];
|
|
||||||
}
|
|
||||||
if (isset($_GET['dir'])) {
|
|
||||||
$always['dir'] = $_GET['dir'];
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<div class="dontprint">
|
|
||||||
<? if (! empty($fparams)): ?>
|
|
||||||
<div style="float: right; width: 20em; font-size: 0.8em;"><b>Filters</b><br>
|
|
||||||
<? foreach ($fparams as $k => $v): ?>
|
|
||||||
<?= $this->qlink(
|
|
||||||
'x',
|
|
||||||
'monitoring/list/services',
|
|
||||||
$this->services->getAppliedFilter()->without($k)->toParams() + $always,
|
|
||||||
array(
|
|
||||||
'style' => array('color' => 'red')
|
|
||||||
)
|
|
||||||
) ?> <?= $this->escape("$k = $v") ?></br>
|
|
||||||
<? endforeach ?>
|
|
||||||
</div>
|
|
||||||
<? endif ?>
|
|
||||||
<form method="get" action="<?= $this->qUrl(
|
|
||||||
'monitoring/list/services?' . http_build_query(
|
|
||||||
$this->services->getAppliedFilter()->toParams()
|
|
||||||
),
|
|
||||||
array()
|
|
||||||
)
|
|
||||||
?>">
|
|
||||||
Sort by <?= $this->formSelect(
|
|
||||||
'sort',
|
|
||||||
$this->sort,
|
|
||||||
array(
|
|
||||||
'class' => 'autosubmit',
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'severity' => 'Severity',
|
|
||||||
'service_last_state_change' => 'Last state change',
|
|
||||||
'service_last_time_unknown' => 'Last UNKNOWN',
|
|
||||||
'service_last_time_critical' => 'Last CRITICAL',
|
|
||||||
'service_last_time_warning' => 'Last WARNING',
|
|
||||||
'service_last_time_ok' => 'Last OK',
|
|
||||||
'host_name' => 'Host',
|
|
||||||
'service_description' => 'Service',
|
|
||||||
)
|
|
||||||
) ?>
|
|
||||||
<?= $this->formText(
|
|
||||||
'search',
|
|
||||||
$this->search,
|
|
||||||
array(
|
|
||||||
'placeholder' => 'Add filllter...',
|
|
||||||
)
|
|
||||||
) ?>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<?php if (empty($services)): ?>
|
|
||||||
|
|
||||||
<div class="alert alert-info fullpage_infobox">
|
|
||||||
Sorry, no services found for this search
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<?php return; endif ?>
|
|
||||||
<?= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve )); ?>
|
|
||||||
<table class="action">
|
|
||||||
<tbody>
|
|
||||||
<?php foreach ($services->fetchAll() as $service):
|
|
||||||
list($host_col,$icons,$state_classes,$state_title,$graph) = getRowProperties($service,$last_host,$this); ?>
|
|
||||||
<tr class="<?= implode(' ', $state_classes) ?>">
|
|
||||||
<td class="state" title="<?= $state_title ?>">
|
|
||||||
<?= $this->qlink(
|
|
||||||
|
|
||||||
$service->service_state == 99 ? 'PENDING' :
|
|
||||||
substr(strtoupper($this->monitoringState($service)), 0, 4)
|
|
||||||
. ' since<br /> '
|
|
||||||
. $this->timeSince($service->service_last_state_change),
|
|
||||||
'monitoring/show/history', array(
|
|
||||||
'host' => $service->host_name,
|
|
||||||
'service' => $service->service_description
|
|
||||||
), array('quote' => false)) ?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>
|
|
||||||
<?php
|
|
||||||
foreach ($icons as $icon => $alt) {
|
|
||||||
echo $this->img('img/classic/' . $icon, array(
|
|
||||||
'class' => 'icon',
|
|
||||||
'title' => $alt
|
|
||||||
));
|
|
||||||
} ?>
|
|
||||||
<?= $host_col ?>
|
|
||||||
<?= $this->qlink($service->service_description, 'monitoring/show/service', array(
|
|
||||||
'host' => $service->host_name,
|
|
||||||
'service' => $service->service_description
|
|
||||||
), array('class' => 'row-action')
|
|
||||||
)
|
|
||||||
?>
|
|
||||||
|
|
||||||
<br />
|
|
||||||
<span style="font-size: 0.7em">
|
|
||||||
<?= $this->escape(substr(strip_tags($service->service_output), 0, 900)) ?>
|
|
||||||
</span>
|
|
||||||
<?= $graph ?>
|
|
||||||
</td>
|
|
||||||
<? foreach ($this->extraColumns as $col): ?>
|
|
||||||
<td><?= $this->escape($service->$col) ?></td>
|
|
||||||
<? endforeach ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$paginator = $services->paginate();
|
$paginator = $services->paginate();
|
||||||
|
|
||||||
$viewHelper = $this->getHelper('MonitoringState');
|
$viewHelper = $this->getHelper('MonitoringState');
|
||||||
$trimArea = $this->getHelper('Trim');
|
$trimArea = $this->getHelper('Trim');
|
||||||
?>
|
?>
|
||||||
@ -24,94 +23,86 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<?php foreach ($services->fetchAll() as $service): ?>
|
<?php foreach ($services->fetchAll() as $service): ?>
|
||||||
|
|
||||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="img-box"><?php $trimArea->start(); ?>
|
<div class="img-box"><?php $trimArea->start(); ?>
|
||||||
|
|
||||||
<?php if ($service->service_icon_image) : ?>
|
<?php if ($service->service_icon_image) : ?>
|
||||||
<img src="<?= $service->service_icon_image; ?>"/>
|
<img src="<?= $service->service_icon_image; ?>"/>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
|
||||||
|
<?php $trimArea->end(); ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||||
|
|
||||||
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
||||||
<a href="#" title="<?= 'Unhandled service' ?>">
|
<a href="#" title="<?= 'Unhandled service' ?>">
|
||||||
<i class="icon-warning-sign"></i>
|
<i class="icon-warning-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||||
<i class="icon-ok-sign"></i>
|
<i class="icon-ok-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_is_flapping): ?>
|
<?php if ($service->service_is_flapping): ?>
|
||||||
<a href="#" title="<?= 'Flapping' ?>">
|
<a href="#" title="<?= 'Flapping' ?>">
|
||||||
<i class="icon-random"></i>
|
<i class="icon-random"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (!$service->service_notifications_enabled): ?>
|
<?php if (!$service->service_notifications_enabled): ?>
|
||||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||||
<i class="icon-volume-off"></i>
|
<i class="icon-volume-off"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_in_downtime): ?>
|
<?php if ($service->service_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'In downtime' ?>">
|
<a href="#" title="<?= 'In downtime' ?>">
|
||||||
<i class="icon-wrench"></i>
|
<i class="icon-wrench"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
|
||||||
|
<?php $trimArea->end(); ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
||||||
<div class="statetext">
|
<div class="statetext">
|
||||||
<?= $this->qlink(
|
<?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
|
||||||
"<b>".ucfirst($viewHelper->monitoringState($service, 'service'))."</b>".
|
<div class="nowrap"> since '
|
||||||
'<div class="nowrap"> since '.
|
<?= $this->timeSince($service->service_last_state_change); ?>
|
||||||
$this->timeSince($service->service_last_state_change),
|
|
||||||
'monitoring/show/history', array(
|
|
||||||
'host' => $service->host_name,
|
|
||||||
'service' => $service->service_description
|
|
||||||
),
|
|
||||||
array('quote' => false)
|
|
||||||
);?>
|
|
||||||
<?php if ($service->service_state_type == 0): ?>
|
<?php if ($service->service_state_type == 0): ?>
|
||||||
<a href="#" title="<?= 'Soft state' ?>">
|
<a href="#" title="<?= 'Soft state' ?>">
|
||||||
<i class="icon-gears"></i>
|
<i class="icon-gears"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="servicename">
|
<td class="servicename">
|
||||||
|
|
||||||
<?php if ($service->service_last_comment !== null): ?>
|
<?php if ($service->service_last_comment !== null): ?>
|
||||||
<a href="#" title="<?= 'Comments' ?>">
|
<a href="#" title="<?= 'Comments' ?>">
|
||||||
<i class="icon-comment"> </i>
|
<i class="icon-comment"> </i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?= $this->qlink(
|
|
||||||
"<b>".$service->service_display_name."</b><br/>",
|
|
||||||
'monitoring/show/service', array(
|
<b> <?= $service->service_display_name; ?></b>
|
||||||
'host' => $service->host_name,
|
<br/>
|
||||||
'service' => $service->service_description
|
<?= $service->host_name; ?>
|
||||||
), array(
|
|
||||||
'class' => 'row-action',
|
|
||||||
'quote' => false
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
<?= $this->qlink(
|
|
||||||
$service->host_name,
|
|
||||||
'monitoring/show/host', array(
|
|
||||||
'host' => $service->host_name
|
|
||||||
), array(
|
|
||||||
'class' => 'row-action',
|
|
||||||
'quote' => false
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
|
|
||||||
<?php if ($service->service_action_url != ""): ?>
|
<?php if ($service->service_action_url != ""): ?>
|
||||||
<a href="<?= $service->service_action_url; ?>">Action</a>
|
<a href="<?= $service->service_action_url; ?>">Action</a>
|
||||||
@ -120,17 +111,19 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
<?php if ($service->service_notes_url != ""): ?>
|
<?php if ($service->service_notes_url != ""): ?>
|
||||||
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_state_type == 0): ?>
|
<?php if ($service->service_state_type == 0): ?>
|
||||||
<a href="#" title="<?= 'Soft state' ?>">
|
<a href="#" title="<?= 'Soft state' ?>">
|
||||||
<i class="icon-gears"></i>
|
<i class="icon-gears"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</td>
|
|
||||||
|
|
||||||
|
</td>
|
||||||
|
|
||||||
<td class="expand-full">
|
<td class="expand-full">
|
||||||
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
|
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -14,11 +14,7 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
<?php return; endif ?>
|
<?php return; endif ?>
|
||||||
|
|
||||||
|
|
||||||
<form method="get" action="<?= $this->qUrl(
|
<form method="get" action="<?= $this->href('monitoring/list/services', $this->services->getAppliedFilter()->toParams()); ?>">
|
||||||
'monitoring/list/services?' . http_build_query($this->services->getAppliedFilter()->toParams()),
|
|
||||||
array()
|
|
||||||
);
|
|
||||||
?>">
|
|
||||||
Sort by <?= $this->formSelect(
|
Sort by <?= $this->formSelect(
|
||||||
'sort',
|
'sort',
|
||||||
$this->sort,
|
$this->sort,
|
||||||
@ -49,86 +45,82 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<?php foreach ($services->fetchAll() as $service): ?>
|
<?php foreach ($services->fetchAll() as $service): ?>
|
||||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="img-box"><?php $trimArea->start(); ?>
|
<div class="img-box"><?php $trimArea->start(); ?>
|
||||||
|
|
||||||
<?php if ($service->service_icon_image) : ?>
|
<?php if ($service->service_icon_image) : ?>
|
||||||
<img src="<?= $service->service_icon_image; ?>"/>
|
<img src="<?= $service->service_icon_image; ?>"/>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
|
||||||
|
<?php $trimArea->end(); ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="icons indicator">
|
<td class="icons indicator">
|
||||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||||
|
|
||||||
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
||||||
<a href="#" title="<?= 'Unhandled service' ?>">
|
<a href="#" title="<?= 'Unhandled service' ?>">
|
||||||
<i class="icon-warning-sign"></i>
|
<i class="icon-warning-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||||
<i class="icon-ok-sign"></i>
|
<i class="icon-ok-sign"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_is_flapping): ?>
|
<?php if ($service->service_is_flapping): ?>
|
||||||
<a href="#" title="<?= 'Flapping' ?>">
|
<a href="#" title="<?= 'Flapping' ?>">
|
||||||
<i class="icon-random"></i>
|
<i class="icon-random"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (!$service->service_notifications_enabled): ?>
|
<?php if (!$service->service_notifications_enabled): ?>
|
||||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||||
<i class="icon-volume-off"></i>
|
<i class="icon-volume-off"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_in_downtime): ?>
|
<?php if ($service->service_in_downtime): ?>
|
||||||
<a href="#" title="<?= 'In downtime' ?>">
|
<a href="#" title="<?= 'In downtime' ?>">
|
||||||
<i class="icon-wrench"></i>
|
<i class="icon-wrench"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $trimArea->end(); ?></div>
|
|
||||||
|
<?php $trimArea->end(); ?>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
||||||
<div class="statetext">
|
<div class="statetext">
|
||||||
<?= $this->qlink(
|
<b><?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
|
||||||
"<b>".ucfirst($viewHelper->monitoringState($service, 'service'))."</b>".
|
<div class="nowrap"> since
|
||||||
'<div class="nowrap"> since '.
|
<?= $this->timeSince($service->service_last_state_change); ?>
|
||||||
$this->timeSince($service->service_last_state_change),
|
|
||||||
'monitoring/show/history', array(
|
|
||||||
'host' => $service->host_name,
|
|
||||||
'service' => $service->service_description
|
|
||||||
),
|
|
||||||
array('quote' => false)
|
|
||||||
);?>
|
|
||||||
<?php if ($service->service_state_type == 0): ?>
|
<?php if ($service->service_state_type == 0): ?>
|
||||||
<a href="#" title="<?= 'Soft state' ?>">
|
<a href="#" title="<?= 'Soft state' ?>">
|
||||||
<i class="icon-gears"></i>
|
<i class="icon-gears"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<td class="servicename">
|
<td class="servicename">
|
||||||
<?php if ($service->service_last_comment !== null): ?>
|
<?php if ($service->service_last_comment !== null): ?>
|
||||||
<a href="#" title="<?= 'Comments' ?>">
|
<a href="#" title="<?= 'Comments' ?>">
|
||||||
<i class="icon-comment"> </i>
|
<i class="icon-comment"> </i>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?= $this->qlink(
|
|
||||||
"<b>".$service->service_display_name."</b><br/>",
|
|
||||||
'monitoring/show/service', array(
|
|
||||||
'host' => $service->host_name,
|
|
||||||
'service' => $service->service_description
|
|
||||||
), array(
|
|
||||||
'class' => 'row-action',
|
|
||||||
'quote' => false
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
|
|
||||||
|
<b> <?= $service->service_display_name; ?></b>
|
||||||
|
<br/>
|
||||||
|
|
||||||
<?php if ($service->service_action_url != ""): ?>
|
<?php if ($service->service_action_url != ""): ?>
|
||||||
<a href="<?= $service->service_action_url; ?>">Action</a>
|
<a href="<?= $service->service_action_url; ?>">Action</a>
|
||||||
@ -137,6 +129,7 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
<?php if ($service->service_notes_url != ""): ?>
|
<?php if ($service->service_notes_url != ""): ?>
|
||||||
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($service->service_state_type == 0): ?>
|
<?php if ($service->service_state_type == 0): ?>
|
||||||
<a href="#" title="<?= 'Soft state' ?>">
|
<a href="#" title="<?= 'Soft state' ?>">
|
||||||
<i class="icon-gears"></i>
|
<i class="icon-gears"></i>
|
||||||
@ -145,25 +138,10 @@ $trimArea = $this->getHelper('Trim');
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="hostname" title="<?= $viewHelper->getStateTitle($service, 'host'); ?>">
|
<td class="hostname" title="<?= $viewHelper->getStateTitle($service, 'host'); ?>">
|
||||||
<?= $this->qlink(
|
<?= $service->host_name; ?>
|
||||||
$service->host_name,
|
|
||||||
'monitoring/show/host', array(
|
|
||||||
'host' => $service->host_name
|
|
||||||
), array(
|
|
||||||
'class' => 'row-action',
|
|
||||||
'quote' => false
|
|
||||||
)
|
|
||||||
); ?>
|
|
||||||
|
|
||||||
<div class="statetext">
|
<div class="statetext">
|
||||||
<?= $this->qlink(
|
(<?= ucfirst($viewHelper->monitoringState($service, 'host')); ?>)
|
||||||
"(".ucfirst($viewHelper->monitoringState($service, 'host')).")",
|
|
||||||
'monitoring/show/history', array(
|
|
||||||
'host' => $service->host_name,
|
|
||||||
'service' => $service->service_description
|
|
||||||
),
|
|
||||||
array('quote' => false)
|
|
||||||
);?>
|
|
||||||
</div>
|
</div>
|
||||||
<span class="host_address">
|
<span class="host_address">
|
||||||
<?= $service->host_address ?>
|
<?= $service->host_address ?>
|
||||||
|
@ -2,15 +2,15 @@
|
|||||||
if (!empty($this->contacts)) {
|
if (!empty($this->contacts)) {
|
||||||
$contactList = array();
|
$contactList = array();
|
||||||
foreach ($this->contacts as $contact) {
|
foreach ($this->contacts as $contact) {
|
||||||
$contactList[] = $this->qlink(
|
$contactList[] = '<a href="' . $this->href(
|
||||||
$contact->contact_alias,
|
|
||||||
'monitoring/show/contact',
|
'monitoring/show/contact',
|
||||||
array(
|
array(
|
||||||
'contact_name' => $contact->contact_name
|
'contact_name' => $contact->contact_name
|
||||||
)
|
)
|
||||||
);
|
) . '">' . $contact->contact_alias . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo '<strong>Contacts:</strong> ';
|
echo '<strong>Contacts:</strong> ';
|
||||||
echo implode(', ', $contactList);
|
echo implode(', ', $contactList);
|
||||||
}
|
}
|
||||||
@ -18,15 +18,13 @@
|
|||||||
if (!empty($this->contactgroups)) {
|
if (!empty($this->contactgroups)) {
|
||||||
$contactGroupList = array();
|
$contactGroupList = array();
|
||||||
foreach ($this->contactgroups as $contactgroup) {
|
foreach ($this->contactgroups as $contactgroup) {
|
||||||
$contactGroupList[] = $this->qlink(
|
$contactGroupList[] = '<a href="' . $this->href(
|
||||||
$contactgroup->contactgroup_alias,
|
|
||||||
'monitoring/show/contactgroup',
|
'monitoring/show/contactgroup',
|
||||||
array(
|
array(
|
||||||
'contactgroup_name' => $contactgroup->contactgroup_name
|
'contactgroup_name' => $contactgroup->contactgroup_name
|
||||||
)
|
)
|
||||||
);
|
) . '">' . $contactgroup->contactgroup_alias . '</a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo '<strong>Contactgroups:</strong> ';
|
echo '<strong>Contactgroups:</strong> ';
|
||||||
echo implode(', ', $contactGroupList);
|
echo implode(', ', $contactGroupList);
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,9 @@ if (empty($object->hostgroups)) return;
|
|||||||
|
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($object->hostgroups as $name => $alias) {
|
foreach ($object->hostgroups as $name => $alias) {
|
||||||
$list[] = $this->qlink($alias, 'monitoring/list/services', array(
|
$list[] = '<a href="' . $this->href('monitoring/list/host', array('hostgroups' => $name)) . '">'
|
||||||
'hostgroups' => $name
|
. $alias
|
||||||
));
|
. '</a>';
|
||||||
}
|
}
|
||||||
echo '<b>Hostgroups:</b> ' . implode(', ', $list) . "<br />\n";
|
echo '<b>Hostgroups:</b> ' . implode(', ', $list) . "<br />\n";
|
||||||
|
|
||||||
|
@ -4,9 +4,9 @@ if (empty($object->servicegroups)) return;
|
|||||||
|
|
||||||
$list = array();
|
$list = array();
|
||||||
foreach ($object->servicegroups as $name => $alias) {
|
foreach ($object->servicegroups as $name => $alias) {
|
||||||
$list[] = $this->qlink($alias, 'monitoring/list/services', array(
|
$list[] = '<a href="' . $this->href('monitoring/list/service', array('servicegroups' => $name)) . '">'
|
||||||
'servicegroups' => $name
|
. $alias
|
||||||
));
|
. '</a>';
|
||||||
}
|
}
|
||||||
echo '<b>Servicegroups:</b> ' . implode(', ', $list) . "<br />\n";
|
echo '<b>Servicegroups:</b> ' . implode(', ', $list) . "<br />\n";
|
||||||
|
|
||||||
|
@ -24,26 +24,25 @@ $row_class = array_key_exists($event->state, $states) ? $states[$event->state] :
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
<tr class="<?= $row_class ?>"><td class="state"><?= date('d.m. H:i', $event->timestamp ) ?></td>
|
<tr class="<?= $row_class ?>"><td class="state"><?= date('d.m. H:i', $event->timestamp ) ?></td>
|
||||||
|
|
||||||
<? if (! $object): ?>
|
<? if (! $object): ?>
|
||||||
<td><?= $this->escape($event->host_name) ?></td>
|
<td><?= $this->escape($event->host_name) ?></td>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
|
|
||||||
<? if (! $object instanceof Monitoring\Object\Service): ?>
|
<? if (! $object instanceof Monitoring\Object\Service): ?>
|
||||||
<td><? if ($object): ?>
|
<td>
|
||||||
<?= $this->qlink(
|
<? if ($object): ?>
|
||||||
$event->service_description,
|
<a href="<?= $this->href('monitoring/show/service',array(
|
||||||
'monitoring/show/service',
|
|
||||||
array(
|
|
||||||
'host' => $object->host_name,
|
'host' => $object->host_name,
|
||||||
'service' => $event->service_description
|
'service' => $event->service_description
|
||||||
)
|
)); ?>"><?php $event->service_description; ?></a>
|
||||||
) ?>
|
</a>
|
||||||
<? else: ?>
|
<? else: ?>
|
||||||
<?= $this->escape($event->service_description) ?>
|
<?= $this->escape($event->service_description) ?>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
</td>
|
</td>
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
<td style="padding: 0.2em;"><?php
|
<td style="padding: 0.2em;"><?php
|
||||||
|
|
||||||
$imgparams = array(
|
$imgparams = array(
|
||||||
'width' => 16,
|
'width' => 16,
|
||||||
'height' => 16,
|
'height' => 16,
|
||||||
@ -83,11 +82,6 @@ switch ($event->type) {
|
|||||||
<? if ($event->attempt !== null): ?>
|
<? if ($event->attempt !== null): ?>
|
||||||
[ <?= $event->attempt ?>/<?=$event->max_attempts ?> ]
|
[ <?= $event->attempt ?>/<?=$event->max_attempts ?> ]
|
||||||
<? endif ?>
|
<? endif ?>
|
||||||
<?= $ticket_pattern ? preg_replace(
|
|
||||||
$ticket_pattern,
|
|
||||||
$ticket_link,
|
|
||||||
$this->pluginOutput($event->output)
|
|
||||||
) : $this->pluginOutput($event->output) ?>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<? endforeach ?>
|
<? endforeach ?>
|
||||||
|
@ -2,13 +2,12 @@
|
|||||||
$hostgroupLinkList = array();
|
$hostgroupLinkList = array();
|
||||||
if (!empty($this->hostgroups)) {
|
if (!empty($this->hostgroups)) {
|
||||||
foreach ($this->hostgroups as $name => $alias) {
|
foreach ($this->hostgroups as $name => $alias) {
|
||||||
$hostgroupLinkList[] = $this->qlink(
|
$hostgroupLinkList[] = '<a href="' . $this->href(
|
||||||
$alias,
|
'monitoring/list/hosts',
|
||||||
'monitoring/list/services',
|
|
||||||
array(
|
array(
|
||||||
'hostgroups' => $name
|
'hostgroups' => $name
|
||||||
)
|
)
|
||||||
);
|
) . '">'.$alias. '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -3,13 +3,12 @@
|
|||||||
$servicegroupLinkList = array();
|
$servicegroupLinkList = array();
|
||||||
if (!empty($this->servicegroups)) {
|
if (!empty($this->servicegroups)) {
|
||||||
foreach ($this->servicegroups as $name => $alias) {
|
foreach ($this->servicegroups as $name => $alias) {
|
||||||
$servicegroupLinkList[] = $this->qlink(
|
$servicegroupLinkList[] = '<a href="' . $this->href(
|
||||||
$alias,
|
|
||||||
'monitoring/list/services',
|
'monitoring/list/services',
|
||||||
array(
|
array(
|
||||||
'servicegroups' => $name
|
'servicegroups' => $name
|
||||||
)
|
)
|
||||||
);
|
) . '">' . $alias . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -26,7 +25,6 @@ $this->partial(
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?= $this->preview_image ?>
|
<?= $this->preview_image ?>
|
||||||
|
|
||||||
<div class="information-container">
|
<div class="information-container">
|
||||||
<div class="head">
|
<div class="head">
|
||||||
<span>Plugin output</span>
|
<span>Plugin output</span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user