diff options
Diffstat (limited to 'application/views/scripts/index/index.phtml')
-rw-r--r-- | application/views/scripts/index/index.phtml | 84 |
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">✔ = Acknowledged</span> + <span class="legendtext">⌚ = In Downtime</span> + <span class="legendtext">↸ = 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=" "; + $returncode=$host->{'host_state_text'}; + if ($host->{'host_acknowledged'}==1 ){ + $returncode.="-ack"; + $content= "✔"; + $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=" "; + $returncode=$service->{'service_state_text'}; + if ($service->{'service_in_downtime'}==1 or $service->{'host_in_downtime'}==1 ){ + $returncode.="-downtime"; + $content= "⌚"; + $title.=" (Scheduled Maintenance)"; + }elseif ($service->{'service_acknowledged'}==1 ){ + $returncode.="-ack"; + $content= "✔"; + $title.=" (Acknowledged)"; + }elseif ($service->{'service_state_text'} != "ok" && $service->{'host_acknowledged'} == 1 ){ + $returncode.="-ack"; + $content= "↸"; + $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> |