commit | author | age
|
7ae9f9
|
1 |
<?php |
T |
2 |
|
b7489f
|
3 |
/* |
V |
4 |
Config of the Module |
|
5 |
*/ |
7ae9f9
|
6 |
$module["name"] = "monitor"; |
40dd9f
|
7 |
$module["title"] = "top_menu_monitor"; |
7ae9f9
|
8 |
$module["template"] = "module.tpl.htm"; |
T |
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', |
dd5228
|
15 |
'link' => 'monitor/show_sys_state.php?state=system', |
M |
16 |
'html_id' => 'system'); |
8793b3
|
17 |
|
70e890
|
18 |
$items[] = array( 'title' => "Show System-Log", |
V |
19 |
'target' => 'content', |
dd5228
|
20 |
'link' => 'monitor/log_list.php', |
M |
21 |
'html_id' => 'system_log'); |
70e890
|
22 |
|
V |
23 |
$items[] = array( 'title' => 'Show Jobqueue', |
dd5228
|
24 |
'target' => 'content', |
M |
25 |
'link' => 'monitor/datalog_list.php', |
|
26 |
'html_id' => 'jobqueue'); |
70e890
|
27 |
|
716255
|
28 |
$module["nav"][] = array( 'title' => 'System State (All Servers)', |
8793b3
|
29 |
'open' => 1, |
V |
30 |
'items' => $items); |
|
31 |
|
b7489f
|
32 |
|
V |
33 |
/* |
|
34 |
We need all the available servers on the left navigation. |
|
35 |
So fetch them from the database and add then to the navigation as dropdown-list |
|
36 |
*/ |
164db6
|
37 |
|
b7489f
|
38 |
$servers = $app->db->queryAllRecords("SELECT server_id, server_name FROM server order by server_name"); |
V |
39 |
|
8793b3
|
40 |
$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_sys_state.php?state=server&server=' + document.getElementById('server_id').value);\">"; |
b7489f
|
41 |
foreach ($servers as $server) |
V |
42 |
{ |
8793b3
|
43 |
$dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>"; |
b7489f
|
44 |
} |
V |
45 |
$dropDown .= "</select>"; |
|
46 |
|
|
47 |
/* |
|
48 |
Now add them as dropdown to the navigation |
|
49 |
*/ |
8793b3
|
50 |
unset($items); |
b7489f
|
51 |
$items[] = array( 'title' => $dropDown, |
8793b3
|
52 |
'target' => '', // no action! |
dd5228
|
53 |
'link' => '', // no action! |
M |
54 |
'html_id' => 'select_server'); |
b7489f
|
55 |
|
V |
56 |
$module["nav"][] = array( 'title' => 'Server to Monitor', |
8793b3
|
57 |
'open' => 1, |
V |
58 |
'items' => $items); |
|
59 |
|
b7489f
|
60 |
/* |
V |
61 |
The first Server at the list is the server first selected |
|
62 |
*/ |
|
63 |
$_SESSION['monitor']['server_id'] = $servers[0]['server_id']; |
|
64 |
$_SESSION['monitor']['server_name'] = $servers[0]['server_name']; |
7ae9f9
|
65 |
|
T |
66 |
/* |
716255
|
67 |
* Clear and set the Navigation-Items |
8793b3
|
68 |
*/ |
716255
|
69 |
unset($items); |
V |
70 |
|
|
71 |
$items[] = array( 'title' => "Show CPU info", |
|
72 |
'target' => 'content', |
dd5228
|
73 |
'link' => 'monitor/show_data.php?type=cpu_info', |
M |
74 |
'html_id' => 'cpu_info'); |
716255
|
75 |
|
36d307
|
76 |
$module["nav"][] = array( 'title' => 'Hardware-Information', |
716255
|
77 |
'open' => 1, |
V |
78 |
'items' => $items); |
8793b3
|
79 |
|
V |
80 |
/* |
|
81 |
* Clear and set the Navigation-Items |
|
82 |
*/ |
b7489f
|
83 |
unset($items); |
36d307
|
84 |
$items[] = array( 'title' => "Show Overview", |
8793b3
|
85 |
'target' => 'content', |
dd5228
|
86 |
'link' => 'monitor/show_sys_state.php?state=server', |
M |
87 |
'html_id' => 'server'); |
36d307
|
88 |
|
716255
|
89 |
$items[] = array( 'title' => "Show Update State", |
V |
90 |
'target' => 'content', |
dd5228
|
91 |
'link' => 'monitor/show_data.php?type=system_update', |
M |
92 |
'html_id' => 'system_update'); |
7ae9f9
|
93 |
|
36d307
|
94 |
$items[] = array( 'title' => "Show RAID state", |
V |
95 |
'target' => 'content', |
dd5228
|
96 |
'link' => 'monitor/show_data.php?type=raid_state', |
M |
97 |
'html_id' => 'raid_state'); |
36d307
|
98 |
|
V |
99 |
$items[] = array( 'title' => "Show Server load", |
8793b3
|
100 |
'target' => 'content', |
dd5228
|
101 |
'link' => 'monitor/show_data.php?type=server_load', |
M |
102 |
'html_id' => 'serverload'); |
7ae9f9
|
103 |
|
8793b3
|
104 |
$items[] = array( 'title' => "Show Disk usage", |
V |
105 |
'target' => 'content', |
dd5228
|
106 |
'link' => 'monitor/show_data.php?type=disk_usage', |
M |
107 |
'html_id' => 'disk_usage'); |
7ae9f9
|
108 |
|
8793b3
|
109 |
$items[] = array( 'title' => "Show Memory usage", |
V |
110 |
'target' => 'content', |
dd5228
|
111 |
'link' => 'monitor/show_data.php?type=mem_usage', |
M |
112 |
'html_id' => 'mem_usage'); |
8793b3
|
113 |
|
V |
114 |
$items[] = array( 'title' => "Show Services", |
|
115 |
'target' => 'content', |
dd5228
|
116 |
'link' => 'monitor/show_data.php?type=services', |
M |
117 |
'html_id' => 'services'); |
615a0a
|
118 |
|
T |
119 |
$items[] = array( 'title' => "Show Monit", |
|
120 |
'target' => 'content', |
|
121 |
'link' => 'monitor/show_monit.php', |
|
122 |
'html_id' => 'monit'); |
7ae9f9
|
123 |
|
c9d97b
|
124 |
$items[] = array( 'title' => "Show OpenVz VE BeanCounter", |
V |
125 |
'target' => 'content', |
dd5228
|
126 |
'link' => 'monitor/show_data.php?type=openvz_beancounter', |
M |
127 |
'html_id' => 'openvz_beancounter'); |
615a0a
|
128 |
|
T |
129 |
$items[] = array( 'title' => "Show Munin", |
|
130 |
'target' => 'content', |
|
131 |
'link' => 'monitor/show_munin.php', |
|
132 |
'html_id' => 'monit'); |
7ae9f9
|
133 |
|
36d307
|
134 |
$module["nav"][] = array( 'title' => 'Server State', |
8793b3
|
135 |
'open' => 1, |
V |
136 |
'items' => $items); |
7ae9f9
|
137 |
|
8793b3
|
138 |
/* |
V |
139 |
* Clear and set the Navigation-Items |
|
140 |
*/ |
|
141 |
unset($items); |
36d307
|
142 |
|
V |
143 |
$items[] = array( 'title' => "Show Mail-Queue", |
|
144 |
'target' => 'content', |
dd5228
|
145 |
'link' => 'monitor/show_data.php?type=mailq', |
M |
146 |
'html_id' => 'mailq'); |
7ae9f9
|
147 |
|
8793b3
|
148 |
$items[] = array( 'title' => "Show Mail-Log", |
V |
149 |
'target' => 'content', |
dd5228
|
150 |
'link' => 'monitor/show_log.php?log=log_mail', |
M |
151 |
'html_id' => 'log_mail'); |
7ae9f9
|
152 |
|
8793b3
|
153 |
$items[] = array( 'title' => "Show Mail warn-Log", |
V |
154 |
'target' => 'content', |
dd5228
|
155 |
'link' => 'monitor/show_log.php?log=log_mail_warn', |
M |
156 |
'html_id' => 'log_mail_warn'); |
7ae9f9
|
157 |
|
8793b3
|
158 |
$items[] = array( 'title' => "Show Mail err-Log", |
V |
159 |
'target' => 'content', |
dd5228
|
160 |
'link' => 'monitor/show_log.php?log=log_mail_err', |
M |
161 |
'html_id' => 'log_mail_err'); |
8793b3
|
162 |
|
fdeb61
|
163 |
$items[] = array( 'title' => "Show System-Log", |
8793b3
|
164 |
'target' => 'content', |
dd5228
|
165 |
'link' => 'monitor/show_log.php?log=log_messages', |
M |
166 |
'html_id' => 'log_messages'); |
8793b3
|
167 |
|
641cb3
|
168 |
$items[] = array( 'title' => "Show ISPC Cron-Log", |
R |
169 |
'target' => 'content', |
dd5228
|
170 |
'link' => 'monitor/show_log.php?log=log_ispc_cron', |
M |
171 |
'html_id' => 'log_ispc_cron'); |
641cb3
|
172 |
|
8793b3
|
173 |
$items[] = array( 'title' => "Show Freshclam-Log", |
V |
174 |
'target' => 'content', |
dd5228
|
175 |
'link' => 'monitor/show_log.php?log=log_freshclam', |
M |
176 |
'html_id' => 'log_freshclam'); |
8793b3
|
177 |
|
V |
178 |
$items[] = array( 'title' => "Show Clamav-Log", |
|
179 |
'target' => 'content', |
dd5228
|
180 |
'link' => 'monitor/show_log.php?log=log_clamav', |
M |
181 |
'html_id' => 'log_clamav'); |
8793b3
|
182 |
|
fb4c27
|
183 |
$items[] = array( 'title' => "Show RKHunter-Log", |
V |
184 |
'target' => 'content', |
dd5228
|
185 |
'link' => 'monitor/show_data.php?type=rkhunter', |
M |
186 |
'html_id' => 'rkhunter'); |
7ae9f9
|
187 |
|
476a60
|
188 |
$items[] = array( 'title' => "Show fail2ban-Log", |
V |
189 |
'target' => 'content', |
dd5228
|
190 |
'link' => 'monitor/show_data.php?type=fail2ban', |
M |
191 |
'html_id' => 'fai2ban'); |
476a60
|
192 |
|
2332b2
|
193 |
$items[] = array( 'title' => "Show MongoDB-Log", |
T |
194 |
'target' => 'content', |
|
195 |
'link' => 'monitor/show_data.php?type=mongodb', |
|
196 |
'html_id' => 'mongodb'); |
|
197 |
|
28548b
|
198 |
$items[] = array( 'title' => "Show IPTables", |
L |
199 |
'target' => 'content', |
|
200 |
'link' => 'monitor/show_data.php?type=iptables', |
|
201 |
'html_id' => 'iptables'); |
|
202 |
|
7ae9f9
|
203 |
$module["nav"][] = array( 'title' => 'Logfiles', |
8793b3
|
204 |
'open' => 1, |
V |
205 |
'items' => $items); |
2332b2
|
206 |
?> |