Module: check_mk
Branch: master
Commit: ab176998fd2e048ca770beab9c4812ac2d203946
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab176998fd2e04…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Oct 5 11:16:51 2017 +0200
5362 FIX Fixed possible exception on global settings page related to "diskspace cleanup"
In 1.2.8 or older it was possible to configure "max_file_age = None" in the etc/diskspace.conf
file. This value was not interpreted correctly by the current code which lead to an exception
"TypeError: unsupported operand type(s) for divmod(): 'NoneType' and 'int'" on the global settings
page.
To workaround this issue, you could remove this option form the etc/diskspace.conf file.
Change-Id: If6ed76861a6596d034af4209b2c6765b2ca533ea
---
.werks/5362 | 15 +++++++++++++++
web/plugins/wato/omd_configuration.py | 3 +++
2 files changed, 18 insertions(+)
diff --git a/.werks/5362 b/.werks/5362
new file mode 100644
index 0000000..6b42b14
--- /dev/null
+++ b/.werks/5362
@@ -0,0 +1,15 @@
+Title: Fixed possible exception on global settings page related to "diskspace cleanup"
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1507194818
+Class: fix
+
+In 1.2.8 or older it was possible to configure "max_file_age = None" in the etc/diskspace.conf
+file. This value was not interpreted correctly by the current code which lead to an exception
+"TypeError: unsupported operand type(s) for divmod(): 'NoneType' and 'int'" on the global settings
+page.
+
+To workaround this issue, you could remove this option form the etc/diskspace.conf file.
diff --git a/web/plugins/wato/omd_configuration.py b/web/plugins/wato/omd_configuration.py
index c7b3937..11d7734 100644
--- a/web/plugins/wato/omd_configuration.py
+++ b/web/plugins/wato/omd_configuration.py
@@ -198,6 +198,9 @@ class ConfigDomainDiskspace(ConfigDomain):
if cleanup_settings.get("cleanup_abandoned_host_files", False) == None:
del cleanup_settings["cleanup_abandoned_host_files"]
+ if cleanup_settings.get("max_file_age", False) == None:
+ del cleanup_settings["max_file_age"]
+
return {
"diskspace_cleanup": cleanup_settings,
}
Module: check_mk
Branch: master
Commit: 9117b72fb57d8127869026fe237a65e6ac2901a0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9117b72fb57d81…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Thu Oct 5 08:34:15 2017 +0200
Remove unused SectionCrashDebug
SectionCrashDebug was removed in commit
8f4a78097b1472cccdc8f94ff7e2db7cbb9ec162. The files were
accidentally left in Git and the header file was also
unnecessarily included in SectionManager.cc.
Change-Id: I7ea614f08d264bffd19fa766448d2e14e13b56f0
---
agents/windows/SectionManager.cc | 1 -
agents/windows/sections/SectionCrashDebug.cc | 39 --------------------------
agents/windows/sections/SectionCrashDebug.h | 42 ----------------------------
3 files changed, 82 deletions(-)
diff --git a/agents/windows/SectionManager.cc b/agents/windows/SectionManager.cc
index 534430f..cf202bb 100644
--- a/agents/windows/SectionManager.cc
+++ b/agents/windows/SectionManager.cc
@@ -3,7 +3,6 @@
#include "Configuration.h"
#include "Environment.h"
#include "sections/SectionCheckMK.h"
-#include "sections/SectionCrashDebug.h"
#include "sections/SectionDF.h"
#include "sections/SectionEventlog.h"
#include "sections/SectionFileinfo.h"
diff --git a/agents/windows/sections/SectionCrashDebug.cc b/agents/windows/sections/SectionCrashDebug.cc
deleted file mode 100644
index 56faeb2..0000000
--- a/agents/windows/sections/SectionCrashDebug.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// +------------------------------------------------------------------+
-// | ____ _ _ __ __ _ __ |
-// | / ___| |__ ___ ___| | __ | \/ | |/ / |
-// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-// | | |___| | | | __/ (__| < | | | | . \ |
-// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-// | |
-// | Copyright Mathias Kettner 2017 mk(a)mathias-kettner.de |
-// +------------------------------------------------------------------+
-//
-// This file is part of Check_MK.
-// The official homepage is at http://mathias-kettner.de/check_mk.
-//
-// check_mk is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation in version 2. check_mk is distributed
-// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
-// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-// PARTICULAR PURPOSE. See the GNU General Public License for more de-
-// ails. You should have received a copy of the GNU General Public
-// License along with GNU Make; see the file COPYING. If not, write
-// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-// Boston, MA 02110-1301 USA.
-
-#include "SectionCrashDebug.h"
-#include "../Environment.h"
-#include "../Logger.h"
-
-SectionCrashDebug::SectionCrashDebug(Configuration &config, Logger *logger,
- const WinApiAdaptor &winapi)
- : Section("logwatch", config.getEnvironment(), logger, winapi)
- , _crash_debug(config, "global", "crash_debug", false, winapi) {}
-
-bool SectionCrashDebug::produceOutputInner(std::ostream &out) {
- if (*_crash_debug) {
- _logger.printCrashLog(out);
- }
- return true;
-}
diff --git a/agents/windows/sections/SectionCrashDebug.h b/agents/windows/sections/SectionCrashDebug.h
deleted file mode 100644
index 5c97450..0000000
--- a/agents/windows/sections/SectionCrashDebug.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// +------------------------------------------------------------------+
-// | ____ _ _ __ __ _ __ |
-// | / ___| |__ ___ ___| | __ | \/ | |/ / |
-// | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
-// | | |___| | | | __/ (__| < | | | | . \ |
-// | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
-// | |
-// | Copyright Mathias Kettner 2017 mk(a)mathias-kettner.de |
-// +------------------------------------------------------------------+
-//
-// This file is part of Check_MK.
-// The official homepage is at http://mathias-kettner.de/check_mk.
-//
-// check_mk is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License as published by
-// the Free Software Foundation in version 2. check_mk is distributed
-// in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
-// out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-// PARTICULAR PURPOSE. See the GNU General Public License for more de-
-// ails. You should have received a copy of the GNU General Public
-// License along with GNU Make; see the file COPYING. If not, write
-// to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
-// Boston, MA 02110-1301 USA.
-
-#ifndef SectionCrashDebug_h
-#define SectionCrashDebug_h
-
-#include "../Configurable.h"
-#include "../Section.h"
-
-class SectionCrashDebug : public Section {
- Configurable<bool> _crash_debug;
-
-public:
- SectionCrashDebug(Configuration &config, Logger *logger,
- const WinApiAdaptor &winapi);
-
-protected:
- virtual bool produceOutputInner(std::ostream &out) override;
-};
-
-#endif // SectionCrashDebug_h