Skip to content

Commit 8793b32

Browse files
author
vogelor
committed
Monitor Module now only shows the state of the "active" services
Monitor Module now has system state
1 parent e8a7e84 commit 8793b32

File tree

17 files changed

+1659
-1049
lines changed

17 files changed

+1659
-1049
lines changed

install/sql/ispconfig3.sql

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,15 +1102,11 @@ CREATE TABLE `monitor_data` (
11021102
`type` varchar(255) NOT NULL,
11031103
`created` int(11) NOT NULL,
11041104
`data` mediumtext NOT NULL,
1105-
`state` enum('unknown','ok','warning','critical', 'error') NOT NULL default 'unknown',
1105+
`state` enum('no_state', 'unknown', 'ok', 'info', 'warning', 'critical', 'error') NOT NULL default 'unknown',
11061106
PRIMARY KEY (`server_id`,`type`,`created`)
11071107
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
11081108

11091109

1110-
SET FOREIGN_KEY_CHECKS = 1;
1111-
1112-
1113-
11141110

11151111
# iso_country_list.sql
11161112
#
@@ -1373,6 +1369,7 @@ INSERT INTO country VALUES ('ZM','ZAMBIA','Zambia','ZMB','894');
13731369
INSERT INTO country VALUES ('ZW','ZIMBABWE','Zimbabwe','ZWE','716');
13741370

13751371

1372+
SET FOREIGN_KEY_CHECKS = 1;
13761373

13771374

13781375

interface/web/monitor/lib/module.conf.php

Lines changed: 80 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,116 +7,134 @@
77
$module["title"] = "Monitor";
88
$module["template"] = "module.tpl.htm";
99
$module["tab_width"] = '';
10-
$module["startpage"] = "monitor/show_data.php?type=overview";
10+
$module["startpage"] = "monitor/show_sys_state.php?state=system";
11+
12+
unset($items);
13+
$items[] = array( 'title' => "Show System State",
14+
'target' => 'content',
15+
'link' => 'monitor/show_sys_state.php?state=system');
16+
17+
$module["nav"][] = array( 'title' => 'System State',
18+
'open' => 1,
19+
'items' => $items);
20+
1121

1222
/*
1323
We need all the available servers on the left navigation.
1424
So fetch them from the database and add then to the navigation as dropdown-list
1525
*/
1626
$servers = $app->db->queryAllRecords("SELECT server_id, server_name FROM server order by server_name");
1727

18-
$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_data.php?type=overview&server=' + document.getElementById('server_id').value);\">";
28+
$dropDown = "<select id='server_id' onchange=\"loadContent('monitor/show_sys_state.php?state=server&server=' + document.getElementById('server_id').value);\">";
1929
foreach ($servers as $server)
2030
{
21-
$dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>";
31+
$dropDown .= "<option value='" . $server['server_id'] . "|" . $server['server_name'] . "'>" . $server['server_name'] . "</option>";
2232
}
2333
$dropDown .= "</select>";
2434

2535
/*
2636
Now add them as dropdown to the navigation
2737
*/
38+
unset($items);
2839
$items[] = array( 'title' => $dropDown,
29-
'target' => '', // no action!
30-
'link' => ''); // no action!
40+
'target' => '', // no action!
41+
'link' => ''); // no action!
3142

3243
$module["nav"][] = array( 'title' => 'Server to Monitor',
33-
'open' => 1,
34-
'items' => $items);
35-
44+
'open' => 1,
45+
'items' => $items);
46+
3647
/*
3748
The first Server at the list is the server first selected
3849
*/
3950
$_SESSION['monitor']['server_id'] = $servers[0]['server_id'];
4051
$_SESSION['monitor']['server_name'] = $servers[0]['server_name'];
4152

4253
/*
43-
Logmonitoring module
44-
*/
45-
// aufräumen
54+
* Logmonitoring module
55+
*/
56+
57+
/*
58+
* Clear and set the Navigation-Items
59+
*/
4660
unset($items);
47-
$items[] = array( 'title' => "Server Load",
48-
'target' => 'content',
49-
'link' => 'monitor/show_data.php?type=server_load');
61+
$items[] = array( 'title' => "Show Server State",
62+
'target' => 'content',
63+
'link' => 'monitor/show_sys_state.php?state=server');
64+
65+
$items[] = array( 'title' => "Show Server Load",
66+
'target' => 'content',
67+
'link' => 'monitor/show_data.php?type=server_load');
5068

