|
1 | 1 | <?php |
2 | 2 |
|
| 3 | +/* |
| 4 | + Config of the Module |
| 5 | + */ |
3 | 6 | $module["name"] = "monitor"; |
4 | 7 | $module["title"] = "Monitor"; |
5 | 8 | $module["template"] = "module.tpl.htm"; |
6 | | -$module["startpage"] = "monitor/system.php?mod=index"; |
7 | 9 | $module["tab_width"] = ''; |
| 10 | +$module["startpage"] = "monitor/system.php?type=overview"; |
8 | 11 |
|
9 | 12 | /* |
10 | | - Logmonitoring module |
| 13 | + We need all the available servers on the left navigation. |
| 14 | + So fetch them from the database and add then to the navigation as dropdown-list |
11 | 15 | */ |
| 16 | +$servers = $app->db->queryAllRecords("SELECT server_id, server_name FROM server order by server_name"); |
12 | 17 |
|
13 | | -$items[] = array( 'title' => "Load", |
14 | | - 'target' => 'content', |
15 | | - 'link' => 'monitor/system.php?mod=load'); |
| 18 | +$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_data.php?type=overview&server=' + document.getElementById('server_id').value);\">"; |
| 19 | +foreach ($servers as $server) |
| 20 | +{ |
| 21 | + $dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>"; |
| 22 | +} |
| 23 | +$dropDown .= "</select>"; |
| 24 | + |
| 25 | +/* |
| 26 | + Now add them as dropdown to the navigation |
| 27 | + */ |
| 28 | +$items[] = array( 'title' => $dropDown, |
| 29 | + 'target' => '', // no action! |
| 30 | + 'link' => ''); // no action! |
| 31 | + |
| 32 | +$module["nav"][] = array( 'title' => 'Server to Monitor', |
| 33 | + 'open' => 1, |
| 34 | + 'items' => $items); |
| 35 | + |
| 36 | +/* |
| 37 | + The first Server at the list is the server first selected |
| 38 | + */ |
| 39 | +$_SESSION['monitor']['server_id'] = $servers[0]['server_id']; |
| 40 | +$_SESSION['monitor']['server_name'] = $servers[0]['server_name']; |
16 | 41 |
|
17 | | -$items[] = array( 'title' => "Harddisk", |
| 42 | +/* |
| 43 | + Logmonitoring module |
| 44 | +*/ |
| 45 | +// aufräumen |
| 46 | +unset($items); |
| 47 | +$items[] = array( 'title' => "Server Load", |
18 | 48 | 'target' => 'content', |
19 | | - 'link' => 'monitor/system.php?mod=disk'); |
| 49 | + 'link' => 'monitor/show_data.php?type=server_load'); |
20 | 50 |
|
21 | | -$items[] = array( 'title' => "Memory usage", |
| 51 | +$items[] = array( 'title' => "Disk usage", |
22 | 52 | 'target' => 'content', |
23 | | - 'link' => 'monitor/system.php?mod=memusage'); |
| 53 | + 'link' => 'monitor/show_data.php?type=disk_usage'); |
24 | 54 |
|
25 | | -$items[] = array( 'title' => "CPU", |
| 55 | +$items[] = array( 'title' => "Memory usage", |
26 | 56 | 'target' => 'content', |
27 | | - 'link' => 'monitor/system.php?mod=cpu'); |
| 57 | + 'link' => 'monitor/show_data.php?type=mem_usage'); |
28 | 58 |
|
29 | 59 | $items[] = array( 'title' => "Services", |
30 | 60 | 'target' => 'content', |
31 | | - 'link' => 'monitor/system.php?mod=services'); |
| 61 | + 'link' => 'monitor/show_data.php?type=services'); |
32 | 62 |
|
33 | 63 |
|
34 | | -$module["nav"][] = array( 'title' => 'System', |
| 64 | +$module["nav"][] = array( 'title' => 'Monitoring', |
35 | 65 | 'open' => 1, |
36 | 66 | 'items' => $items); |
37 | 67 |
|
38 | 68 | // aufräumen |
39 | 69 | unset($items); |
40 | 70 |
|
| 71 | +$items[] = array( 'title' => "CPU", |
| 72 | + 'target' => 'content', |
| 73 | + 'link' => 'monitor/show_data.php?type=cpu_info'); |
| 74 | + |
| 75 | +$module["nav"][] = array( 'title' => 'System-Information', |
| 76 | + 'open' => 1, |
| 77 | + 'items' => $items); |
| 78 | + |
| 79 | +// aufräumen |
| 80 | +unset($items); |
| 81 | + |
| 82 | + |
41 | 83 | /* |
42 | 84 | Logmonitoring module |
43 | 85 | */ |
44 | 86 |
|
45 | 87 | $items[] = array( 'title' => "Mail log", |
46 | 88 | 'target' => 'content', |
47 | | - 'link' => 'monitor/logview.php?log=mail_log'); |
| 89 | + 'link' => 'monitor/show_log.php?log=log_mail'); |
48 | 90 |
|
49 | 91 | $items[] = array( 'title' => "Mail warn", |
50 | 92 | 'target' => 'content', |
51 | | - 'link' => 'monitor/logview.php?log=mail_warn'); |
| 93 | + 'link' => 'monitor/show_log.php?log=log_mail_warn'); |
52 | 94 |
|
53 | 95 | $items[] = array( 'title' => "Mail err", |
54 | 96 | 'target' => 'content', |
55 | | - 'link' => 'monitor/logview.php?log=mail_err'); |
| 97 | + 'link' => 'monitor/show_log.php?log=log_mail_err'); |
56 | 98 |
|
57 | 99 | $items[] = array( 'title' => "Messages", |
58 | 100 | 'target' => 'content', |
59 | | - 'link' => 'monitor/logview.php?log=messages'); |
| 101 | + 'link' => 'monitor/show_log.php?log=log_messages'); |
60 | 102 |
|
61 | 103 | $items[] = array( 'title' => "Freshclam", |
62 | 104 | 'target' => 'content', |
63 | | - 'link' => 'monitor/logview.php?log=freshclam'); |
| 105 | + 'link' => 'monitor/show_log.php?log=log_freshclam'); |
64 | 106 |
|
65 | 107 | $items[] = array( 'title' => "Clamav", |
66 | 108 | 'target' => 'content', |
67 | | - 'link' => 'monitor/logview.php?log=clamav'); |
| 109 | + 'link' => 'monitor/show_log.php?log=log_clamav'); |
68 | 110 |
|
69 | 111 | $items[] = array( 'title' => "ISPConfig", |
70 | 112 | 'target' => 'content', |
71 | | - 'link' => 'monitor/logview.php?log=ispconfig'); |
| 113 | + 'link' => 'monitor/show_log.php?log=log_ispconfig'); |
72 | 114 |
|
73 | 115 |
|
74 | 116 | $module["nav"][] = array( 'title' => 'Logfiles', |
|
0 commit comments