commit | author | age
|
7ae9f9
|
1 |
<?php |
T |
2 |
|
b7489f
|
3 |
/* |
V |
4 |
Config of the Module |
|
5 |
*/ |
7ae9f9
|
6 |
$module["name"] = "monitor"; |
T |
7 |
$module["title"] = "Monitor"; |
|
8 |
$module["template"] = "module.tpl.htm"; |
|
9 |
$module["tab_width"] = ''; |
8793b3
|
10 |
$module["startpage"] = "monitor/show_sys_state.php?state=system"; |
V |
11 |
|
|
12 |
unset($items); |
36d307
|
13 |
$items[] = array( 'title' => "Show Overview", |
8793b3
|
14 |
'target' => 'content', |
V |
15 |
'link' => 'monitor/show_sys_state.php?state=system'); |
|
16 |
|
716255
|
17 |
$module["nav"][] = array( 'title' => 'System State (All Servers)', |
8793b3
|
18 |
'open' => 1, |
V |
19 |
'items' => $items); |
|
20 |
|
b7489f
|
21 |
|
V |
22 |
/* |
|
23 |
We need all the available servers on the left navigation. |
|
24 |
So fetch them from the database and add then to the navigation as dropdown-list |
|
25 |
*/ |
|
26 |
$servers = $app->db->queryAllRecords("SELECT server_id, server_name FROM server order by server_name"); |
|
27 |
|
8793b3
|
28 |
$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_sys_state.php?state=server&server=' + document.getElementById('server_id').value);\">"; |
b7489f
|
29 |
foreach ($servers as $server) |
V |
30 |
{ |
8793b3
|
31 |
$dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>"; |
b7489f
|
32 |
} |
V |
33 |
$dropDown .= "</select>"; |
|
34 |
|
|
35 |
/* |
|
36 |
Now add them as dropdown to the navigation |
|
37 |
*/ |
8793b3
|
38 |
unset($items); |
b7489f
|
39 |
$items[] = array( 'title' => $dropDown, |
8793b3
|
40 |
'target' => '', // no action! |
V |
41 |
'link' => ''); // no action! |
b7489f
|
42 |
|
V |
43 |
$module["nav"][] = array( 'title' => 'Server to Monitor', |
8793b3
|
44 |
'open' => 1, |
V |
45 |
'items' => $items); |
|
46 |
|
b7489f
|
47 |
/* |
V |
48 |
The first Server at the list is the server first selected |
|
49 |
*/ |
|
50 |
$_SESSION['monitor']['server_id'] = $servers[0]['server_id']; |
|
51 |
$_SESSION['monitor']['server_name'] = $servers[0]['server_name']; |
7ae9f9
|
52 |
|
T |
53 |
/* |
716255
|
54 |
* Clear and set the Navigation-Items |
8793b3
|
55 |
*/ |
716255
|
56 |
unset($items); |
V |
57 |
|
|
58 |
$items[] = array( 'title' => "Show CPU info", |
|
59 |
'target' => 'content', |
|
60 |
'link' => 'monitor/show_data.php?type=cpu_info'); |
|
61 |
|
36d307
|
62 |
$module["nav"][] = array( 'title' => 'Hardware-Information', |
716255
|
63 |
'open' => 1, |
V |
64 |
'items' => $items); |
8793b3
|
65 |
|
V |
66 |
/* |
|
67 |
* Clear and set the Navigation-Items |
|
68 |
*/ |
b7489f
|
69 |
unset($items); |
36d307
|
70 |
$items[] = array( 'title' => "Show Overview", |
8793b3
|
71 |
'target' => 'content', |
V |
72 |
'link' => 'monitor/show_sys_state.php?state=server'); |
36d307
|
73 |
|
716255
|
74 |
$items[] = array( 'title' => "Show Update State", |
V |
75 |
'target' => 'content', |
|
76 |
'link' => 'monitor/show_data.php?type=system_update'); |
7ae9f9
|
77 |
|
36d307
|
78 |
$items[] = array( 'title' => "Show RAID state", |
V |
79 |
'target' => 'content', |
|
80 |
'link' => 'monitor/show_data.php?type=raid_state'); |
|
81 |
|
|
82 |
$items[] = array( 'title' => "Show Server load", |
8793b3
|
83 |
'target' => 'content', |
V |
84 |
'link' => 'monitor/show_data.php?type=server_load'); |
7ae9f9
|
85 |
|
8793b3
|
86 |
$items[] = array( 'title' => "Show Disk usage", |
V |
87 |
'target' => 'content', |
|
88 |
'link' => 'monitor/show_data.php?type=disk_usage'); |
7ae9f9
|
89 |
|
8793b3
|
90 |
$items[] = array( 'title' => "Show Memory usage", |
V |
91 |
'target' => 'content', |
|
92 |
'link' => 'monitor/show_data.php?type=mem_usage'); |
|
93 |
|
|
94 |
$items[] = array( 'title' => "Show Services", |
|
95 |
'target' => 'content', |
|
96 |
'link' => 'monitor/show_data.php?type=services'); |
7ae9f9
|
97 |
|
T |
98 |
|
36d307
|
99 |
$module["nav"][] = array( 'title' => 'Server State', |
8793b3
|
100 |
'open' => 1, |
V |
101 |
'items' => $items); |
7ae9f9
|
102 |
|
8793b3
|
103 |
/* |
V |
104 |
* Clear and set the Navigation-Items |
|
105 |
*/ |
|
106 |
unset($items); |
36d307
|
107 |
|
V |
108 |
$items[] = array( 'title' => "Show Mail-Queue", |
|
109 |
'target' => 'content', |
|
110 |
'link' => 'monitor/show_data.php?type=mailq'); |
7ae9f9
|
111 |
|
8793b3
|
112 |
$items[] = array( 'title' => "Show Mail-Log", |
V |
113 |
'target' => 'content', |
|
114 |
'link' => 'monitor/show_log.php?log=log_mail'); |
7ae9f9
|
115 |
|
8793b3
|
116 |
$items[] = array( 'title' => "Show Mail warn-Log", |
V |
117 |
'target' => 'content', |
|
118 |
'link' => 'monitor/show_log.php?log=log_mail_warn'); |
7ae9f9
|
119 |
|
8793b3
|
120 |
$items[] = array( 'title' => "Show Mail err-Log", |
V |
121 |
'target' => 'content', |
|
122 |
'link' => 'monitor/show_log.php?log=log_mail_err'); |
|
123 |
|
fdeb61
|
124 |
$items[] = array( 'title' => "Show System-Log", |
8793b3
|
125 |
'target' => 'content', |
V |
126 |
'link' => 'monitor/show_log.php?log=log_messages'); |
|
127 |
|
|
128 |
$items[] = array( 'title' => "Show Freshclam-Log", |
|
129 |
'target' => 'content', |
|
130 |
'link' => 'monitor/show_log.php?log=log_freshclam'); |
|
131 |
|
|
132 |
$items[] = array( 'title' => "Show Clamav-Log", |
|
133 |
'target' => 'content', |
|
134 |
'link' => 'monitor/show_log.php?log=log_clamav'); |
|
135 |
|
fb4c27
|
136 |
$items[] = array( 'title' => "Show RKHunter-Log", |
V |
137 |
'target' => 'content', |
|
138 |
'link' => 'monitor/show_data.php?type=rkhunter'); |
|
139 |
|
8793b3
|
140 |
$items[] = array( 'title' => "Show ISPConfig-Log", |
V |
141 |
'target' => 'content', |
|
142 |
'link' => 'monitor/show_log.php?log=log_ispconfig'); |
7ae9f9
|
143 |
|
T |
144 |
$module["nav"][] = array( 'title' => 'Logfiles', |
8793b3
|
145 |
'open' => 1, |
V |
146 |
'items' => $items); |
7ae9f9
|
147 |
?> |