51-
$items[] = array( 'title' => "Disk usage",
52-
'target' => 'content',
53-
'link' => 'monitor/show_data.php?type=disk_usage');
69+
$items[] = array( 'title' => "Show Disk usage",
70+
'target' => 'content',
71+
'link' => 'monitor/show_data.php?type=disk_usage');
5472

55-
$items[] = array( 'title' => "Memory usage",
56-
'target' => 'content',
57-
'link' => 'monitor/show_data.php?type=mem_usage');
73+
$items[] = array( 'title' => "Show Memory usage",
74+
'target' => 'content',
75+
'link' => 'monitor/show_data.php?type=mem_usage');
5876

59-
$items[] = array( 'title' => "Services",
60-
'target' => 'content',
61-
'link' => 'monitor/show_data.php?type=services');
77+
$items[] = array( 'title' => "Show Services",
78+
'target' => 'content',
79+
'link' => 'monitor/show_data.php?type=services');
6280

6381

6482
$module["nav"][] = array( 'title' => 'Monitoring',
65-
'open' => 1,
66-
'items' => $items);
83+
'open' => 1,
84+
'items' => $items);
6785

68-
// aufräumen
86+
/*
87+
* Clear and set the Navigation-Items
88+
*/
6989
unset($items);
7090

71-
$items[] = array( 'title' => "CPU",
72-
'target' => 'content',
73-
'link' => 'monitor/show_data.php?type=cpu_info');
91+
$items[] = array( 'title' => "Show CPU info",
92+
'target' => 'content',
93+
'link' => 'monitor/show_data.php?type=cpu_info');
7494

7595
$module["nav"][] = array( 'title' => 'System-Information',
76-
'open' => 1,
77-
'items' => $items);
78-
79-
// aufräumen
80-
unset($items);
96+
'open' => 1,
97+
'items' => $items);
8198

99+
/*
100+
* Logmonitoring module
101+
*/
82102

83103
/*
84-
Logmonitoring module
85-
*/
104+
* Clear and set the Navigation-Items
105+
*/
106+
unset($items);
86107

87-
$items[] = array( 'title' => "Mail log",
88-
'target' => 'content',
89-
'link' => 'monitor/show_log.php?log=log_mail');
108+
$items[] = array( 'title' => "Show Mail-Log",
109+
'target' => 'content',
110+
'link' => 'monitor/show_log.php?log=log_mail');
90111

91-
$items[] = array( 'title' => "Mail warn",
92-
'target' => 'content',
93-
'link' => 'monitor/show_log.php?log=log_mail_warn');
112+
$items[] = array( 'title' => "Show Mail warn-Log",
113+
'target' => 'content',
114+
'link' => 'monitor/show_log.php?log=log_mail_warn');
94115

95-
$items[] = array( 'title' => "Mail err",
96-
'target' => 'content',
97-
'link' => 'monitor/show_log.php?log=log_mail_err');
116+
$items[] = array( 'title' => "Show Mail err-Log",
117+
'target' => 'content',
118+
'link' => 'monitor/show_log.php?log=log_mail_err');
98119

99-
$items[] = array( 'title' => "Messages",
100-
'target' => 'content',
101-
'link' => 'monitor/show_log.php?log=log_messages');
120+
$items[] = array( 'title' => "Show Messages-Log",
121+
'target' => 'content',
122+
'link' => 'monitor/show_log.php?log=log_messages');
102123

103-
$items[] = array( 'title' => "Freshclam",
104-
'target' => 'content',
105-
'link' => 'monitor/show_log.php?log=log_freshclam');
124+
$items[] = array( 'title' => "Show Freshclam-Log",
125+
'target' => 'content',
126+
'link' => 'monitor/show_log.php?log=log_freshclam');
106127

107-
$items[] = array( 'title' => "Clamav",
108-
'target' => 'content',
109-
'link' => 'monitor/show_log.php?log=log_clamav');
128+
$items[] = array( 'title' => "Show Clamav-Log",
129+
'target' => 'content',
130+
'link' => 'monitor/show_log.php?log=log_clamav');
110131

111-
$items[] = array( 'title' => "ISPConfig",
112-
'target' => 'content',
113-
'link' => 'monitor/show_log.php?log=log_ispconfig');
132+
$items[] = array( 'title' => "Show ISPConfig-Log",
133+
'target' => 'content',
134+
'link' => 'monitor/show_log.php?log=log_ispconfig');
114135

115136

116137
$module["nav"][] = array( 'title' => 'Logfiles',
117-
'open' => 1,
118-
'items' => $items);
119-
120-
// aufräumen
121-
unset($items);
138+
'open' => 1,
139+
'items' => $items);
122140
?>

0 commit comments

Comments
 (0)