Repository navigation
Expand file tree
/
Copy pathsmokeping.php
More file actions
55 lines (47 loc) · 2.04 KB
/
Copy pathsmokeping.php
File metadata and controls
55 lines (47 loc) · 2.04 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
* SPDX-FileCopyrightText: 2026 Thomas Vincent <thomasvincent@gmail.com>
* SPDX-License-Identifier: GPL-2.0-or-later
*
* This file is part of plugin_smokeping, a plugin for Cacti.
* https://github.com/somethingwithproof/plugin_smokeping
*
* 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 2 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.
*/
chdir('../../');
include('./include/auth.php');
include_once('./plugins/smokeping/setup.php');
if (!smokeping_page_start()) {
exit;
}
$smokeping_settings = smokeping_settings();
$smokeping_devices = array();
foreach (get_allowed_devices() as $smokeping_device) {
$smokeping_devices[(int) $smokeping_device['id']] = $smokeping_device['description'];
}
// The graph button links here with the device whose graph was open. The filter
// only narrows the devices the user may already see.
if (isset_request_var('host_id')) {
$smokeping_only = get_filter_request_var('host_id');
$smokeping_devices = array_intersect_key($smokeping_devices, array((int) $smokeping_only => true));
}
$smokeping_page = new \Somethingwithproof\Smokeping\ViewPage(
new \Somethingwithproof\Smokeping\TargetRepository(false),
new \Somethingwithproof\Smokeping\ObservationRepository(false),
new \Somethingwithproof\Smokeping\FreshnessEvaluator(new \Somethingwithproof\Smokeping\SystemClock(), $smokeping_settings->freshnessAllowance),
new \Somethingwithproof\Smokeping\MaintMaintenance()
);
top_graph_header();
if (api_plugin_user_realm_auth('smokeping_operator.php')) {
print '<p><a href="smokeping_operator.php">' . html_escape(__('SmokePing Operations', 'smokeping')) . '</a></p>';
}
$smokeping_page->render($smokeping_devices);
bottom_footer();