Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tinystatesummary for hosts overview
- Loading branch information
Alexander Fuhr
committed
Nov 14, 2014
1 parent
11bb8db
commit 038964a
Showing
4 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
modules/monitoring/application/views/scripts/list/components/hostssummary.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?php | ||
|
||
use Icinga\Web\Url; | ||
|
||
$selfUrl = 'monitoring/list/hosts'; | ||
$currentUrl = Url::fromRequest()->getRelativeUrl(); | ||
|
||
?> | ||
<h3 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>> | ||
<?= $this->qlink(sprintf($this->translate('%s hosts:'), $this->stats->hosts_total), $selfUrl); ?> | ||
|
||
<?php if($this->stats->hosts_up): ?> | ||
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 0))->getRelativeUrl() ? ' active' : '' ?>"> | ||
<?= $this->qlink( | ||
$this->stats->hosts_up, | ||
$selfUrl, | ||
array('host_state' => 0), | ||
array('title' => $this->translate('Hosts with state UP')) | ||
) ?> | ||
</span> | ||
<?php endif; ?> | ||
|
||
<?php if($this->stats->hosts_down_unhandled): ?> | ||
<span class="state critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : '' ?>"> | ||
<?= $this->qlink( | ||
$this->stats->hosts_down_unhandled, | ||
$selfUrl, | ||
array('host_state' => 1, 'host_unhandled' => 1), | ||
array('title' => $this->translate('Unhandled hosts with state DOWN')) | ||
) ?> | ||
<?php endif; ?> | ||
|
||
<?php if($this->stats->hosts_down_handled > 0): ?> | ||
<span class="state handled critical<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 1, 'host_unhandled' =>0))->getRelativeUrl() ? ' active' : '' ?>"> | ||
<?= $this->qlink( | ||
$this->stats->hosts_down_handled, | ||
$selfUrl, | ||
array('host_state' => 1, 'host_unhandled' => 0), | ||
array('title' => $this->translate('Handled hosts with state DOWN')) | ||
) ?> | ||
</span> | ||
<?php endif; ?> | ||
|
||
<?php if($this->stats->hosts_down): ?> | ||
</span> | ||
<?php endif; ?> | ||
|
||
<?php if($this->stats->hosts_unreachable_unhandled): ?> | ||
<span class="state unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 1))->getRelativeUrl() ? ' active' : '' ?>"> | ||
<?= $this->qlink( | ||
$this->stats->hosts_unreachable_unhandled, | ||
$selfUrl, | ||
array('host_state' => 2, 'host_unhandled' => 1), | ||
array('title' => $this->translate('Unhandled hosts with state UNREACHABLE')) | ||
) ?> | ||
<?php endif; ?> | ||
|
||
<?php if($this->stats->hosts_unreachable_handled > 0): ?> | ||
<span class="state handled unknown<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 2, 'host_unhandled' => 0))->getRelativeUrl() ? ' active' : '' ?>"> | ||
<?= $this->qlink( | ||
$this->stats->hosts_unreachable_handled, | ||
$selfUrl, | ||
array('host_state' => 2, 'host_unhandled' => 0), | ||
array('title' => $this->translate('Handled hosts with state UNREACHABLE')) | ||
) ?> | ||
</span> | ||
<?php endif; ?> | ||
|
||
<?php if($this->stats->hosts_unreachable): ?> | ||
</span> | ||
<?php endif; ?> | ||
|
||
<?php if($this->stats->hosts_pending): ?> | ||
<span class="state pending<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 99))->getRelativeUrl() ? ' active' : '' ?>"> | ||
<?= $this->qlink( | ||
$this->stats->hosts_pending, | ||
$selfUrl, | ||
array('host_state' => 99), | ||
array('title' => $this->translate('Hosts with state PENDING')) | ||
) ?> | ||
</span> | ||
<?php endif; ?> | ||
</h3> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters