Module: check_mk
Branch: master
Commit: 62a45888464b1c2b5740aab8d241b6f5c174f116
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=62a45888464b1c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Dec 5 17:18:25 2014 +0100
#1706 FIX Fix file permissions when installing MKPs to 0644 or 0755
When installing MKP packages that contain files with invalid permissions
then fix these when installing the packages.
---
.bugs/763 | 6 ++++--
.bugs/784 | 6 ++++--
.werks/1706 | 10 ++++++++++
ChangeLog | 1 +
modules/packaging.py | 51 +++++++++++++++++++++++++++++---------------------
5 files changed, 49 insertions(+), 25 deletions(-)
diff --git a/.bugs/763 b/.bugs/763
index 5186307..1881842 100644
--- a/.bugs/763
+++ b/.bugs/763
@@ -1,9 +1,9 @@
Title: Duplicate Check on Cisco 4500
Component: checks
-State: open
+Class: nastiness
+State: done
Date: 2012-06-04 12:20:55
Targetversion: 1.4.0
-Class: nastiness
Generating Nagios configuration...Configuration Error: ERROR:
Duplicate service description 'Temperature Chassis Temperature Sensor'
@@ -29,3 +29,5 @@ Precedence should be:
We could do: the cmk -I outputs a warning on duplicate (automatically
ignored) services. WATO introduces a new section: "Duplicate Services"
that simply displays the ignored services.
+
+2014-12-05 17:01:29: changed state open -> done
diff --git a/.bugs/784 b/.bugs/784
index 08d50dc..55f9ee5 100644
--- a/.bugs/784
+++ b/.bugs/784
@@ -1,9 +1,9 @@
Title: mkp install should fix file permissions
Component: core
-State: open
+Class: nastiness
+State: done
Date: 2012-07-25 17:42:13
Targetversion: future
-Class: nastiness
When installing the cmc_lcp checks from Bastian from the Exchange into
GIT, then all files are not group/world readable. The MKP installer should
@@ -11,3 +11,5 @@ automatically fix file permissions.
Resolution: add a new column to packages_parts in packaging.py with the
correct target permission for that folder.
+
+2014-12-05 17:17:35: changed state open -> done
diff --git a/.werks/1706 b/.werks/1706
new file mode 100644
index 0000000..0ea1d98
--- /dev/null
+++ b/.werks/1706
@@ -0,0 +1,10 @@
+Title: Fix file permissions when installing MKPs to 0644 or 0755
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417796257
+Class: fix
+
+When installing MKP packages that contain files with invalid permissions
+then fix these when installing the packages.
diff --git a/ChangeLog b/ChangeLog
index ed7ab9d..cc45988 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,7 @@
* 1624 FIX: Remove illegal characters from service descriptions of active checks...
* 1628 FIX: Remove trailing backslashes from service descriptions...
* 1649 FIX: Check_MK inventory service has been renamed to Check_MK Discovery...
+ * 1706 FIX: Fix file permissions when installing MKPs to 0644 or 0755...
Checks & Agents:
* 1197 climaveneta_temp: New check for temperature sensors on Climaveneta clima devices
diff --git a/modules/packaging.py b/modules/packaging.py
index 8a7f115..6808a43 100644
--- a/modules/packaging.py
+++ b/modules/packaging.py
@@ -44,15 +44,15 @@ except:
pass
# in case of local directories (OMD) use those instead
-package_parts = [ (part, title, ldir and ldir or dir) for part, title, dir, ldir in [
- ( "checks", "Checks", checks_dir, local_checks_dir ),
- ( "notifications", "Notification scripts", notifications_dir, local_notifications_dir ),
- ( "inventory", "Inventory plugins", inventory_dir, local_inventory_dir ),
- ( "checkman", "Checks' man pages", check_manpages_dir, local_check_manpages_dir ),
- ( "agents", "Agents", agents_dir, local_agents_dir ),
- ( "web", "Multisite extensions", web_dir, local_web_dir ),
- ( "pnp-templates", "PNP4Nagios templates", pnp_templates_dir, local_pnp_templates_dir ),
- ( "doc", "Documentation files", doc_dir, local_doc_dir ),
+package_parts = [ (part, title, perm, ldir and ldir or dir) for part, title, perm, dir, ldir in [
+ ( "checks", "Checks", 0644, checks_dir, local_checks_dir ),
+ ( "notifications", "Notification scripts", 0755, notifications_dir, local_notifications_dir ),
+ ( "inventory", "Inventory plugins", 0644, inventory_dir, local_inventory_dir ),
+ ( "checkman", "Checks' man pages", 0644, check_manpages_dir, local_check_manpages_dir ),
+ ( "agents", "Agents", 0755, agents_dir, local_agents_dir ),
+ ( "web", "Multisite extensions", 0644, web_dir, local_web_dir ),
+ ( "pnp-templates", "PNP4Nagios templates", 0644, pnp_templates_dir, local_pnp_templates_dir ),
+ ( "doc", "Documentation files", 0644, doc_dir, local_doc_dir ),
]]
def packaging_usage():
@@ -166,14 +166,14 @@ def show_package(name, show_info = False):
else:
if opt_verbose:
sys.stdout.write("Files in package %s:\n" % name)
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
files = package["files"].get(part, [])
if len(files) > 0:
sys.stdout.write(" %s%s%s:\n" % (tty_bold, title, tty_normal))
for f in files:
sys.stdout.write(" %s\n" % f)
else:
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
for fn in package["files"].get(part, []):
sys.stdout.write(dir + "/" + fn + "\n")
@@ -200,7 +200,7 @@ def package_create(args):
"files" : filelists
}
num_files = 0
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
files = unpackaged_files_in_dir(part, dir)
filelists[part] = files
num_files += len(files)
@@ -216,7 +216,7 @@ def package_create(args):
def package_find(_no_args):
first = True
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
files = unpackaged_files_in_dir(part, dir)
if len(files) > 0:
if first:
@@ -243,7 +243,7 @@ def package_release(args):
os.unlink(pacpath)
verbose("Releasing files of package %s into freedom...\n" % pacname)
if opt_verbose:
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
filenames = package["files"].get(part, [])
if len(filenames) > 0:
verbose(" %s%s%s:\n" % (tty_bold, title, tty_normal))
@@ -256,7 +256,7 @@ def package_pack(args):
# Make sure, user is not in data directories of Check_MK
p = os.path.abspath(os.curdir)
- for dir in [var_dir] + [ dir for x,y,dir in package_parts ]:
+ for dir in [var_dir] + [ dir for x,y,perm,dir in package_parts ]:
if p == dir or p.startswith(dir + "/"):
raise PackageException("You are in %s!\n"
"Please leave the directories of Check_MK before creating\n"
@@ -287,7 +287,7 @@ def package_pack(args):
tar.addfile(info, info_file)
# Now pack the actual files into sub tars
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
filenames = package["files"].get(part, [])
if len(filenames) > 0:
verbose(" %s%s%s:\n" % (tty_bold, title, tty_normal))
@@ -310,7 +310,7 @@ def package_remove(args):
raise PackageException("No such package %s." % pacname)
verbose("Removing package %s...\n" % pacname)
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
filenames = package["files"].get(part, [])
if len(filenames) > 0:
verbose(" %s%s%s\n" % (tty_bold, title, tty_normal))
@@ -345,7 +345,7 @@ def package_install(args):
# Before installing check for conflicts
keep_files = {}
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
packaged = packaged_files_in_dir(part)
keep = []
keep_files[part] = keep
@@ -361,7 +361,7 @@ def package_install(args):
raise PackageException("File conflict: %s already existing." % path)
# Now install files, but only unpack files explicitely listed
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
filenames = package["files"].get(part, [])
if len(filenames) > 0:
verbose(" %s%s%s:\n" % (tty_bold, title, tty_normal))
@@ -380,9 +380,18 @@ def package_install(args):
break
tardest.write(data)
+ # Fix permissions of extracted files
+ for filename in filenames:
+ path = dir + "/" + filename
+ has_perm = os.stat(path).st_mode & 07777
+ if has_perm != perm:
+ verbose(" Fixing permissions of %s: %04o -> %04o\n" % (path, has_perm, perm))
+ os.chmod(path, perm)
+
+
# In case of an update remove files from old_package not present in new one
if update:
- for part, title, dir in package_parts:
+ for part, title, perm, dir in package_parts:
filenames = old_package["files"].get(part, [])
keep = keep_files.get(part, [])
for fn in filenames:
@@ -403,7 +412,7 @@ def files_in_dir(part, dir, prefix = ""):
return []
# Handle case where one part-dir lies below another
- taboo_dirs = [ d for p, t, d in package_parts if p != part ]
+ taboo_dirs = [ d for p, t, perm, d in package_parts if p != part ]
if dir in taboo_dirs:
return []
Module: check_mk
Branch: master
Commit: 5bcaa0e52cbae538feef256540e3798c84c80f03
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5bcaa0e52cbae5…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Dec 5 16:38:43 2014 +0100
Updated bug entries #2232
---
.bugs/2232 | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/.bugs/2232 b/.bugs/2232
new file mode 100644
index 0000000..dd38ff4
--- /dev/null
+++ b/.bugs/2232
@@ -0,0 +1,8 @@
+Title: show icon when a delayed notification is active
+Component: multisite
+State: open
+Date: 2014-12-05 16:36:50
+Targetversion: future
+Class: feature
+
+idea of a customer: show an icon when a service is in a state "delayed notification"
Module: check_mk
Branch: master
Commit: 300b2711267c5bd59d9067dc1ed6dbb74794ba25
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=300b2711267c5b…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Dec 5 16:04:46 2014 +0100
#1455 FIX hp_proliant_mem: avoid a crash of the check when module_condition is empty
---
.werks/1455 | 9 +++++++++
ChangeLog | 3 ++-
checks/hp_proliant_mem | 4 ++--
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/.werks/1455 b/.werks/1455
new file mode 100644
index 0000000..fb1fd0c
--- /dev/null
+++ b/.werks/1455
@@ -0,0 +1,9 @@
+Title: hp_proliant_mem: avoid a crash of the check when module_condition is empty
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417791862
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index f82e5d0..f60ce66 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -118,9 +118,10 @@
* 1681 FIX: cmciii_lcp_fans: Skipping non FAN units now; cleaned up check
* 1682 FIX: cmciii_lcp_waterflow: Check can now deal with devices with a different setup
* 1701 FIX: Correctly show absolute level for CPU load in case of warn/crit...
- * 1454 FIX: megaraid checks: megacli binaries in lowercase (Ubuntu..) are now also detected by the linux agent
* 1702 FIX: Fix check_notify_count: notification had been counted twice...
* 1703 FIX: ups_test: Fix computation of time since last self test...
+ * 1454 FIX: megaraid checks: megacli binaries in lowercase (Ubuntu..) are now also detected by the linux agent
+ * 1455 FIX: hp_proliant_mem: avoid a crash of the check when module_condition is empty
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/hp_proliant_mem b/checks/hp_proliant_mem
index c623b1b..16994d1 100644
--- a/checks/hp_proliant_mem
+++ b/checks/hp_proliant_mem
@@ -128,8 +128,8 @@ def check_hp_proliant_mem(item, params, info):
detail_output += '(?) '
condition = 'n/a'
- if int(module_condition) in hp_proliant_mem_condition_map:
- condition = hp_proliant_mem_condition_map[int(module_condition)]
+ if saveint(module_condition) in hp_proliant_mem_condition_map:
+ condition = hp_proliant_mem_condition_map[saveint(module_condition)]
condition_status = hp_proliant_mem_condition_status2nagios_map[condition]
detail_output += ', Condition: %s ' % condition
Module: check_mk
Branch: master
Commit: 443e3e5de300a8f3d14cf43310231f19751cb491
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=443e3e5de300a8…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Dec 5 15:22:18 2014 +0100
#1454 FIX megaraid checks: megacli binaries in lowercase (Ubuntu..) are now also detected by the linux agent
---
.werks/1454 | 9 +++++++++
ChangeLog | 1 +
agents/check_mk_agent.linux | 2 ++
3 files changed, 12 insertions(+)
diff --git a/.werks/1454 b/.werks/1454
new file mode 100644
index 0000000..6e83e40
--- /dev/null
+++ b/.werks/1454
@@ -0,0 +1,9 @@
+Title: megaraid checks: megacli binaries in lowercase (Ubuntu..) are now also detected by the linux agent
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417789268
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 78f7ee5..359ab6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -116,6 +116,7 @@
* 1681 FIX: cmciii_lcp_fans: Skipping non FAN units now; cleaned up check
* 1682 FIX: cmciii_lcp_waterflow: Check can now deal with devices with a different setup
* 1701 FIX: Correctly show absolute level for CPU load in case of warn/crit...
+ * 1454 FIX: megaraid checks: megacli binaries in lowercase (Ubuntu..) are now also detected by the linux agent
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index d381007..40d0b7e 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -355,6 +355,8 @@ if type MegaCli >/dev/null ; then
MegaCli_bin="MegaCli"
elif type MegaCli64 >/dev/null ; then
MegaCli_bin="MegaCli64"
+elif type megacli >/dev/null ; then
+ MegaCli_bin="megacli"
else
MegaCli_bin="unknown"
fi