Skip to content

Commit 82ff629

Browse files
author
Till Brehm
committed
Fixed: FS#3302 - Hourly monitoring of system updates make system unusable
- Updated Linux Distribution detection to recognize all wheezy sub versions correctly.
1 parent 71c74b1 commit 82ff629

File tree

8 files changed

+21
-2
lines changed

8 files changed

+21
-2
lines changed

install/lib/install.lib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ function get_distname() {
160160
$distid = 'debian60';
161161
$distbaseid = 'debian';
162162
swriteln("Operating System: Debian 6.0 (Squeeze/Sid) or compatible\n");
163-
} elseif(strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || strstr(trim(file_get_contents('/etc/debian_version')), '7.1') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') {
163+
} elseif(strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || substr(trim(file_get_contents('/etc/debian_version')),0,2) == '7.' || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') {
164164
$distname = 'Debian';
165165
$distver = 'Wheezy/Sid';
166166
$distid = 'debian60';

install/tpl/server.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ monit_password=
2424
munin_url=
2525
munin_user=
2626
munin_password=
27+
monitor_system_updates=y
2728

2829
[mail]
2930
module=postfix_mysql

interface/web/admin/form/server_config.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,12 @@
249249
'width' => '40',
250250
'maxlength' => '255'
251251
),
252+
'monitor_system_updates' => array(
253+
'datatype' => 'VARCHAR',
254+
'formtype' => 'CHECKBOX',
255+
'default' => 'y',
256+
'value' => array(0 => 'n', 1 => 'y')
257+
),
252258
//#################################
253259
// ENDE Datatable fields
254260
//#################################

interface/web/admin/lib/lang/de_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,5 @@ $wb['munin_url_error_regex'] = 'Ungültige Munin-URL';
190190
$wb['munin_url_note_txt'] = 'Platzhalter:';
191191
$wb['backup_dir_is_mount_txt'] = 'Backupverzeichnis ist ein eigener Mount?';
192192
$wb['backup_dir_mount_cmd_txt'] = 'Mount-Befehl, falls Backupverzeichnis nicht gemountet';
193+
$wb['monitor_system_updates_txt'] = 'Suche nach Linux updates';
193194
?>

interface/web/admin/lib/lang/en_server_config.lng

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,5 @@ $wb['munin_url_error_regex'] = 'Invalid Munin URL';
190190
$wb['munin_url_note_txt'] = 'Placeholder:';
191191
$wb['backup_dir_is_mount_txt'] = 'Backup directory is a mount?';
192192
$wb['backup_dir_mount_cmd_txt'] = 'Mount command, if backup directory not mounted';
193+
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
193194
?>

interface/web/admin/templates/server_config_server_edit.htm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ <h2><tmpl_var name="list_head_txt"></h2>
9898
<div class="ctrlHolder">
9999
<label for="munin_password">{tmpl_var name='munin_password_txt'}</label>
100100
<input name="munin_password" id="munin_password" value="{tmpl_var name='munin_password'}" size="40" maxlength="255" type="text" class="textInput" />
101+
</div>
102+
<div class="ctrlHolder">
103+
<p class="label">{tmpl_var name='monitor_system_updates_txt'}</p>
104+
<div class="multiField">
105+
{tmpl_var name='monitor_system_updates'}
106+
</div>
101107
</div>
102108
</fieldset>
103109

server/lib/classes/monitor_tools.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public function get_distname() {
132132
$distver = 'Squeeze/Sid';
133133
$distid = 'debian60';
134134
$distbaseid = 'debian';
135-
} elseif (strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || strstr(trim(file_get_contents('/etc/debian_version')), '7.1') || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') {
135+
} elseif (strstr(trim(file_get_contents('/etc/debian_version')), '7.0') || substr(trim(file_get_contents('/etc/debian_version')),0,2) == '7.' || trim(file_get_contents('/etc/debian_version')) == 'wheezy/sid') {
136136
$distname = 'Debian';
137137
$distver = 'Wheezy/Sid';
138138
$distid = 'debian60';

server/mods-available/monitor_core_module.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,10 @@ private function _monitorSystemUpdate() {
419419
* OK - here we go...
420420
*/
421421
global $app;
422+
423+
$app->uses('getconf');
424+
$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
425+
if($server_config['monitor_system_updates'] == 'n') return;
422426

423427
/*
424428
* First we get the Monitoring-data from the tools

0 commit comments

Comments
 (0)