-
Notifications
You must be signed in to change notification settings - Fork 0
/
snver.php
61 lines (52 loc) · 2.44 KB
/
snver.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
/*
+-------------------------------------------------------------------------+
| Copyright (C) 2021-2023 Petr Macek |
| |
| 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. |
+-------------------------------------------------------------------------+
| Cacti: The Complete RRDtool-based Graphing Solution |
+-------------------------------------------------------------------------+
| This code is designed, written, and maintained by the Cacti Group. See |
| about.php and/or the AUTHORS file for specific developer information. |
+-------------------------------------------------------------------------+
| https://github.com/xmacan/ |
| http://www.cacti.net/ |
+-------------------------------------------------------------------------+
*/
chdir('../../');
include_once('./include/auth.php');
include_once('./lib/snmp.php');
include_once('./plugins/snver/functions.php');
$snver_records = read_config_option('snver_records');
$id = get_filter_request_var('host_id', FILTER_VALIDATE_INT);
$alive = db_fetch_row_prepared ("SELECT * FROM host
WHERE id = ? AND disabled != 'on' AND status BETWEEN 2 AND 3", array($id));
if (!$alive) {
print 'Disabled/down device. No actual data.<br/><br/>';
if ($snver_records > 0) {
print plugin_snver_get_history($id,$out);
} else {
print 'History data store disabled';
}
} else {
$out = plugin_snver_get_info($id);
print $out;
print '<br/><br/>';
$out = plugin_snver_get_info_optional($id);
print $out;
print '<br/><br/>';
if ($snver_records > 0) {
print plugin_snver_get_history($id,$out);
} else {
print 'History data store disabled';
}
}