1<?php
2
3/**
4 * Observium
5 *
6 *   This file is part of Observium.
7 *
8 * @package        observium
9 * @subpackage     webui
10 * @copyright  (C) 2006-2013 Adam Armstrong, (C) 2013-2019 Observium Limited
11 *
12 */
13
14echo generate_box_open(array('box-class' => 'hidden-xl'));
15
16echo('<table class="table table-condensed table-striped table-hover">');
17
18if ($config['overview_show_sysDescr'])
19{
20  echo('<tr><td colspan=2 style="padding: 10px;"><strong><i>' . escape_html($device['sysDescr']) . "</i></strong></td></tr>");
21}
22
23if ($device['purpose'])
24{
25  echo('<tr>
26        <td class="entity">Description</td>
27        <td>' . escape_html($device['purpose']) . '</td>
28      </tr>');
29}
30
31if ($device['hardware'])
32{
33  if ($device['vendor'])
34  {
35    echo('<tr>
36          <td class="entity">Vendor/Hardware</td>
37          <td>' . escape_html($device['vendor'].' '.$device['hardware']) . '</td>
38        </tr>');
39  } else {
40    echo('<tr>
41          <td class="entity">Hardware</td>
42          <td>' . escape_html($device['hardware']) . '</td>
43        </tr>');
44  }
45}
46else if ($device['vendor'])
47{
48  // Only Vendor exist
49  echo('<tr>
50        <td class="entity">Vendor</td>
51        <td>' . escape_html($device['vendor']) . '</td>
52      </tr>');
53}
54
55if ($device['os'] != 'generic')
56{
57  echo('<tr>
58        <td class="entity">Operating system</td>
59        <td>' . escape_html($device['os_text']) . ' ' . escape_html($device['version']) . ($device['features'] ? ' (' . escape_html($device['features']) . ')' : '') . ' </td>
60      </tr>');
61}
62
63if ($device['sysName'])
64{
65  echo('<tr>
66        <td class="entity">System name</td>');
67  echo('
68        <td>' . escape_html($device['sysName']). '</td>
69      </tr>');
70}
71
72if ($device['sysContact'])
73{
74  echo('<tr>
75        <td class="entity">Contact</td>');
76  if (get_dev_attrib($device,'override_sysContact_bool'))
77  {
78    echo('
79        <td>' . escape_html(get_dev_attrib($device,'override_sysContact_string')) . '</td>
80      </tr>
81      <tr>
82        <td class="entity">SNMP Contact</td>');
83  }
84  echo('
85        <td>' . escape_html($device['sysContact']). '</td>
86      </tr>');
87}
88
89if ($device['location'])
90{
91  echo('<tr>
92        <td class="entity">Location</td>
93        <td>' . escape_html($device['location']) . '</td>
94      </tr>');
95  if (get_dev_attrib($device,'override_sysLocation_bool') && !empty($device['real_location']))
96  {
97    echo('<tr>
98        <td class="entity">SNMP Location</td>
99        <td>' . escape_html($device['real_location']) . '</td>
100      </tr>');
101  }
102}
103
104if ($device['asset_tag'])
105{
106  echo('<tr>
107        <td class="entity">Asset tag</td>
108        <td>' . escape_html($device['asset_tag']) . '</td>
109      </tr>');
110}
111
112if ($device['serial'])
113{
114  echo('<tr>
115        <td class="entity">Serial</td>
116        <td>' . escape_html($device['serial']) . '</td>
117      </tr>');
118}
119
120if ($device['state']['la']['5min'])
121{
122  if ($device['state']['la']['5min'] > 10)
123  {
124    $la_class = 'text-danger';
125  }
126  else if ($device['state']['la']['5min'] > 4)
127  {
128    $la_class = 'text-warning';
129  } else {
130    $la_class = '';
131  }
132  echo('<tr>
133        <td class="entity">Load average</td>
134        <td class="'.$la_class.'">' . $device['state']['la']['1min'] . ', ' . $device['state']['la']['5min'] . ', ' . $device['state']['la']['15min'] . '</td>
135      </tr>');
136}
137
138if ($device['uptime'])
139{
140  echo('<tr>
141        <td class="entity">Uptime</td>
142        <td>' . deviceUptime($device) . '</td>
143      </tr>');
144}
145if (FALSE &&
146    $device['status_type'] && $device['status_type'] != 'ok')
147{
148  if ($device['status_type'] == 'ping')
149  {
150    $reason = 'not Pingable';
151  }
152  else if ($device['status_type'] == 'snmp')
153  {
154    $reason = 'not SNMPable';
155  }
156  else if ($device['status_type'] == 'dns')
157  {
158    $reason = 'DNS hostname unresolved';
159  }
160
161  echo('<tr>
162        <td class="entity">Down reason</td>
163        <td>' . $reason . '</td>
164      </tr>');
165}
166
167if ($device['last_rebooted'])
168{
169  echo('<tr>
170        <td class="entity">Last reboot</td>
171        <td>' . format_unixtime($device['last_rebooted']) . '</td>
172      </tr>');
173}
174
175echo("</table>");
176echo generate_box_close();
177
178// EOF
179