forked from librenms/librenms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgraph.php
38 lines (30 loc) · 843 Bytes
/
graph.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* LibreNMS
*
* This file is part of LibreNMS.
*
* @copyright (C) 2006 - 2012 Adam Armstrong
*/
use LibreNMS\Data\Store\Datastore;
use LibreNMS\Util\Debug;
$auth = false;
$start = microtime(true);
$init_modules = ['web', 'auth'];
require realpath(__DIR__ . '/..') . '/includes/init.php';
if (! Auth::check()) {
// check for unauthenticated graphs and set auth
$auth = is_client_authorized($_SERVER['REMOTE_ADDR']);
if (! $auth) {
exit('Unauthorized');
}
}
Debug::set(isset($_GET['debug']));
require \LibreNMS\Config::get('install_dir') . '/includes/html/graphs/graph.inc.php';
Datastore::terminate();
if (Debug::isEnabled()) {
echo '<br />';
printf('Runtime %.3fs', microtime(true) - $start);
echo '<br />';
app(\App\Polling\Measure\MeasurementManager::class)->printStats();
}