mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 06:44:33 +02:00
commit
cd41cb2306
@ -1,39 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
|
||||
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
|
||||
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
|
||||
<!--[if lt IE 7]>
|
||||
<html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![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]><!-->
|
||||
<html class="no-js"> <!--<![endif]-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title></title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<meta charset="utf-8">
|
||||
<meta content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title></title>
|
||||
<meta name="description" content="">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/normalize.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/bootstrap.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/datetimepicker/bootstrap-datetimepicker.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/ui-lightness/jquery-ui-1.10.3.custom.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/main.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/jquery.qtip.min.css') ?>">
|
||||
<script type="text/javascript">
|
||||
var base_url = '<?= $this->baseUrl() ?>';
|
||||
ICINGA_DEBUG = true;
|
||||
</script>
|
||||
<? if (isset($_GET['iframe']) && $_GET['iframe'] === 'true'): ?>
|
||||
<base target="_parent" />
|
||||
<? endif ?>
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/normalize.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/bootstrap.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/datetimepicker/bootstrap-datetimepicker.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/ui-lightness/jquery-ui-1.10.3.custom.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/main.css') ?>">
|
||||
<link rel="stylesheet" href="<?= $this->baseUrl('css/vendor/jquery.qtip.min.css') ?>">
|
||||
<script type="text/javascript">
|
||||
var base_url = '<?= $this->baseUrl() ?>';
|
||||
ICINGA_DEBUG = true;
|
||||
</script>
|
||||
<? if (isset($_GET['iframe']) && $_GET['iframe'] === 'true'): ?>
|
||||
<base target="_parent"/>
|
||||
<? endif ?>
|
||||
|
||||
<script src="<?php echo $this->baseUrl('js/vendor/modernizr-2.6.2.min.js') ?>"></script>
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css.php') ?>">
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/bootstrap-responsive.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/font-awesome.min.css') ?>">
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/font-awesome-ie7.min.css') ?>">
|
||||
<![endif]-->
|
||||
<script data-main="<?php echo $this->baseUrl('js/main.js')?>" src="<?php echo $this->baseUrl('js/vendor/require.js') ?>"></script>
|
||||
<script src="<?php echo $this->baseUrl('js/vendor/modernizr-2.6.2.min.js') ?>"></script>
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css.php') ?>">
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/bootstrap-responsive.min.css') ?>">
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/font-awesome.min.css') ?>">
|
||||
<!--[if IE 7]>
|
||||
<link rel="stylesheet" href="<?php echo $this->baseUrl('css/vendor/font-awesome-ie7.min.css') ?>">
|
||||
<![endif]-->
|
||||
<script data-main="<?php echo $this->baseUrl('js/main.js')?>"
|
||||
src="<?php echo $this->baseUrl('js/vendor/require.js') ?>"></script>
|
||||
|
||||
</head>
|
||||
<body class="cranberry">
|
||||
|
@ -1,19 +1,19 @@
|
||||
<?php
|
||||
// determine current key
|
||||
$url = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
|
||||
$currentKey = isset($this->navkey) ? $this->navkey : $url;
|
||||
// determine current key
|
||||
$url = Zend_Controller_Front::getInstance()->getRequest()->getRequestUri();
|
||||
$currentKey = isset($this->navkey) ? $this->navkey : $url;
|
||||
|
||||
$item = $this->navigation->keys("menu");
|
||||
$item = $this->navigation->keys("menu");
|
||||
?>
|
||||
<?php if ($this->auth()->isAuthenticated()): ?>
|
||||
<ul class="nav nav-tabs icinga-navigation" >
|
||||
<?php
|
||||
<ul class="nav nav-tabs icinga-navigation" >
|
||||
<?php
|
||||
$activeSet = false;
|
||||
foreach ($item as $itemName) {
|
||||
if($itemName[0] == "_") {
|
||||
?>
|
||||
<li class="section-end"></li>
|
||||
<?php
|
||||
?>
|
||||
<li class="section-end"></li>
|
||||
<?php
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -31,10 +31,10 @@
|
||||
}
|
||||
$activeSet = $activeSet || $active;
|
||||
?>
|
||||
<li class="<?= $active ? "active" : "" ?>"><a href="<?= $url ?>"><?= $itemName ?></a></li>
|
||||
<?php
|
||||
<li class="<?= $active ? "active" : "" ?>"><a href="<?= $url ?>"><?= $itemName ?></a></li>
|
||||
<?php
|
||||
$class = "";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
?>
|
||||
</ul>
|
||||
<? endif ?>
|
||||
|
@ -18,8 +18,11 @@
|
||||
<b class="caret"></b>
|
||||
</a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><?= $this->qlink($this->translate('Preferences'), 'preference'); ?></li>
|
||||
<li><?= $this->qlink($this->translate('Logout'), 'authentication/logout'); ?></li>
|
||||
<li>
|
||||
<a href="<?= $this->href('/preference'); ?>"><?= $this->translate('Preferences'); ?> </a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="<?= $this->href('/authentication/logout'); ?>"><?= $this->translate('Logout'); ?></a>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
|
@ -1,45 +1,48 @@
|
||||
<?php
|
||||
// @codingStandardsIgnoreStart
|
||||
|
||||
// {{{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
|
||||
*
|
||||
*
|
||||
* 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>
|
||||
* @license http://www.gnu.org/licenses/gpl-2.0.txt GPL, version 2
|
||||
* @author Icinga Development Team <info@icinga.org>
|
||||
*/
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
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);
|
||||
|
||||
/**
|
||||
* Turn the relative link $link into absolute one
|
||||
*
|
||||
* @param $link
|
||||
*/
|
||||
public function href($link, array $params = array()) {
|
||||
return Url::fromPath($link, $params)->getAbsoluteUrl();
|
||||
}
|
||||
}
|
||||
|
||||
// @codingStandardsIgnoreStop
|
||||
// @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>
|
||||
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) {
|
||||
$url = $url->getRelativeUrl();
|
||||
} else {
|
||||
$url = Url::fromPath($url)->getRelativeUrl();
|
||||
}
|
||||
$this->_helper->Redirector->gotoUrlAndExit($url);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
|
||||
use Icinga\Application\Benchmark;
|
||||
use Icinga\Application\Icinga;
|
||||
use \Monitoring\Backend;
|
||||
use \Icinga\Module\Monitoring\Backend;
|
||||
use \Icinga\Application\Config;
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Authentication\Manager;
|
||||
|
@ -85,7 +85,6 @@ class Monitoring_ShowController extends ModuleActionController
|
||||
}
|
||||
$this->view->object = $object;
|
||||
$this->createTabs();
|
||||
$this->prepareTicketHook();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -302,7 +301,6 @@ class Monitoring_ShowController extends ModuleActionController
|
||||
->where('object_type', 'host')
|
||||
->fetchPairs();
|
||||
$this->view->object->prefetch();
|
||||
$this->prepareTicketHook();
|
||||
$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()
|
||||
{
|
||||
if ($grapher = Hook::get('grapher')) {
|
||||
@ -482,18 +434,9 @@ class Monitoring_ShowController extends ModuleActionController
|
||||
'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())
|
||||
->extend(new DashboardAction())
|
||||
->extend(new BasketAction);
|
||||
|
@ -2,7 +2,9 @@
|
||||
<ul>
|
||||
<?php foreach($this->commands as $command): ?>
|
||||
<li>
|
||||
<?= $this->qlink($command, 'monitoring/command/'. $command); ?>
|
||||
<a href="<?= $this->href('monitoring/command/'. $command); ?>">
|
||||
<?= $this->escape($command); ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
@ -16,143 +16,121 @@ function formatDateString($self,$dateString){
|
||||
$paginator = $downtimes->paginate();
|
||||
$downtimes = $downtimes->fetchAll();
|
||||
?>
|
||||
<form method="get" action="<?= $this->qUrl(
|
||||
<form method="get" action="<?= $this->href(
|
||||
'monitoring/list/downtimes?',
|
||||
array(
|
||||
'action' => 'downtimes'
|
||||
));
|
||||
?>">
|
||||
Sort by <?= $this->formSelect(
|
||||
'sort',
|
||||
$this->sort,
|
||||
array('class' => 'autosubmit'),
|
||||
array(
|
||||
'downtime_is_in_effect' => 'Is In Effect',
|
||||
'object_type' => 'Service/Host',
|
||||
'host_name' => 'Host Name',
|
||||
'service_description' => 'Service Name',
|
||||
'downtime_entry_time' => 'Entry Time',
|
||||
'downtime_author_name' => 'Author',
|
||||
'downtime_comment_data' => 'Comment',
|
||||
'downtime_scheduled_start_time' => 'Start',
|
||||
'downtime_scheduled_end_time' => 'End',
|
||||
'downtime_trigger_time' => 'Trigger Time',
|
||||
'downtime_internal_downtime_id' => 'Downtime ID',
|
||||
'downtime_duration' => 'Duration',
|
||||
)
|
||||
) ?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
Sort by <?= $this->formSelect(
|
||||
'sort',
|
||||
$this->sort,
|
||||
array('class' => 'autosubmit'),
|
||||
array(
|
||||
'downtime_is_in_effect' => 'Is In Effect',
|
||||
'object_type' => 'Service/Host',
|
||||
'host_name' => 'Host Name',
|
||||
'service_description' => 'Service Name',
|
||||
'downtime_entry_time' => 'Entry Time',
|
||||
'downtime_author_name' => 'Author',
|
||||
'downtime_comment_data' => 'Comment',
|
||||
'downtime_scheduled_start_time' => 'Start',
|
||||
'downtime_scheduled_end_time' => 'End',
|
||||
'downtime_trigger_time' => 'Trigger Time',
|
||||
'downtime_internal_downtime_id' => 'Downtime ID',
|
||||
'downtime_duration' => 'Duration',
|
||||
)
|
||||
) ?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
</form>
|
||||
<?=
|
||||
$this->paginationControl(
|
||||
$paginator,
|
||||
null,
|
||||
array(
|
||||
'mixedPagination.phtml',
|
||||
'default'),
|
||||
array('preserve' => $this->preserve))
|
||||
$paginator,
|
||||
null,
|
||||
array(
|
||||
'mixedPagination.phtml',
|
||||
'default'),
|
||||
array('preserve' => $this->preserve))
|
||||
?>
|
||||
|
||||
<table class="statustable action">
|
||||
<thead>
|
||||
<th> Is In Effect </th>
|
||||
<th> Object </th>
|
||||
<th> Host Name </th>
|
||||
<th> Service Name </th>
|
||||
<th> Entry Time </th>
|
||||
<th> Author </th>
|
||||
<th> Comment </th>
|
||||
<th> Start Time </th>
|
||||
<th> End Time </th>
|
||||
<th> Type </th>
|
||||
<th> Trigger Time </th>
|
||||
<th> Downtime ID </th>
|
||||
<th> Trigger ID </th>
|
||||
<th> Duration </th>
|
||||
</thead>
|
||||
<?php foreach ($downtimes as $downtime): ?>
|
||||
<tr class="<?= $downtime->downtime_is_in_effect == 0 ? 'ok' : 'warning' ?>">
|
||||
<td>
|
||||
<?= $downtime->downtime_is_in_effect == 0 ? 'False' : '<b>True</b>'; ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="img-box">
|
||||
<?php if ($downtime->object_type == 'service'): ?>
|
||||
<img title="Service" src="<?='../../img/classic/service.png'?>"/>
|
||||
<?php endif; ?>
|
||||
<?php if ($downtime->object_type == 'host'): ?>
|
||||
<img title="Host" src="<?='../../img/classic/server.png'?>"/>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->host_name ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->service_description ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= formatDateString($this,$downtime->downtime_entry_time); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_author_name ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_comment_data ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= formatDateString($this,$downtime->downtime_scheduled_start_time); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= formatDateString($this,$downtime->downtime_scheduled_end_time); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_is_fixed == 1 ? 'Fixed' : 'Not Fixed' ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$date = formatDateString($this,$downtime->downtime_trigger_time);
|
||||
echo $date != 'undef' ? $date : 'N/A';
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_internal_downtime_id ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_triggered_by_id == 0 ?
|
||||
'N/A' : $downtime->downtime_triggered_by_id ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->util()->showHourMin(intval($downtime->downtime_duration)); ?>
|
||||
</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>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
<thead>
|
||||
<th> Is In Effect</th>
|
||||
<th> Object</th>
|
||||
<th> Host Name</th>
|
||||
<th> Service Name</th>
|
||||
<th> Entry Time</th>
|
||||
<th> Author</th>
|
||||
<th> Comment</th>
|
||||
<th> Start Time</th>
|
||||
<th> End Time</th>
|
||||
<th> Type</th>
|
||||
<th> Trigger Time</th>
|
||||
<th> Downtime ID</th>
|
||||
<th> Trigger ID</th>
|
||||
<th> Duration</th>
|
||||
</thead>
|
||||
|
||||
<?php foreach ($downtimes as $downtime): ?>
|
||||
<tr class="<?= $downtime->downtime_is_in_effect == 0 ? 'ok' : 'warning' ?>">
|
||||
<td>
|
||||
<?= $downtime->downtime_is_in_effect == 0 ? 'False' : '<b>True</b>'; ?>
|
||||
</td>
|
||||
<td>
|
||||
<div class="img-box">
|
||||
|
||||
<?php if ($downtime->object_type == 'service'): ?>
|
||||
<img title="Service" src="<?='../../img/classic/service.png'?>"/>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($downtime->object_type == 'host'): ?>
|
||||
<img title="Host" src="<?='../../img/classic/server.png'?>"/>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->host_name ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->service_description ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= formatDateString($this,$downtime->downtime_entry_time); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_author_name ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_comment_data ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= formatDateString($this,$downtime->downtime_scheduled_start_time); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= formatDateString($this,$downtime->downtime_scheduled_end_time); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_is_fixed == 1 ? 'Fixed' : 'Not Fixed' ?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
$date = formatDateString($this,$downtime->downtime_trigger_time);
|
||||
echo $date != 'undef' ? $date : 'N/A';
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_internal_downtime_id ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $downtime->downtime_triggered_by_id == 0 ?
|
||||
'N/A' : $downtime->downtime_triggered_by_id ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->util()->showHourMin(intval($downtime->downtime_duration)); ?>
|
||||
</td>
|
||||
<td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
|
@ -4,106 +4,108 @@ $viewHelper = $this->getHelper('MonitoringState');
|
||||
$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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Host</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($hosts as $host): ?>
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box"><?php $trimArea->start(); ?>
|
||||
<?php if ($host->host_icon_image) : ?>
|
||||
<img src="<?= $host->host_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Host</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($hosts as $host): ?>
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box"><?php $trimArea->start(); ?>
|
||||
<?php if ($host->host_icon_image) : ?>
|
||||
<img src="<?= $host->host_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled host' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!$host->host_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
||||
<div class="statetext">
|
||||
<?= $this->qlink(
|
||||
"<b>".ucfirst($viewHelper->monitoringState($host, 'host')).'</b>'.
|
||||
'<div class="nowrap"> since '.
|
||||
$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): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="hostname">
|
||||
<?php if ($host->host_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?= $this->qlink(
|
||||
'<b>'.$host->host_name.'</b><br/>'.
|
||||
'<i>'.$host->host_address.'</i>',
|
||||
'monitoring/show/host', array(
|
||||
'host' => $host->host_name
|
||||
), array(
|
||||
'class' => 'row-action',
|
||||
'quote' => false
|
||||
)
|
||||
); ?>
|
||||
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled host' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$host->host_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $trimArea->end(); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
||||
<div class="statetext">
|
||||
<a href="<?= $this->href('monitoring/show/history', array('host' => $host->host_name)); ?>">
|
||||
<b> <?= ucfirst($viewHelper->monitoringState($host, 'host')); ?> </b>
|
||||
|
||||
<div class="nowrap"> since
|
||||
<?= $this->timeSince($host->host_last_state_change); ?>
|
||||
|
||||
|
||||
<?php if ($host->host_action_url != ''): ?>
|
||||
<a href="<?= $host->host_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_notes_url != ''): ?>
|
||||
<a href="<?= $host->host_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="hostname">
|
||||
<?php if ($host->host_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>"
|
||||
class="row-action">
|
||||
<b><?= $host->host_name; ?></b>
|
||||
<br/>
|
||||
<i><?= $host->host_address; ?></i>
|
||||
</a>
|
||||
|
||||
<?php if ($host->host_action_url != ''): ?>
|
||||
<a href="<?= $host->host_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_notes_url != ''): ?>
|
||||
<a href="<?= $host->host_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($host->host_output), 0, 500)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -5,123 +5,127 @@ $hosts = $this->hosts->paginate();
|
||||
$viewHelper = $this->getHelper('MonitoringState');
|
||||
$trimArea = $this->getHelper('Trim');
|
||||
?>
|
||||
<form method="get" action="<?= $this->qUrl(
|
||||
'monitoring/list/hosts?' . http_build_query($this->hosts->getAppliedFilter()->toParams()),
|
||||
array()
|
||||
);
|
||||
?>">
|
||||
Sort by <?= $this->formSelect(
|
||||
'sort',
|
||||
$this->sort,
|
||||
array('class' => 'autosubmit'),
|
||||
array(
|
||||
'host_severity' => 'Severity',
|
||||
'host_last_state_change' => 'Last state change',
|
||||
'host_name' => 'Host',
|
||||
)
|
||||
) ?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
<form method="get" action="<?= $this->href('monitoring/list/hosts', $this->hosts->getAppliedFilter()->toParams());?>">
|
||||
Sort by <?= $this->formSelect(
|
||||
'sort',
|
||||
$this->sort,
|
||||
array('class' => 'autosubmit'),
|
||||
array(
|
||||
'host_severity' => 'Severity',
|
||||
'host_last_state_change' => 'Last state change',
|
||||
'host_name' => 'Host',
|
||||
)
|
||||
); ?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
</form>
|
||||
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
|
||||
|
||||
<table class="statustable action hosts">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Host</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($hosts as $host): ?>
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box"><?php $trimArea->start(); ?>
|
||||
<?php if ($host->host_icon_image) : ?>
|
||||
<img src="<?= $host->host_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled host' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!$host->host_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
||||
<div class="statetext">
|
||||
<?= $this->qlink(
|
||||
"<b>".ucfirst($viewHelper->monitoringState($host, 'host'))."</b>".
|
||||
'<div class="nowrap"> since '.
|
||||
$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): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Host</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<td class="hostname">
|
||||
<?php if ($host->host_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?= $this->qlink(
|
||||
"<b>".$host->host_name."</b><br/>".
|
||||
"<i>".$host->host_address."</i>",
|
||||
'monitoring/show/host', array(
|
||||
'host' => $host->host_name
|
||||
), array(
|
||||
'class' => 'row-action',
|
||||
'quote' => false
|
||||
)
|
||||
); ?>
|
||||
<?php foreach($hosts as $host): ?>
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($host, 'host')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box">
|
||||
<?php $trimArea->start(); ?>
|
||||
|
||||
<?php if ($host->host_icon_image) : ?>
|
||||
<img src="<?= $host->host_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $trimArea->end(); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box">
|
||||
<?php $trimArea->start(); ?>
|
||||
|
||||
<?php if (!$host->host_handled && $host->host_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled host' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_acknowledged && !$host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$host->host_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($host, 'host'); ?>">
|
||||
<div class="statetext">
|
||||
<b><?= ucfirst($viewHelper->monitoringState($host, 'host')); ?></b>
|
||||
|
||||
<div class="nowrap"> since
|
||||
<?= $this->timeSince($host->host_last_state_change); ?>
|
||||
|
||||
|
||||
<?php if ($host->host_action_url != ""): ?>
|
||||
<a href="<?= $host->host_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($host->host_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_notes_url != ""): ?>
|
||||
<a href="<?= $host->host_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="hostname">
|
||||
|
||||
<?php if ($host->host_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<a href="<?= $this->href('monitoring/show/host', array('host' => $host->host_name)); ?>" class="row-action">
|
||||
<b> <?= $host->host_name ?></b><br/>
|
||||
<i> <?= $host->host_address ?></i>
|
||||
</a>
|
||||
|
||||
<?php if ($host->host_action_url != ""): ?>
|
||||
<a href="<?= $host->host_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($host->host_notes_url != ""): ?>
|
||||
<a href="<?= $host->host_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
|
||||
</td>
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($host->host_output), 0, 10000)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -7,23 +7,24 @@ $formatter = $this->getHelper('MonitoringProperties');
|
||||
?>
|
||||
|
||||
<form method="get" action="<?=
|
||||
Url::fromPath(
|
||||
$this->href(
|
||||
'monitoring/list/notifications',
|
||||
$this->notifications->getAppliedFilter()->toParams()
|
||||
)->getAbsoluteUrl();
|
||||
?>">
|
||||
Sort by <?= $this->formSelect(
|
||||
'sort',
|
||||
$this->sort,
|
||||
array(
|
||||
'class' => 'autosubmit'
|
||||
),
|
||||
array(
|
||||
'notification_start_time' => 'Time'
|
||||
)
|
||||
);
|
||||
?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
?>">
|
||||
Sort by <?=
|
||||
$this->formSelect(
|
||||
'sort',
|
||||
$this->sort,
|
||||
array(
|
||||
'class' => 'autosubmit'
|
||||
),
|
||||
array(
|
||||
'notification_start_time' => 'Time'
|
||||
)
|
||||
);
|
||||
?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
</form>
|
||||
|
||||
<?php
|
||||
@ -32,60 +33,41 @@ echo $this->paginationControl($notifications, null, null, array('preserve' => $t
|
||||
?>
|
||||
|
||||
<table class="statustable action table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Host</th>
|
||||
<th>Service</th>
|
||||
<th>Type</th>
|
||||
<th>Time</th>
|
||||
<th>Contact</th>
|
||||
<th>Notification command</th>
|
||||
<th>Information</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($notifications as $notification): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $notification->host_name ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= empty($notification->service_description) ? '' : $notification->service_description; ?>
|
||||
</td>
|
||||
<td><?= $formatter->getNotificationType($notification); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $notification->notification_start_time ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $notification->notification_contact ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $notification->notification_command ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?>
|
||||
</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>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Host</th>
|
||||
<th>Service</th>
|
||||
<th>Type</th>
|
||||
<th>Time</th>
|
||||
<th>Contact</th>
|
||||
<th>Notification command</th>
|
||||
<th>Information</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($notifications as $notification): ?>
|
||||
<tr>
|
||||
<td>
|
||||
<?= $notification->host_name ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= empty($notification->service_description) ? '' : $notification->service_description; ?>
|
||||
</td>
|
||||
<td><?= $formatter->getNotificationType($notification); ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $notification->notification_start_time ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $notification->notification_contact ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $notification->notification_command ?>
|
||||
</td>
|
||||
<td>
|
||||
<?= $this->escape(substr(strip_tags($notification->notification_information), 0, 10000)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -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,137 +1,130 @@
|
||||
<?php
|
||||
$paginator = $services->paginate();
|
||||
|
||||
$viewHelper = $this->getHelper('MonitoringState');
|
||||
$trimArea = $this->getHelper('Trim');
|
||||
?>
|
||||
|
||||
<?php if (empty($services)): ?>
|
||||
<div class="alert alert-info fullpage_infobox">
|
||||
Sorry, no services found for this search
|
||||
</div>
|
||||
<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="statustable action services">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Service</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($services->fetchAll() as $service): ?>
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box"><?php $trimArea->start(); ?>
|
||||
<?php if ($service->service_icon_image) : ?>
|
||||
<img src="<?= $service->service_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled service' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!$service->service_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Service</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($services->fetchAll() as $service): ?>
|
||||
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box"><?php $trimArea->start(); ?>
|
||||
|
||||
<?php if ($service->service_icon_image) : ?>
|
||||
<img src="<?= $service->service_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $trimArea->end(); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||
|
||||
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled service' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$service->service_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $trimArea->end(); ?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
||||
<div class="statetext">
|
||||
<?= $this->qlink(
|
||||
"<b>".ucfirst($viewHelper->monitoringState($service, 'service'))."</b>".
|
||||
'<div class="nowrap"> since '.
|
||||
$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): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
||||
<div class="statetext">
|
||||
<?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
|
||||
<div class="nowrap"> since '
|
||||
<?= $this->timeSince($service->service_last_state_change); ?>
|
||||
|
||||
<?php if ($service->service_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="servicename">
|
||||
|
||||
<?php if ($service->service_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<td class="servicename">
|
||||
<?php if ($service->service_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?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
|
||||
)
|
||||
); ?>
|
||||
<?= $this->qlink(
|
||||
$service->host_name,
|
||||
'monitoring/show/host', array(
|
||||
'host' => $service->host_name
|
||||
), array(
|
||||
'class' => 'row-action',
|
||||
'quote' => false
|
||||
)
|
||||
); ?>
|
||||
<b> <?= $service->service_display_name; ?></b>
|
||||
<br/>
|
||||
<?= $service->host_name; ?>
|
||||
|
||||
<?php if ($service->service_action_url != ""): ?>
|
||||
<a href="<?= $service->service_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_action_url != ""): ?>
|
||||
<a href="<?= $service->service_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_notes_url != ""): ?>
|
||||
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<?php if ($service->service_notes_url != ""): ?>
|
||||
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</td>
|
||||
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -8,172 +8,150 @@ $trimArea = $this->getHelper('Trim');
|
||||
?>
|
||||
|
||||
<?php if (empty($services)): ?>
|
||||
<div class="alert alert-info fullpage_infobox">
|
||||
Sorry, no services found for this search
|
||||
</div>
|
||||
<div class="alert alert-info fullpage_infobox">
|
||||
Sorry, no services found for this search
|
||||
</div>
|
||||
<?php return; 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(
|
||||
'service_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',
|
||||
'service_description' => 'Service',
|
||||
)
|
||||
) ?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
<form method="get" action="<?= $this->href('monitoring/list/services', $this->services->getAppliedFilter()->toParams()); ?>">
|
||||
Sort by <?= $this->formSelect(
|
||||
'sort',
|
||||
$this->sort,
|
||||
array('class' => 'autosubmit'),
|
||||
array(
|
||||
'service_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',
|
||||
'service_description' => 'Service',
|
||||
)
|
||||
) ?>
|
||||
<button class="btn btn-small"><i class="icon-refresh"></i></button>
|
||||
</form>
|
||||
<?= $this->paginationControl($paginator, null, null, array('preserve' => $this->preserve)) ?>
|
||||
|
||||
<table class="statustable action services">
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Service</th>
|
||||
<th>Host</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($services->fetchAll() as $service): ?>
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box"><?php $trimArea->start(); ?>
|
||||
<?php if ($service->service_icon_image) : ?>
|
||||
<img src="<?= $service->service_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled service' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!$service->service_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php $trimArea->end(); ?></div>
|
||||
</td>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3">Status</th>
|
||||
<th>Service</th>
|
||||
<th>Host</th>
|
||||
<th>Output</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($services->fetchAll() as $service): ?>
|
||||
<tr class="<?= implode(' ', $viewHelper->getStateFlags($service, 'service')); ?>">
|
||||
<td class="icons indicator">
|
||||
<div class="img-box"><?php $trimArea->start(); ?>
|
||||
|
||||
<?php if ($service->service_icon_image) : ?>
|
||||
<img src="<?= $service->service_icon_image; ?>"/>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $trimArea->end(); ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="icons indicator">
|
||||
<div class="icon-box"><?php $trimArea->start(); ?>
|
||||
|
||||
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
||||
<a href="#" title="<?= 'Unhandled service' ?>">
|
||||
<i class="icon-warning-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'Acknowledged' ?>">
|
||||
<i class="icon-ok-sign"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_is_flapping): ?>
|
||||
<a href="#" title="<?= 'Flapping' ?>">
|
||||
<i class="icon-random"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$service->service_notifications_enabled): ?>
|
||||
<a href="#" title="<?= 'Notifications disabled' ?>">
|
||||
<i class="icon-volume-off"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_in_downtime): ?>
|
||||
<a href="#" title="<?= 'In downtime' ?>">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php $trimArea->end(); ?>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
||||
<div class="statetext">
|
||||
<?= $this->qlink(
|
||||
"<b>".ucfirst($viewHelper->monitoringState($service, 'service'))."</b>".
|
||||
'<div class="nowrap"> since '.
|
||||
$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): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</td>
|
||||
<td class="indicator state" title="<?= $viewHelper->getStateTitle($service, 'service'); ?>">
|
||||
<div class="statetext">
|
||||
<b><?= ucfirst($viewHelper->monitoringState($service, 'service')); ?></b>
|
||||
<div class="nowrap"> since
|
||||
<?= $this->timeSince($service->service_last_state_change); ?>
|
||||
|
||||
<?php if ($service->service_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
||||
<td class="servicename">
|
||||
<?php if ($service->service_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<b> <?= $service->service_display_name; ?></b>
|
||||
<br/>
|
||||
|
||||
<td class="servicename">
|
||||
<?php if ($service->service_last_comment !== null): ?>
|
||||
<a href="#" title="<?= 'Comments' ?>">
|
||||
<i class="icon-comment"> </i>
|
||||
</a>
|
||||
<?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
|
||||
)
|
||||
); ?>
|
||||
<?php if ($service->service_action_url != ""): ?>
|
||||
<a href="<?= $service->service_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_notes_url != ""): ?>
|
||||
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($service->service_action_url != ""): ?>
|
||||
<a href="<?= $service->service_action_url; ?>">Action</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
|
||||
<?php if ($service->service_notes_url != ""): ?>
|
||||
<a href="<?= $service->service_notes_url; ?>">Notes</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($service->service_state_type == 0): ?>
|
||||
<a href="#" title="<?= 'Soft state' ?>">
|
||||
<i class="icon-gears"></i>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="hostname" title="<?= $viewHelper->getStateTitle($service, 'host'); ?>">
|
||||
<?= $service->host_name; ?>
|
||||
|
||||
<td class="hostname" title="<?= $viewHelper->getStateTitle($service, 'host'); ?>">
|
||||
<?= $this->qlink(
|
||||
$service->host_name,
|
||||
'monitoring/show/host', array(
|
||||
'host' => $service->host_name
|
||||
), array(
|
||||
'class' => 'row-action',
|
||||
'quote' => false
|
||||
)
|
||||
); ?>
|
||||
<div class="statetext">
|
||||
(<?= ucfirst($viewHelper->monitoringState($service, 'host')); ?>)
|
||||
</div>
|
||||
<span class="host_address">
|
||||
<?= $service->host_address ?>
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<div class="statetext">
|
||||
<?= $this->qlink(
|
||||
"(".ucfirst($viewHelper->monitoringState($service, 'host')).")",
|
||||
'monitoring/show/history', array(
|
||||
'host' => $service->host_name,
|
||||
'service' => $service->service_description
|
||||
),
|
||||
array('quote' => false)
|
||||
);?>
|
||||
</div>
|
||||
<span class="host_address">
|
||||
<?= $service->host_address ?>
|
||||
</span>
|
||||
</td>
|
||||
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
<td class="expand-full">
|
||||
<?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -2,15 +2,15 @@
|
||||
if (!empty($this->contacts)) {
|
||||
$contactList = array();
|
||||
foreach ($this->contacts as $contact) {
|
||||
$contactList[] = $this->qlink(
|
||||
$contact->contact_alias,
|
||||
'monitoring/show/contact',
|
||||
array(
|
||||
'contact_name' => $contact->contact_name
|
||||
)
|
||||
);
|
||||
$contactList[] = '<a href="' . $this->href(
|
||||
'monitoring/show/contact',
|
||||
array(
|
||||
'contact_name' => $contact->contact_name
|
||||
)
|
||||
) . '">' . $contact->contact_alias . '</a>';
|
||||
}
|
||||
|
||||
|
||||
echo '<strong>Contacts:</strong> ';
|
||||
echo implode(', ', $contactList);
|
||||
}
|
||||
@ -18,15 +18,13 @@
|
||||
if (!empty($this->contactgroups)) {
|
||||
$contactGroupList = array();
|
||||
foreach ($this->contactgroups as $contactgroup) {
|
||||
$contactGroupList[] = $this->qlink(
|
||||
$contactgroup->contactgroup_alias,
|
||||
$contactGroupList[] = '<a href="' . $this->href(
|
||||
'monitoring/show/contactgroup',
|
||||
array(
|
||||
'contactgroup_name' => $contactgroup->contactgroup_name
|
||||
)
|
||||
);
|
||||
) . '">' . $contactgroup->contactgroup_alias . '</a>';
|
||||
}
|
||||
|
||||
echo '<strong>Contactgroups:</strong> ';
|
||||
echo implode(', ', $contactGroupList);
|
||||
}
|
||||
|
@ -4,9 +4,9 @@ if (empty($object->hostgroups)) return;
|
||||
|
||||
$list = array();
|
||||
foreach ($object->hostgroups as $name => $alias) {
|
||||
$list[] = $this->qlink($alias, 'monitoring/list/services', array(
|
||||
'hostgroups' => $name
|
||||
));
|
||||
$list[] = '<a href="' . $this->href('monitoring/list/host', array('hostgroups' => $name)) . '">'
|
||||
. $alias
|
||||
. '</a>';
|
||||
}
|
||||
echo '<b>Hostgroups:</b> ' . implode(', ', $list) . "<br />\n";
|
||||
|
||||
|
@ -4,9 +4,9 @@ if (empty($object->servicegroups)) return;
|
||||
|
||||
$list = array();
|
||||
foreach ($object->servicegroups as $name => $alias) {
|
||||
$list[] = $this->qlink($alias, 'monitoring/list/services', array(
|
||||
'servicegroups' => $name
|
||||
));
|
||||
$list[] = '<a href="' . $this->href('monitoring/list/service', array('servicegroups' => $name)) . '">'
|
||||
. $alias
|
||||
. '</a>';
|
||||
}
|
||||
echo '<b>Servicegroups:</b> ' . implode(', ', $list) . "<br />\n";
|
||||
|
||||
|
@ -10,40 +10,39 @@ There are no matching history entries right now
|
||||
<?php else: ?>
|
||||
<?= $this->paginationControl($hhistory, null, null, array('preserve' => $preserve)); ?>
|
||||
<table class="paginatable">
|
||||
<tbody>
|
||||
<?php foreach ($hhistory as $event): ?>
|
||||
<?php
|
||||
<tbody>
|
||||
<?php foreach ($hhistory as $event): ?>
|
||||
<?php
|
||||
|
||||
if ($event->object_type == 'host') {
|
||||
$states = array('up', 'down', 'unreachable', 'unknown', 99 => 'pending', null => 'pending');
|
||||
} else {
|
||||
$states = array('ok', 'warning', 'critical', 'unknown', 99 => 'pending', null => 'pending');
|
||||
}
|
||||
if ($event->object_type == 'host') {
|
||||
$states = array('up', 'down', 'unreachable', 'unknown', 99 => 'pending', null => 'pending');
|
||||
} else {
|
||||
$states = array('ok', 'warning', 'critical', 'unknown', 99 => 'pending', null => 'pending');
|
||||
}
|
||||
|
||||
$row_class = array_key_exists($event->state, $states) ? $states[$event->state] : 'invalid';
|
||||
$row_class = array_key_exists($event->state, $states) ? $states[$event->state] : 'invalid';
|
||||
|
||||
?>
|
||||
<tr class="<?= $row_class ?>"><td class="state"><?= date('d.m. H:i', $event->timestamp ) ?></td>
|
||||
<? if (! $object): ?>
|
||||
<td><?= $this->escape($event->host_name) ?></td>
|
||||
?>
|
||||
<tr class="<?= $row_class ?>"><td class="state"><?= date('d.m. H:i', $event->timestamp ) ?></td>
|
||||
|
||||
<? if (! $object): ?>
|
||||
<td><?= $this->escape($event->host_name) ?></td>
|
||||
<? endif ?>
|
||||
|
||||
<? if (! $object instanceof Monitoring\Object\Service): ?>
|
||||
<td>
|
||||
<? if ($object): ?>
|
||||
<a href="<?= $this->href('monitoring/show/service',array(
|
||||
'host' => $object->host_name,
|
||||
'service' => $event->service_description
|
||||
)); ?>"><?php $event->service_description; ?></a>
|
||||
</a>
|
||||
<? else: ?>
|
||||
<?= $this->escape($event->service_description) ?>
|
||||
<? endif ?>
|
||||
</td>
|
||||
<? endif ?>
|
||||
<? if (! $object instanceof Monitoring\Object\Service): ?>
|
||||
<td><? if ($object): ?>
|
||||
<?= $this->qlink(
|
||||
$event->service_description,
|
||||
'monitoring/show/service',
|
||||
array(
|
||||
'host' => $object->host_name,
|
||||
'service' => $event->service_description
|
||||
)
|
||||
) ?>
|
||||
<? else: ?>
|
||||
<?= $this->escape($event->service_description) ?>
|
||||
<? endif ?>
|
||||
</td>
|
||||
<? endif ?>
|
||||
<td style="padding: 0.2em;"><?php
|
||||
|
||||
<td style="padding: 0.2em;"><?php
|
||||
$imgparams = array(
|
||||
'width' => 16,
|
||||
'height' => 16,
|
||||
@ -80,17 +79,12 @@ switch ($event->type) {
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<? if ($event->attempt !== null): ?>
|
||||
[ <?= $event->attempt ?>/<?=$event->max_attempts ?> ]
|
||||
<? endif ?>
|
||||
<?= $ticket_pattern ? preg_replace(
|
||||
$ticket_pattern,
|
||||
$ticket_link,
|
||||
$this->pluginOutput($event->output)
|
||||
) : $this->pluginOutput($event->output) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<? if ($event->attempt !== null): ?>
|
||||
[ <?= $event->attempt ?>/<?=$event->max_attempts ?> ]
|
||||
<? endif ?>
|
||||
</td>
|
||||
</tr>
|
||||
<? endforeach ?>
|
||||
</tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<? endif ?>
|
||||
|
@ -2,13 +2,12 @@
|
||||
$hostgroupLinkList = array();
|
||||
if (!empty($this->hostgroups)) {
|
||||
foreach ($this->hostgroups as $name => $alias) {
|
||||
$hostgroupLinkList[] = $this->qlink(
|
||||
$alias,
|
||||
'monitoring/list/services',
|
||||
$hostgroupLinkList[] = '<a href="' . $this->href(
|
||||
'monitoring/list/hosts',
|
||||
array(
|
||||
'hostgroups' => $name
|
||||
)
|
||||
);
|
||||
) . '">'.$alias. '</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -27,40 +26,40 @@ $this->partial(
|
||||
<?= $this->preview_image ?>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Plugin output</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->pluginOutput($this->host->host_output); ?>
|
||||
<?= $this->pluginOutput($this->host->host_long_output); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Plugin output</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->pluginOutput($this->host->host_output); ?>
|
||||
<?= $this->pluginOutput($this->host->host_long_output); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Command</span>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Command</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Command:</strong>
|
||||
<?php
|
||||
<div>
|
||||
<strong>Command:</strong>
|
||||
<?php
|
||||
$explodedCommand = explode('!', $this->host->host_check_command, 2);
|
||||
array_shift($explodedCommand);
|
||||
?>
|
||||
<?= $this->commandArguments($this->host->host_check_command); ?>
|
||||
</div>
|
||||
array_shift($explodedCommand);
|
||||
?>
|
||||
<?= $this->commandArguments($this->host->host_check_command); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Groups and Contacts</span>
|
||||
</div>
|
||||
<?php if (count($hostgroupLinkList)): ?>
|
||||
<strong>Hostgroups:</strong>
|
||||
<?= implode(' ', $hostgroupLinkList); ?>
|
||||
<?php endif; ?>
|
||||
<div class="head">
|
||||
<span>Groups and Contacts</span>
|
||||
</div>
|
||||
<?php if (count($hostgroupLinkList)): ?>
|
||||
<strong>Hostgroups:</strong>
|
||||
<?= implode(' ', $hostgroupLinkList); ?>
|
||||
<?php endif; ?>
|
||||
|
||||
<?= $this->render('show/components/contacts.phtml') ?>
|
||||
<?= $this->render('show/components/contacts.phtml') ?>
|
||||
</div>
|
||||
|
||||
<?= $this->render('show/components/comments.phtml'); ?>
|
||||
@ -70,39 +69,39 @@ $this->partial(
|
||||
<?= $this->render('show/components/customvars.phtml'); ?>
|
||||
|
||||
<?php if ($this->host->host_perfdata): ?>
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Perfdata</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->perfdata($this->host->host_perfdata); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Perfdata</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->perfdata($this->host->host_perfdata); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Flags</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/flags.phtml'); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Flags</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/flags.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Properties</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/properties.phtml'); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Properties</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/properties.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Commands</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->monitoringCommands($this->host, 'full'); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Commands</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->monitoringCommands($this->host, 'full'); ?>
|
||||
</div>
|
||||
</div>
|
@ -3,13 +3,12 @@
|
||||
$servicegroupLinkList = array();
|
||||
if (!empty($this->servicegroups)) {
|
||||
foreach ($this->servicegroups as $name => $alias) {
|
||||
$servicegroupLinkList[] = $this->qlink(
|
||||
$alias,
|
||||
$servicegroupLinkList[] = '<a href="' . $this->href(
|
||||
'monitoring/list/services',
|
||||
array(
|
||||
'servicegroups' => $name
|
||||
)
|
||||
);
|
||||
) . '">' . $alias . '</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
@ -26,42 +25,41 @@ $this->partial(
|
||||
?>
|
||||
|
||||
<?= $this->preview_image ?>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Plugin output</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->pluginOutput($this->service->service_output); ?>
|
||||
<?= $this->pluginOutput($this->service->service_long_output); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Plugin output</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->pluginOutput($this->service->service_output); ?>
|
||||
<?= $this->pluginOutput($this->service->service_long_output); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Command</span>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Command</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Command:</strong>
|
||||
<?php
|
||||
<div>
|
||||
<strong>Command:</strong>
|
||||
<?php
|
||||
$explodedCommand = explode('!', $this->service->service_check_command, 2);
|
||||
echo array_shift($explodedCommand);
|
||||
?>
|
||||
<?= $this->commandArguments($this->service->service_check_command); ?>
|
||||
</div>
|
||||
echo array_shift($explodedCommand);
|
||||
?>
|
||||
<?= $this->commandArguments($this->service->service_check_command); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Groups and Contacts</span>
|
||||
</div>
|
||||
<?php if (count($servicegroupLinkList)) { ?>
|
||||
<strong>Servicegroups:</strong>
|
||||
<?= implode(' ', $servicegroupLinkList); ?>
|
||||
<?php } ?>
|
||||
<div class="head">
|
||||
<span>Groups and Contacts</span>
|
||||
</div>
|
||||
<?php if (count($servicegroupLinkList)) { ?>
|
||||
<strong>Servicegroups:</strong>
|
||||
<?= implode(' ', $servicegroupLinkList); ?>
|
||||
<?php } ?>
|
||||
|
||||
<?= $this->render('show/components/contacts.phtml') ?>
|
||||
<?= $this->render('show/components/contacts.phtml') ?>
|
||||
</div>
|
||||
|
||||
<?= $this->render('show/components/comments.phtml'); ?>
|
||||
@ -71,40 +69,40 @@ $this->partial(
|
||||
<?= $this->render('show/components/customvars.phtml'); ?>
|
||||
|
||||
<?php if ($this->service->service_perfdata): ?>
|
||||
<div class="information-container">
|
||||
<div class="information-container">
|
||||
|
||||
<div class="head">
|
||||
<span>Perfdata</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->perfdata($this->service->service_perfdata); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Perfdata</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->perfdata($this->service->service_perfdata); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Flags</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/flags.phtml'); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Flags</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/flags.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Properties</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/properties.phtml'); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Properties</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->render('show/components/properties.phtml'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="information-container">
|
||||
<div class="head">
|
||||
<span>Commands</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->monitoringCommands($this->service, 'full'); ?>
|
||||
</div>
|
||||
<div class="head">
|
||||
<span>Commands</span>
|
||||
</div>
|
||||
<div>
|
||||
<?= $this->monitoringCommands($this->service, 'full'); ?>
|
||||
</div>
|
||||
</div>
|
Loading…
x
Reference in New Issue
Block a user