summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/index/index.phtml
blob: 6ae228255bee4007446c9f7949e1922cb0a460d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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>