Module: check_mk
Branch: master
Commit: 55c5056b215cdc268fc38dedd45dc514137d1cc2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=55c5056b215cdc…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Jul 1 18:33:41 2014 +0200
added wato_hook_cleanup_folders.py in treasures: a script to delete e. g. folders of other customers on slave sites directly after the replication
---
doc/treasures/wato_hook_cleanup_folders.py | 49 ++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)
diff --git a/doc/treasures/wato_hook_cleanup_folders.py b/doc/treasures/wato_hook_cleanup_folders.py
new file mode 100644
index 0000000..8ab534c
--- /dev/null
+++ b/doc/treasures/wato_hook_cleanup_folders.py
@@ -0,0 +1,49 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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.
+
+# put this script into local/share/check_mk/web/plugins/wato
+# of a slave site
+# this deletes all WATO folders immediatelly after sync except one
+# folder with the same name as the site name of the slave site
+#
+# it can be used to avoid a customer to see config of other customers
+# for this to work you need to have one folder per customer on the top
+# level and one site per customer with exactly the same name
+def pre_activate_changes_cleanup(_unused):
+ log = open('%s/tmp/hook.log' % defaults.omd_root,'w')
+ log.write('omd_site: %s, omd_root: %s\n' % (defaults.omd_site, defaults.omd_root))
+ confd = "%s/etc/check_mk/conf.d/wato/" % defaults.omd_root
+ for dirname, dirnames, filenames in os.walk(confd):
+ for subdirname in dirnames:
+ if subdirname == defaults.omd_site:
+ log.write("keeping subdir: %s\n" % subdirname)
+ else:
+ log.write("deletinging subdir: %s\n" % subdirname)
+ shutil.rmtree(confd + subdirname)
+ break
+ log.close()
+
+api.register_hook('pre-activate-changes', pre_activate_changes_cleanup)
Module: check_mk
Branch: master
Commit: a12291264ba00edb82f5e39d7f24e23b6f8949b1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a12291264ba00e…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed Jul 2 10:14:56 2014 +0200
notify_multitech.py: Added a hint about passwords to use
---
doc/treasures/notify_multitech.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/doc/treasures/notify_multitech.py b/doc/treasures/notify_multitech.py
index ba3f949..4d57b35 100755
--- a/doc/treasures/notify_multitech.py
+++ b/doc/treasures/notify_multitech.py
@@ -42,6 +42,9 @@
# * Under
# SMS Services > Send SMS Users
# create a user for Check_MK. This one needs to be entered below.
+# Make sure you choose a password, which is not longer than 8 characters.
+# On the device it is possible to set a longer password, but authentication
+# with it is impossible!! :-(
#
# * Do not forget to go to the "Save & Restart" tab and click "save" there.
# This writes your changes into the flash memory of the device. Otherwise
Module: check_mk
Branch: master
Commit: 6dfcbb60e3be64dcd701aa6abbc1378d4f4a1f3e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6dfcbb60e3be64…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Jul 2 10:09:02 2014 +0200
FIX Avoid sporadic errors when checking event state in Event Console
When you add the check for checking the current event state of a host
in the Event Console than under heavy load it could sometimes happen
that the check would run into an error (<tt>Ressource temporarily unavailable</tt>).
This has been fixed by switching from the Python version of <tt>check_mkevents</tt>
to the C version. This also saves CPU ressources if you have a larger
number of hosts.
---
.werks/1040 | 14 ++++++++++++++
ChangeLog | 3 +++
mkeventd/lib/.gitignore | 2 +-
mkeventd/lib/Makefile | 8 ++++----
mkeventd/lib/{check_mkevents => check_mkevents.py} | 3 +++
5 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/.werks/1040 b/.werks/1040
new file mode 100644
index 0000000..7e294dd
--- /dev/null
+++ b/.werks/1040
@@ -0,0 +1,14 @@
+Title: Avoid sporadic errors when checking event state in Event Console
+Level: 2
+Component: ec
+Class: fix
+State: unknown
+Version: 1.2.5i5
+Date: 1404288443
+
+When you add the check for checking the current event state of a host
+in the Event Console than under heavy load it could sometimes happen
+that the check would run into an error (<tt>Ressource temporarily unavailable</tt>).
+This has been fixed by switching from the Python version of <tt>check_mkevents</tt>
+to the C version. This also saves CPU ressources if you have a larger
+number of hosts.
diff --git a/ChangeLog b/ChangeLog
index 81f7bad..1d3eb28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,9 @@
Reporting & Availability:
* 0991 FIX: Availability: optionally show time stamps as UNIX epoch time...
+ Event Console:
+ * 1040 FIX: Avoid sporadic errors when checking event state in Event Console...
+
Livestatus:
* 0988 FIX: livedump: Fix exception in case no contact groups are defined for a service
diff --git a/mkeventd/lib/.gitignore b/mkeventd/lib/.gitignore
index eb18566..d921ff9 100644
--- a/mkeventd/lib/.gitignore
+++ b/mkeventd/lib/.gitignore
@@ -1 +1 @@
-check_mkevents_c
+check_mkevents
diff --git a/mkeventd/lib/Makefile b/mkeventd/lib/Makefile
index fc6cfd7..1b433bc 100644
--- a/mkeventd/lib/Makefile
+++ b/mkeventd/lib/Makefile
@@ -22,10 +22,10 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-all: check_mkevents_c
+all: check_mkevents
-check_mkevents_c: check_mkevents.cc
- g++ -O2 -o check_mkevents_c check_mkevents.cc
+check_mkevents: check_mkevents.cc
+ g++ -O2 -s -o check_mkevents check_mkevents.cc
clean:
- rm -f check_mkevents_c
+ rm -f check_mkevents
diff --git a/mkeventd/lib/check_mkevents b/mkeventd/lib/check_mkevents.py
similarity index 98%
rename from mkeventd/lib/check_mkevents
rename to mkeventd/lib/check_mkevents.py
index 8d745d9..08b0b40 100755
--- a/mkeventd/lib/check_mkevents
+++ b/mkeventd/lib/check_mkevents.py
@@ -1,5 +1,8 @@
#!/usr/bin/python
+# Old, outdated Python version of check_mkevents. Do not use
+# anymore...
+
import os, socket, sys
try:
Module: check_mk
Branch: master
Commit: 11575c7db70ddca435f7f92c266cfaa21c8d0ee9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11575c7db70ddc…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Tue Jul 1 16:15:26 2014 +0200
FIX: missing laser power information is ignored for service interfaces
---
checkman/adva_fsp_if | 4 ++++
checks/adva_fsp_if | 18 ++++++++++--------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/checkman/adva_fsp_if b/checkman/adva_fsp_if
index dac243f..e0c2eca 100644
--- a/checkman/adva_fsp_if
+++ b/checkman/adva_fsp_if
@@ -15,6 +15,10 @@ description:
and output (transmit) power of the laser. Per default, not limits are imposed,
since meaningful values depend on the type of interface.
+ A {WARN} state is triggered if no laser power information can be found.
+ Service interfaces (item name beginning with "S") do not have laser power
+ information, so that non-existent laser power information is ignored for these
+ interfaces.
item:
There are three allowed ways to specify an interface: {1}: the last component
diff --git a/checks/adva_fsp_if b/checks/adva_fsp_if
index 8a8c854..a5cdb4c 100644
--- a/checks/adva_fsp_if
+++ b/checks/adva_fsp_if
@@ -80,9 +80,9 @@ def check_adva_fsp_if(item, params, info):
if line[0] == index:
state = 0
admintxt, adminstate = adva_fsp_if_adminstates[line[3]]
- state = max(adminstate,state)
+ state = max(adminstate, state)
opertxt, operstate = adva_fsp_if_operstates[line[4]]
- state = max(operstate,state)
+ state = max(operstate, state)
if state == 2:
statesym = "(!!)"
elif state == 1:
@@ -100,15 +100,16 @@ def check_adva_fsp_if(item, params, info):
state = 2
osym = "(!!)"
elif owarn and output_power < owarn:
- state = max(1,state)
+ state = max(1, state)
osym = "(!)"
else:
osym = ""
infotext += ", Output Power: %.1f%s" % ( output_power, osym )
perfdata.append( ("output_power", str(output_power)+"dBm", str(owarn)+":", str(ocrit)+":") )
except:
- infotext += ", Output Power: n.a. (!)"
- state = max(1,state)
+ if not re.match("S", item): # service interface does not have power parameter
+ infotext += ", Output Power: n.a. (!)"
+ state = max(1,state)
try:
@@ -118,15 +119,16 @@ def check_adva_fsp_if(item, params, info):
state = 2
isym = "(!!)"
elif iwarn and input_power < iwarn:
- state = max(1,state)
+ state = max(1, state)
isym = "(!)"
else:
isym = ""
infotext += ", Input Power: %.1f%s" % ( input_power, isym )
perfdata.append( ("input_power", str(input_power)+"dBm", str(iwarn)+":", str(icrit)+":") )
except:
- infotext += ", Input Power: n.a. (!)"
- state = max(1,state)
+ if not re.match("S", item): # service interface does not have power parameter
+ infotext += ", Input Power: n.a. (!)"
+ state = max(1,state)
return(state, infotext, perfdata)