-';
-
-unset($common_output);
-$common_output[] = $temp_output;
diff --git a/includes/html/common/globe.inc.php b/includes/html/common/globe.inc.php
deleted file mode 100644
index 312692d9bf..0000000000
--- a/includes/html/common/globe.inc.php
+++ /dev/null
@@ -1,106 +0,0 @@
-
- * 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.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/*
- * Custom Frontpage
- * @author f0o
- * @copyright 2014 f0o, LibreNMS
- * @license GPL
- * @package LibreNMS
- * @subpackage Frontpage
- */
-
-$temp_output .= "
-
-
-";
-
-unset($common_output);
-$common_output[] = $temp_output;
diff --git a/includes/html/front/boxes.inc.php b/includes/html/front/boxes.inc.php
deleted file mode 100644
index 28d85c82d6..0000000000
--- a/includes/html/front/boxes.inc.php
+++ /dev/null
@@ -1,32 +0,0 @@
-
- *
- * 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. Please see LICENSE.txt at the top level of
- * the source code distribution for details.
- */
-
-echo '
-
\n";
diff --git a/includes/html/front/top_device_bits.inc.php b/includes/html/front/top_device_bits.inc.php
deleted file mode 100644
index 6903a7caa4..0000000000
--- a/includes/html/front/top_device_bits.inc.php
+++ /dev/null
@@ -1,53 +0,0 @@
-
- *
- * 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. Please see LICENSE.txt at the top level of
- * the source code distribution for details.
- */
-
-$minutes = 15;
-$seconds = ($minutes * 60);
-$top = \LibreNMS\Config::get('front_page_settings.top.devices');
-if (Auth::user()->hasGlobalRead()) {
- $query = "
- SELECT *, sum(p.ifInOctets_rate + p.ifOutOctets_rate) as total
- FROM ports as p, devices as d
- WHERE d.device_id = p.device_id
- AND unix_timestamp() - p.poll_time < $seconds
- AND ( p.ifInOctets_rate > 0
- OR p.ifOutOctets_rate > 0 )
- GROUP BY d.device_id
- ORDER BY total desc
- LIMIT $top
- ";
-} else {
- $query = "
- SELECT *, sum(p.ifInOctets_rate + p.ifOutOctets_rate) as total
- FROM ports as p, devices as d, `devices_perms` AS `P`
- WHERE `P`.`user_id` = ? AND `P`.`device_id` = `d`.`device_id` AND
- d.device_id = p.device_id
- AND unix_timestamp() - p.poll_time < $seconds
- AND ( p.ifInOctets_rate > 0
- OR p.ifOutOctets_rate > 0 )
- GROUP BY d.device_id
- ORDER BY total desc
- LIMIT $top
- ";
- $param[] = array(Auth::id());
-}//end if
-
-echo "Top $top devices (last $minutes minutes)\n";
-echo "
\n";
-foreach (dbFetchRows($query, $param) as $result) {
- echo '
\n";
diff --git a/includes/html/front/top_ports.inc.php b/includes/html/front/top_ports.inc.php
deleted file mode 100644
index 014839e16d..0000000000
--- a/includes/html/front/top_ports.inc.php
+++ /dev/null
@@ -1,56 +0,0 @@
-
- *
- * 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. Please see LICENSE.txt at the top level of
- * the source code distribution for details.
- */
-
-$minutes = 15;
-$seconds = ($minutes * 60);
-$top = \LibreNMS\Config::get('front_page_settings.top.ports');
-if (Auth::user()->hasGlobalRead()) {
- $query = "
- SELECT *, p.ifInOctets_rate + p.ifOutOctets_rate as total
- FROM ports as p, devices as d
- WHERE d.device_id = p.device_id
- AND unix_timestamp() - p.poll_time < $seconds
- AND ( p.ifInOctets_rate > 0
- OR p.ifOutOctets_rate > 0 )
- ORDER BY total desc
- LIMIT $top
- ";
-} else {
- $query = "
- SELECT *, I.ifInOctets_rate + I.ifOutOctets_rate as total
- FROM ports as I, devices as d,
- `devices_perms` AS `P`, `ports_perms` AS `PP`
- WHERE ((`P`.`user_id` = ? AND `P`.`device_id` = `d`.`device_id`) OR (`PP`.`user_id` = ? AND `PP`.`port_id` = `I`.`port_id` AND `I`.`device_id` = `d`.`device_id`)) AND
- d.device_id = I.device_id
- AND unix_timestamp() - I.poll_time < $seconds
- AND ( I.ifInOctets_rate > 0
- OR I.ifOutOctets_rate > 0 )
- ORDER BY total desc
- LIMIT $top
- ";
- $param[] = array(
- Auth::id(),
- Auth::id(),
- );
-}//end if
-
-echo "Top $top ports (last $minutes minutes)\n";
-echo "
- Overview pages have changed to a new format, this page will not be converted to the new format and will be removed in the next release (1.59).
- For more info, see: https://t.libren.ms/overview
-
';
-
-$count_boxes = 0;
-
-// Device down boxes
-if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0' LIMIT " . Config::get('front_page_down_box_limit');
-} else {
- $sql = "SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . Auth::id() . "' AND D.status = '0' AND D.ignore = '0' LIMIT" . Config::get('front_page_down_box_limit');
-}
-
-foreach (dbFetchRows($sql) as $device) {
- generate_front_box(
- 'device-down',
- generate_device_link($device, shorthost($device['hostname'])) . '
- Device Down
- ' . truncate($device['location'], 20) . ''
- );
- ++$count_boxes;
-}
-
-if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0' AND `D`.`status` = '1' LIMIT " . Config::get('front_page_down_box_limit');
-} else {
- $sql = "SELECT * FROM `ports` AS I, `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . Auth::id() . "' AND I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0' AND `D`.`status` = '1' LIMIT " . Config::get('front_page_down_box_limit');
-}
-
-// These things need to become more generic, and more manageable across different frontpages... rewrite inc :>
-// Port down boxes
-if (Config::get('warn.ifdown')) {
- foreach (dbFetchRows($sql) as $interface) {
- if (!$interface['deleted']) {
- $interface = cleanPort($interface);
- generate_front_box(
- 'alert alert-danger',
- generate_device_link($interface, shorthost($interface['hostname'])) . "
- Port Down
-
- " . generate_port_link($interface, substr(makeshortif($interface['label']), 0, 13)) . '
- ' . ($interface['ifAlias'] ? '' . substr($interface['ifAlias'], 0, 20) . '' : '')
- );
- ++$count_boxes;
- }
- }
-}
-
-/*
- FIXME service permissions? seem nonexisting now.. */
-// Service down boxes
-if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = '2' AND D.ignore = '0' AND S.service_ignore = '0' LIMIT " . Config::get('front_page_down_box_limit');
- $param[] = '';
-} else {
- $sql = "SELECT * FROM services AS S, devices AS D, devices_perms AS P WHERE P.`user_id` = ? AND P.`device_id` = D.`device_id` AND S.`device_id` = D.`device_id` AND S.`service_ignore` = '0' AND S.`service_disabled` = '0' AND S.`service_status` = '2' LIMIT " . Config::get('front_page_down_box_limit');
- $param[] = Auth::id();
-}
-
-foreach (dbFetchRows($sql, $param) as $service) {
- generate_front_box(
- 'service-down',
- generate_device_link($service, shorthost($service['hostname'])) . '
- Service Down
- ' . $service['service_type'] . '
- ' . truncate($interface['ifAlias'], 20) . ''
- );
- ++$count_boxes;
-}
-
-// BGP neighbour down boxes
-if (Config::get('enable_bgp')) {
- if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus != 'start' AND bgpPeerState != 'established' AND bgpPeerState != '' AND B.device_id = D.device_id AND D.ignore = 0 AND `D`.`status` = '1' LIMIT " . Config::get('front_page_down_box_limit');
- } else {
- $sql = "SELECT * FROM `devices` AS D, bgpPeers AS B, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . Auth::id() . "' AND bgpPeerAdminStatus != 'start' AND bgpPeerState != 'established' AND bgpPeerState != '' AND B.device_id = D.device_id AND D.ignore = 0 AND `D`.`status` = '1' LIMIT " . Config::get('front_page_down_box_limit');
- }
-
- foreach (dbFetchRows($sql) as $peer) {
- generate_front_box(
- 'bgp-down',
- generate_device_link($peer, shorthost($peer['hostname'])) . "
- BGP Down
- " . $peer['bgpPeerIdentifier'] . '
- AS' . substr($peer['bgpPeerRemoteAs'] . ' ' . $peer['astext'], 0, 14) . ''
- );
- ++$count_boxes;
- }
-}
-
-// Device rebooted boxes
-if (filter_var(Config::get('uptime_warning'), FILTER_VALIDATE_FLOAT) !== false && Config::get('uptime_warning') > 0 && !Config::get("os.{$device['os']}.bad_uptime")) {
- if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM `devices` AS D WHERE D.status = '1' AND D.uptime > 0 AND D.uptime < '" . Config::get('uptime_warning') . "' AND D.ignore = 0 LIMIT " . Config::get('front_page_down_box_limit');
- } else {
- $sql = "SELECT * FROM `devices` AS D, devices_perms AS P WHERE D.device_id = P.device_id AND P.user_id = '" . Auth::id() . "' AND D.status = '1' AND D.uptime > 0 AND D.uptime < '" . Config::get('uptime_warning') . "' AND D.ignore = 0 LIMIT " . Config::get('front_page_down_box_limit');
- }
-
- foreach (dbFetchRows($sql) as $device) {
- generate_front_box(
- 'device-rebooted',
- generate_device_link($device, shorthost($device['hostname'])) . '
- Device Rebooted
- ' . formatUptime($device['uptime'], 'short') . ''
- );
- ++$count_boxes;
- }
-}
-
-if ($count_boxes == 0) {
- echo "
Nothing here yet
This is where status notifications about devices and services would normally go. You might have none
- because you run such a great network, or perhaps you've just started using " . Config::get('project_name') . ". If you're new to " . Config::get('project_name') . ', you might
- want to start by adding one or more devices in the Devices menu.
';
-} else {
- if (Auth::user()->hasGlobalRead()) {
- $query = "SELECT *,DATE_FORMAT(datetime, '" . Config::get('dateformat.mysql.compact') . "') as humandate FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15";
- $alertquery = 'SELECT devices.device_id,name,state,time_logged FROM alert_log LEFT JOIN devices ON alert_log.device_id=devices.device_id LEFT JOIN alert_rules ON alert_log.rule_id=alert_rules.id ORDER BY `time_logged` DESC LIMIT 0,15';
- } else {
- $query = "SELECT *,DATE_FORMAT(datetime, '" . Config::get('dateformat.mysql.compact') . "') as humandate FROM `eventlog` AS E, devices_perms AS P WHERE E.host = P.device_id AND P.user_id = " . Auth::id() . ' ORDER BY `datetime` DESC LIMIT 0,15';
- $alertquery = 'SELECT devices.device_id,name,state,time_logged FROM alert_log LEFT JOIN devices ON alert_log.device_id=devices.device_id LEFT JOIN alert_rules ON alert_log.rule_id=alert_rules.id RIGHT JOIN devices_perms ON alert_log.device_id = devices_perms.device_id AND devices_perms.user_id = ' . Auth::id() . ' ORDER BY `time_logged` DESC LIMIT 0,15';
- }
-
- echo '
-
-
-
-
-
-
-
-
-
- Alertlog entries
-
-
';
-
- foreach (dbFetchRows($alertquery) as $alert_entry) {
- include 'includes/html/print-alerts.inc.php';
- }
-
- echo '
-
-
-
-
-
- Eventlog entries
-
-
';
-
- foreach (dbFetchRows($query) as $entry) {
- include 'includes/html/print-event.inc.php';
- }
-
- echo '
- Overview pages have changed to a new format, this page will not be converted to the new format and will be removed in the next release (1.59).
- For more info, see: https://t.libren.ms/overview
-
- '0' AND A.attrib_value < '86400'";
-
-foreach (dbFetchRows($sql) as $device) {
- unset($already);
- $i = 0;
- while ($i <= count($nodes)) {
- $thisnode = $device['device_id'];
- if ($nodes[$i] == $thisnode) {
- $already = 'yes';
- }
-
- $i++;
- }
-
- if (!$already) {
- $nodes[] = $device['device_id'];
- }
-}
-
-$sql = "SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'";
-foreach (dbFetchRows($sql) as $device) {
- if (device_permitted($device['device_id'])) {
- echo "
- ".generate_device_link($device, shorthost($device['hostname']))."
- Device Down
- ".truncate($device['location'], 35).'
-
';
- }
-}
-
-if (\LibreNMS\Config::get('warn.ifdown')) {
- $sql = "SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'";
- foreach (dbFetchRows($sql) as $interface) {
- if (port_permitted($interface['port_id'])) {
- echo "
- ".generate_device_link($interface, shorthost($interface['hostname']))."
- Port Down
- ".generate_port_link($interface, makeshortif($interface['ifDescr'])).'
- '.truncate($interface['ifAlias'], 15).'
-
';
- }
- }
-}
-
-$sql = "SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'";
-foreach (dbFetchRows($sql) as $service) {
- if (device_permitted($service['device_id'])) {
- echo "
- ".generate_device_link($service, shorthost($service['hostname']))."
- Service Down
- ".$service['service_type'].'
- '.truncate($interface['ifAlias'], 15).'
-
';
- }
-}
-
-$sql = "SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus = 'start' AND bgpPeerState != 'established' AND B.device_id = D.device_id";
-foreach (dbFetchRows($sql) as $peer) {
- if (device_permitted($peer['device_id'])) {
- echo "
- ";
-
-$sql = "SELECT *, DATE_FORMAT(timestamp, '" . \LibreNMS\Config::get('dateformat.mysql.compact') . "') AS date from `syslog` ORDER BY seq DESC LIMIT 20";
-echo '
- Overview pages have changed to a new format, this page will not be converted to the new format and will be removed in the next release (1.59).
- For more info, see: https://t.libren.ms/overview
-
-
-
-
-
-
Devices with Alerts
Host
Int
Srv
-?>
- '0' AND A.attrib_value < '86400'";
-
-foreach (dbFetchRows($sql) as $device) {
- unset($already);
- $i = 0;
- while ($i <= count($nodes)) {
- $thisnode = $device['device_id'];
- if ($nodes[$i] == $thisnode) {
- $already = 'yes';
- }
-
- $i++;
- }
-
- if (!$already) {
- $nodes[] = $device['device_id'];
- }
-}
-
-$sql = "SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'";
-foreach (dbFetchRows($sql) as $device) {
- echo "
-
".generate_device_link($device, shorthost($device['hostname']))."
- Device Down
- ".truncate($device['location'], 20).'
-
';
-}
-
-$sql = "SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'";
-foreach (dbFetchRows($sql) as $interface) {
- echo "
-
".generate_device_link($interface, shorthost($interface['hostname']))."
- Port Down
- ".generate_port_link($interface, makeshortif($interface['ifDescr'])).'
- '.truncate($interface['ifAlias'], 20).'
-
';
-}
-
-$sql = "SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'";
-foreach (dbFetchRows($sql) as $service) {
- echo "
-
".generate_device_link($service, shorthost($service['hostname']))."
- Service Down
- ".$service['service_type'].'
- '.truncate($interface['ifAlias'], 20).'
-
';
-}
-
-$sql = "SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerState != 'established' AND B.device_id = D.device_id";
-foreach (dbFetchRows($sql) as $peer) {
- echo "
-
- ";
-
-$sql = "SELECT *, DATE_FORMAT(timestamp, '" . \LibreNMS\Config::get('dateformat.mysql.compact') . "') AS date from syslog ORDER BY timestamp DESC LIMIT 20";
-echo '
';
-foreach (dbFetchRows($sql) as $entry) {
- unset($syslog_output);
- include 'includes/html/print-syslog.inc.php';
- echo $syslog_output;
-}
-
-echo '
';
-
-echo '
-
-
-
';
-
-// this stuff can be customised to show whatever you want....
-if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'L2TP: %' AND I.device_id = D.device_id AND D.hostname LIKE '%";
- $sql .= \LibreNMS\Config::get('mydomain') . "' ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['l2tp'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id AND D.hostname LIKE '%";
- $sql .= \LibreNMS\Config::get('mydomain') . "' ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['transit'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'Server: thlon-pbx%' AND I.device_id = D.device_id AND D.hostname LIKE '%";
- $sql .= \LibreNMS\Config::get('mydomain') . "' ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['voip'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- if ($ports['transit']) {
- echo "', CENTER, LEFT, FGCOLOR, '#e5e5e5', BGCOLOR, '#e5e5e5', WIDTH, 400, HEIGHT, 250);\" onmouseout=\"return nd();\" >" . "
- Overview pages have changed to a new format, this page will not be converted to the new format and will be removed in the next release (1.59).
- For more info, see: https://t.libren.ms/overview
-
-
-
- * 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.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-
-/*
- * Custom Frontpage
- * @author f0o
- * @copyright 2014 f0o, LibreNMS
- * @license GPL
- * @package LibreNMS
- * @subpackage Frontpage
- */
-
-?>
-
-
-
-
-
';
-
-//From default.php - This code is not part of above license.
-if (\LibreNMS\Config::get('enable_syslog')) {
- $sql = "SELECT *, DATE_FORMAT(timestamp, '" . \LibreNMS\Config::get('dateformat.mysql.compact') . "') AS date from syslog ORDER BY seq DESC LIMIT 20";
- echo('
");
-} else {
- if (Auth::user()->hasGlobalAdmin()) {
- $query = "SELECT *,DATE_FORMAT(datetime, '" . \LibreNMS\Config::get('dateformat.mysql.compact') . "') as humandate FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15";
- } else {
- $query = "SELECT *,DATE_FORMAT(datetime, '" . \LibreNMS\Config::get('dateformat.mysql.compact') . "') as humandate FROM `eventlog` AS E, devices_perms AS P WHERE E.host =
- P.device_id AND P.user_id = " . Auth::id() . " ORDER BY `datetime` DESC LIMIT 0,15";
- }
-
- echo('
-
-
-
-
-
-
-
-
-
- Eventlog entries
-
-
');
-
- foreach (dbFetchRows($query) as $entry) {
- include 'includes/html/print-event.inc.php';
- }
-
- echo("
- Overview pages have changed to a new format, this page will not be converted to the new format and will be removed in the next release (1.59).
- For more info, see: https://t.libren.ms/overview
-
-
-
-
-
- 0) {
- $uptimesql = " AND A.attrib_value < '" . Config::get('uptime_warning') . "'";
-}
-
-$sql = "SELECT * FROM `devices` AS D, `devices_attribs` AS A WHERE D.status = '1' AND A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value > '0' ".$uptimesql;
-
-foreach (dbFetchRows($sql) as $device) {
- unset($already);
- $i = 0;
- while ($i <= count($nodes)) {
- $thisnode = $device['device_id'];
- if ($nodes[$i] == $thisnode) {
- $already = 'yes';
- }
-
- $i++;
- }
-
- if (!$already) {
- $nodes[] = $device['device_id'];
- }
-}
-
-$sql = "SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'";
-foreach (dbFetchRows($sql) as $device) {
- if (device_permitted($device['device_id'])) {
- echo "
- ".generate_device_link($device, shorthost($device['hostname']))."
- Device Down
- ".truncate($device['location'], 35).'
-
';
- }
-}
-
-if (Config::get('warn.ifdown')) {
- $sql = "SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'";
- foreach (dbFetchRows($sql) as $interface) {
- if (port_permitted($interface['port_id'])) {
- echo "
- ".generate_device_link($interface, shorthost($interface['hostname']))."
- Port Down
- ".generate_port_link($interface, makeshortif($interface['ifDescr'])).'
- '.truncate($interface['ifAlias'], 15).'
-
';
- }
- }
-}
-
-$sql = "SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'";
-foreach (dbFetchRows($sql) as $service) {
- if (device_permitted($service['device_id'])) {
- echo "
- ".generate_device_link($service, shorthost($service['hostname']))."
- Service Down
- ".$service['service_type'].'
- '.truncate($interface['ifAlias'], 15).'
-
';
- }
-}
-
-$sql = "SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus = 'start' AND bgpPeerState != 'established' AND B.device_id = D.device_id";
-foreach (dbFetchRows($sql) as $peer) {
- if (device_permitted($peer['device_id'])) {
- echo "
-
- ";
-
-$sql = "SELECT *, DATE_FORMAT(timestamp, '" . Config::get('dateformat.mysql.compact') . "') AS date from syslog,devices WHERE syslog.device_id = devices.device_id ORDER BY seq DESC LIMIT 20";
-echo '
';
-foreach (dbFetchRows($sql) as $entry) {
- unset($syslog_output);
- include 'includes/html/print-syslog.inc.php';
- echo $syslog_output;
-}
-
-echo '
';
-
-echo '
-
-
-
';
-
-// this stuff can be customised to show whatever you want....
-if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['transit'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'Peering: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['peering'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- $ports['broadband'] = '3294,3295,688,3534';
- $ports['wave_broadband'] = '827';
-
- $ports['new_broadband'] = '3659,4149,4121,4108,3676,4135';
-
- echo "
- Overview pages have changed to a new format, this page will not be converted to the new format and will be removed in the next release (1.59).
- For more info, see: https://t.libren.ms/overview
-
-
-
- * 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.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see . */
-
-/**
- * Custom Frontpage
- * @author f0o
- * @copyright 2014 f0o, LibreNMS
- * @license GPL
- * @package LibreNMS
- * @subpackage Frontpage
- */
-
-use LibreNMS\Config;
-
-if (Config::get('map.engine') == 'leaflet') {
- require_once 'includes/html/common/worldmap.inc.php';
- echo implode('', $common_output);
-} else {
- if (Config::has('mapael.default_map') && is_file(Config::get('html_dir') . '/js/' . Config::get('mapael.default_map'))) {
- $default_map = Config::get('mapael.default_map');
- } else {
- $default_map = 'maps/world_countries.js';
- }
- $map_tmp = preg_split("/\//", $default_map);
- $map_name = $map_tmp[count($map_tmp)-1];
- $map_name = str_replace('.js', '', $map_name);
-
- $map_width = (int)Config::get('mapael.map_width', 800);
- $default_zoom = Config::get('mapael.default_zoom', 0);
-
-
- if (Config::has('mapael.default_lat') && Config::has('mapael.default_lng')) {
- $init_zoom = "init: {
- latitude: " . Config::has('mapael.default_lat') . ",
- longitude: " . Config::has('mapael.default_lng') . ",
- level: $default_zoom
- }\n";
- }
-
-
-
-?>
-
-
-
-
-
-
-
-
';
-
-//From default.php - This code is not part of above license.
-if (Config::get('enable_syslog')) {
- $sql = "SELECT *, DATE_FORMAT(timestamp, '" . Config::get('dateformat.mysql.compact') . "') AS date from syslog ORDER BY seq DESC LIMIT 20";
-
- echo('
");
-} else {
- if (Auth::user()->hasGlobalAdmin()) {
- $query = "SELECT *,DATE_FORMAT(datetime, '" . Config::get('dateformat.mysql.compact') . "') as humandate FROM `eventlog` ORDER BY `datetime` DESC LIMIT 0,15";
- } else {
- $query = "SELECT *,DATE_FORMAT(datetime, '" . Config::get('dateformat.mysql.compact') . "') as humandate FROM `eventlog` AS E, devices_perms AS P WHERE E.host =
- P.device_id AND P.user_id = " . Auth::id() . " ORDER BY `datetime` DESC LIMIT 0,15";
- }
-
- echo('
-
-
-
-
-
-
-
-
-
- Eventlog entries
-
-
');
-
- foreach (dbFetchRows($query) as $entry) {
- include 'includes/html/print-event.inc.php';
- }
-
- echo("
");
- echo("
");
- echo("
");
- echo("
");
- echo("
");
-}
-?>
diff --git a/includes/html/pages/front/tiles.php b/includes/html/pages/front/tiles.php
deleted file mode 100644
index 7dabc36a6c..0000000000
--- a/includes/html/pages/front/tiles.php
+++ /dev/null
@@ -1,697 +0,0 @@
-
- *
- * 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. Please see LICENSE.txt at the top level of
- * the source code distribution for details.
- */
-
-use LibreNMS\Config;
-
-/*
- * Code for Gridster.sort_by_row_and_col_asc(serialization) call is from http://gridster.net/demos/grid-from-serialize.html
- */
-
-$no_refresh = true;
-$default_dash = get_user_pref('dashboard', 0);
-
-require_once 'includes/html/modal/alert_notes.inc.php';
-require_once 'includes/html/modal/alert_ack.inc.php';
-
-// get all dashboards this user can access and put them into two lists user_dashboards and shared_dashboards
-$dashboards = get_dashboards();
-list($user_dashboards, $shared_dashboards) = array_reduce($dashboards, function ($ret, $dash) {
- if ($dash['user_id'] == Auth::id()) {
- $ret[0][] = $dash;
- } else {
- $ret[1][] = $dash;
- }
- return $ret;
-}, array());
-
-// if the default dashboard doesn't exist, set it to the global default or to 0
-if (!isset($dashboards[$default_dash])) {
- $global_default = (int)Config::get('webui.default_dashboard_id');
- $default_dash = isset($dashboards[$global_default]) ? $global_default : 0;
-}
-
-// if there are no possible dashboards, add one
-if ($default_dash == 0 && empty($user_dashboards)) {
- $new_dash = array(
- 'dashboard_name'=>'Default',
- 'user_id'=>Auth::id(),
- );
-
- $dashboard_id = dbInsert($new_dash, 'dashboards');
- $new_dash['dashboard_id'] = $dashboard_id;
- $new_dash['username'] = Auth::user()->username;
- $vars['dashboard'] = $new_dash;
-
- if (dbFetchCell('select 1 from users_widgets where user_id = ? && dashboard_id = ?', array(Auth::id(),0)) == 1) {
- dbUpdate(array('dashboard_id'=>$dashboard_id), 'users_widgets', 'user_id = ? && dashboard_id = ?', array(Auth::id(), 0));
- }
-} else {
- // load a dashboard
- $orig = $vars['dashboard'];
- if (!empty($orig) && isset($dashboards[$orig])) {
- // specific dashboard
- $vars['dashboard'] = $dashboards[$orig];
- } else {
- // load a default dashboard
- $vars['dashboard'] = $default_dash == 0 ? current($user_dashboards) : $dashboards[$default_dash];
-
- // $dashboard was requested, but doesn't exist
- if (!empty($orig)) {
- Toastr::error('Dashboard #' . $orig .
- ' does not exist! Loaded ' . htmlentities($vars['dashboard']['dashboard_name']) .
- ' instead.', 'Requested Dashboard Not Found!');
- }
- }
-}
-
-$data = dbFetchRows(
- 'SELECT `user_widget_id`,`users_widgets`.`widget_id`,`title`,`widget`,`col`,`row`,`size_x`,`size_y`,`refresh` FROM `users_widgets`
- LEFT JOIN `widgets` ON `widgets`.`widget_id`=`users_widgets`.`widget_id` WHERE `dashboard_id`=?',
- array($vars['dashboard']['dashboard_id'])
-);
-if (empty($data)) {
- $data[] = array('user_widget_id'=>'0','widget_id'=>1,'title'=>'Add a widget','widget'=>'placeholder','col'=>1,'row'=>1,'size_x'=>6,'size_y'=>2,'refresh'=>60);
-}
-
-$data = serialize(json_encode($data));
-$dash_config = unserialize(stripslashes($data));
-
-if (empty($vars['bare']) || $vars['bare'] == "no") {
- ?>
-
- Overview pages have changed to a new format, this page will not be converted to the new format and will be removed in the next release (1.59).
- For more info, see: https://t.libren.ms/overview
-
-
-
-
-
- 0) {
- $uptimesql = ' AND A.attrib_value < ?';
- $param = [Config::get('uptime_warning')];
-}
-
-foreach (dbFetchRows("SELECT * FROM `devices` AS D, `devices_attribs` AS A WHERE D.status = '1' AND A.device_id = D.device_id AND A.attrib_type = 'uptime' AND A.attrib_value > '0' ".$uptimesql, $param) as $device) {
- unset($already);
- $i = 0;
- while ($i <= count($nodes)) {
- $thisnode = $device['device_id'];
- if ($nodes[$i] == $thisnode) {
- $already = 'yes';
- }
-
- $i++;
- }
-
- if (!$already) {
- $nodes[] = $device['device_id'];
- }
-}
-
-foreach (dbFetchRows("SELECT * FROM `devices` WHERE `status` = '0' AND `ignore` = '0'") as $device) {
- if (device_permitted($device['device_id'])) {
- echo "
- ".generate_device_link($device, shorthost($device['hostname']))."
- Device Down
- ".truncate($device['location'], 35).'
-
';
- }
-}
-
-if (Config::get('warn.ifdown')) {
- foreach (dbFetchRows("SELECT * FROM `ports` AS I, `devices` AS D WHERE I.device_id = D.device_id AND ifOperStatus = 'down' AND ifAdminStatus = 'up' AND D.ignore = '0' AND I.ignore = '0'") as $interface) {
- if (port_permitted($interface['port_id'])) {
- echo "
- ".generate_device_link($interface, shorthost($interface['hostname']))."
- Port Down
- ".generate_port_link($interface, makeshortif($interface['ifDescr'])).'
- '.truncate($interface['ifAlias'], 15).'
-
';
- }
- }
-}
-
-foreach (dbFetchRows("SELECT * FROM `services` AS S, `devices` AS D WHERE S.device_id = D.device_id AND service_status = 'down' AND D.ignore = '0' AND S.service_ignore = '0'") as $service) {
- if (device_permitted($service['device_id'])) {
- echo "
- ".generate_device_link($service, shorthost($service['hostname']))."
- Service Down
- ".$service['service_type'].'
- '.truncate($interface['ifAlias'], 15).'
-
';
- }
-}
-
-foreach (dbFetchRows("SELECT * FROM `devices` AS D, bgpPeers AS B WHERE bgpPeerAdminStatus = 'start' AND bgpPeerState != 'established' AND B.device_id = D.device_id") as $peer) {
- if (device_permitted($peer['device_id'])) {
- echo "
-
- ";
-
-$sql = "SELECT *, DATE_FORMAT(timestamp, '" . Config::get('dateformat.mysql.compact') . "') AS date from syslog,devices WHERE syslog.device_id = devices.device_id ORDER BY seq DESC LIMIT 20";
-echo '
';
-foreach (dbFetchRows($sql) as $entry) {
- unset($syslog_output);
- include 'includes/html/print-syslog.inc.php';
- echo $syslog_output;
-}
-
-echo '
';
-
-echo '
-
-
-
';
-
-// this stuff can be customised to show whatever you want....
-if (Auth::user()->hasGlobalRead()) {
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'Transit: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['transit'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'Peering: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['peering'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- $sql = "SELECT * FROM ports AS I, devices AS D WHERE `ifAlias` like 'Core: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
- unset($seperator);
- foreach (dbFetchRows($sql) as $interface) {
- $ports['core'] .= $seperator.$interface['port_id'];
- $seperator = ',';
- }
-
- echo "
+ This is where status notifications about devices and services would normally go.
+ You might have none because you run such a great network, or perhaps you've just started using {{ Config::get('project_name') }}
+ If you're new to {{ Config::get('project_name') }}, you might
+ want to start by adding one or more devices in the Devices menu.
+