2012-05-14 13:27:24 +00:00
< ? php
2015-05-16 15:46:30 +00:00
/* Copyright ( C ) 2014 Daniel Preussker < f0o @ devilcode . org >
* This program is free software : you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
2015-07-13 20:10:26 +02:00
*
2015-05-16 15:46:30 +00:00
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
2015-07-13 20:10:26 +02:00
*
2015-05-16 15:46:30 +00:00
* You should have received a copy of the GNU General Public License
2015-07-13 20:10:26 +02:00
* along with this program . If not , see < http :// www . gnu . org / licenses />.
*/
2015-05-16 15:46:30 +00:00
2015-07-13 20:10:26 +02:00
/*
2015-05-16 15:46:30 +00:00
* Custom Frontpage
* @ author f0o < f0o @ devilcode . org >
* @ copyright 2014 f0o , LibreNMS
* @ license GPL
* @ package LibreNMS
* @ subpackage Frontpage
*/
2012-05-14 13:27:24 +00:00
?>
2015-07-22 22:04:33 +01:00
< script src = 'https://www.google.com/jsapi' ></ script >
2015-05-16 15:46:30 +00:00
< ? php
2015-07-22 22:04:33 +01:00
include_once 'includes/object-cache.inc.php' ;
2015-05-16 15:46:30 +00:00
echo ' < div class = " container-fluid " >
2015-07-13 20:10:26 +02:00
< div class = " row " >
< div class = " col-md-8 " >
2015-07-22 22:04:33 +01:00
' ;
include_once 'includes/common/globe.inc.php' ;
echo implode ( ',' , $common_output );
echo '
2015-07-13 20:10:26 +02:00
</ div >
< div class = " col-md-4 " >
< div class = " container-fluid " >
< div class = " row " >
< div class = " col-md-4 " > ' ;
include_once ( " includes/device-summary-vert.inc.php " );
echo ' </ div >
</ div >
< div class = " row " >
< div class = " col-md-4 " > ' ;
include_once ( " includes/front/boxes.inc.php " );
echo ' </ div >
</ div >
</ div >
</ div >
</ div >
< div class = " row " >
< div class = " col-md-12 " > ' ;
$device [ 'device_id' ] = '-1' ;
2015-07-22 22:04:33 +01:00
require_once ( 'includes/common/alerts.inc.php' );
echo implode ( '' , $common_output );
2015-07-13 20:10:26 +02:00
unset ( $device [ 'device_id' ]);
echo ' </ div >
</ div >
2015-05-16 15:46:30 +00:00
</ div > ' ;
//From default.php - This code is not part of above license.
if ( $config [ 'enable_syslog' ]) {
2015-07-13 20:10:26 +02:00
$sql = " SELECT *, DATE_FORMAT(timestamp, ' " . $config [ 'dateformat' ][ 'mysql' ][ 'compact' ] . " ') AS date from syslog ORDER BY seq DESC LIMIT 20 " ;
$query = mysql_query ( $sql );
echo ( ' < div class = " container-fluid " >
2015-05-16 15:46:30 +00:00
< div class = " row " >
< div class = " col-md-12 " >
& nbsp ;
</ div >
</ div >
< div class = " row " >
< div class = " col-md-12 " >
< div class = " panel panel-default panel-condensed " >
< div class = " panel-heading " >
< strong > Syslog entries </ strong >
</ div >
< table class = " table table-hover table-condensed table-striped " > ' );
2012-05-14 13:27:24 +00:00
2015-07-13 20:10:26 +02:00
foreach ( dbFetchRows ( $sql ) as $entry ) {
$entry = array_merge ( $entry , device_by_id_cache ( $entry [ 'device_id' ]));
2012-05-14 13:27:24 +00:00
2015-07-13 20:10:26 +02:00
include 'includes/print-syslog.inc.php' ;
}
echo ( " </table> " );
echo ( " </div> " );
echo ( " </div> " );
echo ( " </div> " );
echo ( " </div> " );
}
else {
2012-05-14 13:27:24 +00:00
2015-07-13 20:10:26 +02:00
if ( $_SESSION [ 'userlevel' ] == '10' ) {
$query = " SELECT *,DATE_FORMAT(datetime, ' " . $config [ 'dateformat' ][ 'mysql' ][ 'compact' ] . " ') as humandate FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15 " ;
}
else {
$query = " SELECT *,DATE_FORMAT(datetime, ' " . $config [ 'dateformat' ][ 'mysql' ][ 'compact' ] . " ') as humandate FROM `eventlog` AS E, devices_perms AS P WHERE E.host =
P . device_id AND P . user_id = " . $_SESSION['user_id'] . " ORDER BY `datetime` DESC LIMIT 0 , 15 " ;
}
2012-05-14 13:27:24 +00:00
2015-07-13 20:10:26 +02:00
$data = mysql_query ( $query );
2015-05-16 15:46:30 +00:00
echo ( ' < div class = " container-fluid " >
< div class = " row " >
< div class = " col-md-12 " >
& nbsp ;
</ div >
</ div >
< div class = " row " >
< div class = " col-md-12 " >
< div class = " panel panel-default panel-condensed " >
< div class = " panel-heading " >
< strong > Eventlog entries </ strong >
</ div >
< table class = " table table-hover table-condensed table-striped " > ' );
2015-07-13 20:10:26 +02:00
foreach ( dbFetchRows ( $query ) as $entry ) {
include 'includes/print-event.inc.php' ;
}
2012-05-14 13:27:24 +00:00
2015-07-13 20:10:26 +02:00
echo ( " </table> " );
echo ( " </div> " );
echo ( " </div> " );
echo ( " </div> " );
echo ( " </div> " );
2012-05-14 13:27:24 +00:00
}