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