2007-04-03 14:10:23 +00:00
|
|
|
<?php
|
2012-05-09 10:01:42 +00:00
|
|
|
/**
|
2016-08-20 12:16:55 +01:00
|
|
|
* LibreNMS
|
2012-05-09 10:01:42 +00:00
|
|
|
*
|
2016-08-20 12:16:55 +01:00
|
|
|
* This file is part of LibreNMS.
|
2012-05-09 10:01:42 +00:00
|
|
|
*
|
2013-10-29 05:38:12 +10:00
|
|
|
* @copyright (C) 2006 - 2012 Adam Armstrong
|
2012-05-09 10:01:42 +00:00
|
|
|
*/
|
|
|
|
|
2020-03-16 09:17:58 -05:00
|
|
|
use LibreNMS\Data\Store\Datastore;
|
2021-04-29 22:42:18 -05:00
|
|
|
use LibreNMS\Util\Debug;
|
2020-03-16 09:17:58 -05:00
|
|
|
|
2021-05-04 14:49:16 +02:00
|
|
|
$auth = false;
|
2016-01-08 13:33:32 +01:00
|
|
|
$start = microtime(true);
|
2012-03-27 13:59:31 +00:00
|
|
|
|
2022-09-03 12:48:43 -05:00
|
|
|
$init_modules = ['web', 'auth'];
|
2016-11-21 14:12:59 -06:00
|
|
|
require realpath(__DIR__ . '/..') . '/includes/init.php';
|
2016-08-26 01:50:29 -05:00
|
|
|
|
2020-06-30 09:25:01 -05:00
|
|
|
if (! Auth::check()) {
|
|
|
|
// check for unauthenticated graphs and set auth
|
|
|
|
$auth = is_client_authorized($_SERVER['REMOTE_ADDR']);
|
|
|
|
if (! $auth) {
|
|
|
|
exit('Unauthorized');
|
|
|
|
}
|
2019-04-11 23:26:42 -05:00
|
|
|
}
|
|
|
|
|
2021-04-29 22:42:18 -05:00
|
|
|
Debug::set(isset($_GET['debug']));
|
2018-07-13 17:08:00 -05:00
|
|
|
|
2019-06-23 00:29:12 -05:00
|
|
|
require \LibreNMS\Config::get('install_dir') . '/includes/html/graphs/graph.inc.php';
|
2007-04-03 14:10:23 +00:00
|
|
|
|
2020-03-16 09:17:58 -05:00
|
|
|
Datastore::terminate();
|
2015-03-01 17:06:38 +00:00
|
|
|
|
2021-04-29 22:42:18 -05:00
|
|
|
if (Debug::isEnabled()) {
|
2016-11-23 00:57:19 -06:00
|
|
|
echo '<br />';
|
|
|
|
printf('Runtime %.3fs', microtime(true) - $start);
|
|
|
|
echo '<br />';
|
2021-10-06 17:09:54 -05:00
|
|
|
app(\App\Polling\Measure\MeasurementManager::class)->printStats();
|
2016-11-23 00:57:19 -06:00
|
|
|
}
|