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