Commit 82ff6299 authored by Till Brehm's avatar Till Brehm

Fixed: FS#3302 - Hourly monitoring of system updates make system unusable

- Updated Linux Distribution detection to recognize all wheezy sub versions correctly.
parent 71c74b1b
...@@ -160,7 +160,7 @@ function get_distname() { ...@@ -160,7 +160,7 @@ function get_distname() {
$distid = 'debian60'; $distid = 'debian60';
$distbaseid = 'debian'; $distbaseid = 'debian';
swriteln("Operating System: Debian 6.0 (Squeeze/Sid) or compatible\n"); swriteln("Operating System: Debian 6.0 (Squeeze/Sid) or compatible\n");
} 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') { } 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') {
$distname = 'Debian'; $distname = 'Debian';
$distver = 'Wheezy/Sid'; $distver = 'Wheezy/Sid';
$distid = 'debian60'; $distid = 'debian60';
......
...@@ -24,6 +24,7 @@ monit_password= ...@@ -24,6 +24,7 @@ monit_password=
munin_url= munin_url=
munin_user= munin_user=
munin_password= munin_password=
monitor_system_updates=y
[mail] [mail]
module=postfix_mysql module=postfix_mysql
......
...@@ -249,6 +249,12 @@ $form["tabs"]['server'] = array( ...@@ -249,6 +249,12 @@ $form["tabs"]['server'] = array(
'width' => '40', 'width' => '40',
'maxlength' => '255' 'maxlength' => '255'
), ),
'monitor_system_updates' => array(
'datatype' => 'VARCHAR',
'formtype' => 'CHECKBOX',
'default' => 'y',
'value' => array(0 => 'n', 1 => 'y')
),
//################################# //#################################
// ENDE Datatable fields // ENDE Datatable fields
//################################# //#################################
......
...@@ -190,4 +190,5 @@ $wb['munin_url_error_regex'] = 'Ungültige Munin-URL'; ...@@ -190,4 +190,5 @@ $wb['munin_url_error_regex'] = 'Ungültige Munin-URL';
$wb['munin_url_note_txt'] = 'Platzhalter:'; $wb['munin_url_note_txt'] = 'Platzhalter:';
$wb['backup_dir_is_mount_txt'] = 'Backupverzeichnis ist ein eigener Mount?'; $wb['backup_dir_is_mount_txt'] = 'Backupverzeichnis ist ein eigener Mount?';
$wb['backup_dir_mount_cmd_txt'] = 'Mount-Befehl, falls Backupverzeichnis nicht gemountet'; $wb['backup_dir_mount_cmd_txt'] = 'Mount-Befehl, falls Backupverzeichnis nicht gemountet';
$wb['monitor_system_updates_txt'] = 'Suche nach Linux updates';
?> ?>
\ No newline at end of file
...@@ -190,4 +190,5 @@ $wb['munin_url_error_regex'] = 'Invalid Munin URL'; ...@@ -190,4 +190,5 @@ $wb['munin_url_error_regex'] = 'Invalid Munin URL';
$wb['munin_url_note_txt'] = 'Placeholder:'; $wb['munin_url_note_txt'] = 'Placeholder:';
$wb['backup_dir_is_mount_txt'] = 'Backup directory is a mount?'; $wb['backup_dir_is_mount_txt'] = 'Backup directory is a mount?';
$wb['backup_dir_mount_cmd_txt'] = 'Mount command, if backup directory not mounted'; $wb['backup_dir_mount_cmd_txt'] = 'Mount command, if backup directory not mounted';
$wb['monitor_system_updates_txt'] = 'Check for Linux updates';
?> ?>
...@@ -98,6 +98,12 @@ ...@@ -98,6 +98,12 @@
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="munin_password">{tmpl_var name='munin_password_txt'}</label> <label for="munin_password">{tmpl_var name='munin_password_txt'}</label>
<input name="munin_password" id="munin_password" value="{tmpl_var name='munin_password'}" size="40" maxlength="255" type="text" class="textInput" /> <input name="munin_password" id="munin_password" value="{tmpl_var name='munin_password'}" size="40" maxlength="255" type="text" class="textInput" />
</div>
<div class="ctrlHolder">
<p class="label">{tmpl_var name='monitor_system_updates_txt'}</p>
<div class="multiField">
{tmpl_var name='monitor_system_updates'}
</div>
</div> </div>
</fieldset> </fieldset>
......
...@@ -132,7 +132,7 @@ class monitor_tools { ...@@ -132,7 +132,7 @@ class monitor_tools {
$distver = 'Squeeze/Sid'; $distver = 'Squeeze/Sid';
$distid = 'debian60'; $distid = 'debian60';
$distbaseid = 'debian'; $distbaseid = 'debian';
} 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') { } 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') {
$distname = 'Debian'; $distname = 'Debian';
$distver = 'Wheezy/Sid'; $distver = 'Wheezy/Sid';
$distid = 'debian60'; $distid = 'debian60';
......
...@@ -419,6 +419,10 @@ class monitor_core_module { ...@@ -419,6 +419,10 @@ class monitor_core_module {
* OK - here we go... * OK - here we go...
*/ */
global $app; global $app;
$app->uses('getconf');
$server_config = $app->getconf->get_server_config($conf['server_id'], 'server');
if($server_config['monitor_system_updates'] == 'n') return;
/* /*
* First we get the Monitoring-data from the tools * First we get the Monitoring-data from the tools
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment