mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #664 from Rosiak/PollLog1
Add Polling Information Page
This commit is contained in:
@@ -454,18 +454,24 @@ if ($_SESSION['userlevel'] >= '10')
|
|||||||
<li><a href="authlog/"><img src="images/16/lock.png" border="0" align="absmiddle" /> Authlog</a></li>
|
<li><a href="authlog/"><img src="images/16/lock.png" border="0" align="absmiddle" /> Authlog</a></li>
|
||||||
<li role="presentation" class="divider"></li>
|
<li role="presentation" class="divider"></li>
|
||||||
');
|
');
|
||||||
if($config['distributed_poller'] === TRUE) {
|
|
||||||
echo('
|
echo('
|
||||||
<li class="dropdown-submenu">
|
<li class="dropdown-submenu">
|
||||||
<a href="#"><img src="images/16/clock.png" alt="Pollers" width="16" height="16" /> Pollers</a>
|
<a href="#"><img src="images/16/clock.png" alt="Pollers" width="16" height="16" /> Pollers</a>
|
||||||
<ul class="dropdown-menu scrollable-menu">
|
<ul class="dropdown-menu scrollable-menu">
|
||||||
|
<li><a href="/poll-log/"><img src="images/16/information.png" alt="Poll-log" width="16" height="16" /> Poll-log</a></li>
|
||||||
|
|
||||||
|
');
|
||||||
|
if($config['distributed_poller'] === TRUE) {
|
||||||
|
echo ('
|
||||||
<li><a href="/pollers/tab=pollers/"><img src="images/16/clock_link.png" alt="Pollers" width="16" height="16" /> Pollers</a></li>
|
<li><a href="/pollers/tab=pollers/"><img src="images/16/clock_link.png" alt="Pollers" width="16" height="16" /> Pollers</a></li>
|
||||||
<li><a href="/pollers/tab=groups/"><img src="images/16/clock_add.png" alt="Groups" width="16" height="16" /> Groups</a></li>
|
<li><a href="/pollers/tab=groups/"><img src="images/16/clock_add.png" alt="Groups" width="16" height="16" /> Groups</a></li>
|
||||||
|
');
|
||||||
|
}
|
||||||
|
echo ('
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<li role="presentation" class="divider"></li>
|
<li role="presentation" class="divider"></li>
|
||||||
');
|
');
|
||||||
}
|
|
||||||
|
|
||||||
echo('
|
echo('
|
||||||
<li class="dropdown-submenu">
|
<li class="dropdown-submenu">
|
||||||
|
36
html/pages/poll-log.inc.php
Normal file
36
html/pages/poll-log.inc.php
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
if ($_SESSION['userlevel'] >= '10') {
|
||||||
|
$sql = "SELECT D.device_id,D.hostname, D.last_polled, D.last_polled_timetaken FROM devices AS D WHERE D.status ='1' AND D.ignore='0' AND D.disabled='0' ORDER BY hostname";
|
||||||
|
$result = mysql_query($sql);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$sql = "SELECT D.device_id,D.hostname, D.last_polled, D.last_polled_timetaken FROM devices AS D, devices_perms AS P WHERE D.status ='1' AND D.ignore='0' AND D.disabled='0' AND D.device_id = P.device_id AND P.user_id = '" . $_SESSION['user_id'] . "' AND D.ignore = '0' ORDER BY hostname";
|
||||||
|
$result = mysql_query($sql);
|
||||||
|
}
|
||||||
|
echo "
|
||||||
|
<table class='table table-bordered table-condensed table-hover'>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Hostname</th>
|
||||||
|
<th>Last Polled</th>
|
||||||
|
<th>Polling Duration(Seconds)</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>";
|
||||||
|
|
||||||
|
foreach(dbFetchRows($sql) as $device) {
|
||||||
|
if ($device['last_polled_timetaken'] < 180 ) {
|
||||||
|
$tr_class = NULL;
|
||||||
|
}
|
||||||
|
elseif ($device['last_polled_timetaken'] < 300 ) {
|
||||||
|
$tr_class = ' class="warning"';
|
||||||
|
}
|
||||||
|
elseif ($device['last_polled_timetaken'] >= 300 ) {
|
||||||
|
$tr_class = ' class="danger"';
|
||||||
|
}
|
||||||
|
echo "<tr" .$tr_class. "><td><a class='list-device' href='" .generate_device_url($device, array('tab' => 'graphs', 'group' => 'poller')). "'>" .$device['hostname']. "</a><td>" .$device['last_polled']. "<td>" .$device['last_polled_timetaken']. "</tr>";
|
||||||
|
}
|
||||||
|
echo "</tbody></table>";
|
||||||
|
|
||||||
|
?>
|
Reference in New Issue
Block a user