summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/index/index.phtml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:14:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-14 13:14:28 +0000
commitda18060bb217647c09ad22013f620f474fb867d0 (patch)
tree96906f4dd33b7b5660460372269b180af564d982 /application/views/scripts/index/index.phtml
parentInitial commit. (diff)
downloadicingaweb2-module-boxydash-da18060bb217647c09ad22013f620f474fb867d0.tar.xz
icingaweb2-module-boxydash-da18060bb217647c09ad22013f620f474fb867d0.zip
Adding upstream version 0.0.1+20160321.upstream/0.0.1+20160321upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/views/scripts/index/index.phtml')
-rw-r--r--application/views/scripts/index/index.phtml84
1 files changed, 84 insertions, 0 deletions
diff --git a/application/views/scripts/index/index.phtml b/application/views/scripts/index/index.phtml
new file mode 100644
index 0000000..6ae2282
--- /dev/null
+++ b/application/views/scripts/index/index.phtml
@@ -0,0 +1,84 @@
+<?
+use Icinga\Module\Monitoring\Object\Service;
+use Icinga\Module\Monitoring\Object\Host;
+
+
+?>
+
+<div class="controls">
+ <?php if (! $this->compact): ?>
+ <?= $tabs; ?>
+ <?php endif ?>
+</div>
+
+
+<div class="content">
+
+ <h1>Boxy Dashboard</h1>
+ <? if ($this->showlegend){ ?>
+ <div class="boxy_legend">
+ <span class="boxy_sublegend">
+ <span class="legendtext">&#10004; = Acknowledged</span>
+ <span class="legendtext">&#8986; = In Downtime</span>
+ <span class="legendtext">&#8632; = Host Issue Acknowledged</span>
+ </span>
+ <span class="boxy_sublegend">
+ <span class="legendtext">Status:</span>
+ <span class="boxy_legend_box ok" >ok</span>
+ <span class="boxy_legend_box warning" >warning</span>
+ <span class="boxy_legend_box critical" >critical</span>
+ <span class="boxy_legend_box unknown" >unknown</span>
+ </span>
+ <span class="boxy_sublegend">
+ <span class="legendtext" >Acknowledged:</span>
+ <span class="boxy_legend_box warning-ack" >warning</span>
+ <span class="boxy_legend_box critical-ack" >critical</span>
+ <span class="boxy_legend_box unknown-ack" >unknown</span>
+ </span>
+ </div>
+ <? } ?>
+<h2>Host Info</h2>
+<?
+foreach ($this->hosts as $host){
+ $title = htmlspecialchars($host->{'host_display_name'});
+ $size=$this->boxsize;
+ $content="&nbsp;";
+ $returncode=$host->{'host_state_text'};
+ if ($host->{'host_acknowledged'}==1 ){
+ $returncode.="-ack";
+ $content= "&#10004;";
+ $title.=" (Acknowledged)";
+ }?>
+ <a href='<?= $this->path_prefix ?>/monitoring/host/show?host=<?=$host->{'host_name'}?>' class='boxy_box state <?=$returncode?>' style='width:<?=$size?>px; height:<?=$size?>px; font-size:<?=$size?>px;' title="<?=$title?>"><?=$content?></a>
+<? } ?>
+
+<br clear="all"/>
+<h2>Service Info</h2>
+
+<? foreach ($this->services as $service){
+ $service->{'service_hard_state'} = ($service->{'service_hard_state'}) ? "hard" : "soft";
+ $title = $service->{'host_display_name'}.": ".$service->{'service_description'};
+ #."(".$service->{'current_check_attempt'} .",".$service->{'max_check_attempts'} .")(". $service->{'service_hard_state'}.")+acked:".$service->{'service_acknowledged'} ;
+ $size=$this->boxsize;
+ $content="&nbsp;";
+ $returncode=$service->{'service_state_text'};
+ if ($service->{'service_in_downtime'}==1 or $service->{'host_in_downtime'}==1 ){
+ $returncode.="-downtime";
+ $content= "&#8986;";
+ $title.=" (Scheduled Maintenance)";
+ }elseif ($service->{'service_acknowledged'}==1 ){
+ $returncode.="-ack";
+ $content= "&#10004;";
+ $title.=" (Acknowledged)";
+ }elseif ($service->{'service_state_text'} != "ok" && $service->{'host_acknowledged'} == 1 ){
+ $returncode.="-ack";
+ $content= "&#8632;";
+ $title.=" (Host Issue Acknowledged)";
+ }
+ $title=htmlspecialchars($title."\n ".$service->{'service_output'});?>
+ <a href='<?= $this->path_prefix ?>/monitoring/service/show?host=<?=$service->{'host_name'}?>&service=<?=$service->{'service_description'}?>' class='boxy_box state <?=$returncode?>' style='width:<?=$size?>px; height:<?=$size?>px; font-size:<?=$size?>px;' title="<?=$title?>"><?=$content?></a>
+
+<? } ?>
+<br clear=all>
+<pre style="font-size:20px"><?=$this->debug?></pre>
+</div>