Module: check_mk
Branch: master
Commit: efc1b31ec08b1ed87311846803e0ee5a9e231c04
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=efc1b31ec08b1e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 3 15:00:37 2013 +0200
Added manpage for esx_vsphere_hostsystem.mem_usage
---
checkman/check_mk-esx_vsphere_hostsystem.mem_usage | 36 --------------------
checkman/esx_vsphere_hostsystem.mem_usage | 26 ++++++++++++++
2 files changed, 26 insertions(+), 36 deletions(-)
diff --git a/checkman/check_mk-esx_vsphere_hostsystem.mem_usage b/checkman/check_mk-esx_vsphere_hostsystem.mem_usage
deleted file mode 100644
index 9285297..0000000
--- a/checkman/check_mk-esx_vsphere_hostsystem.mem_usage
+++ /dev/null
@@ -1,36 +0,0 @@
-title: Check usage of physical RAM on ESX host system
-agents: vsphere
-author: Mathias Kettner <mk(a)mathias-kettner.de>
-license: GPL
-distribution: check_mk
-description:
- This check measures the current usage of physical RAM by
- an ESX host system.
-
-inventory:
- One check per ESX host system is being created.
-
-
-perfdata:
- One value: the current usage in bytes.
-
-[parameters]
-warning (int or float): the percentage of virtual memory used
- by processes at which WARNING state is triggered. If the
- level is defined as an integer value then it is interpreted
- as an absolute value in megabytes.
-critical (int or float): the percentage or absolute value
- at which CRITICAL state is triggered
-
-
-[configuration]
-memused_default_levels (float, float): Levels used by
- all checks that are created by inventory.
-
-mem_extended_perfdata (boolean): If this variable is set
- to {True}, then the checks outputs additional performance
- data, if the agent provides that information. On Linux
- the amount of mapped and committed memory is output
- (see {Mapped} and {Committed_AS} in {/proc/meminfo}) and
- also the size used for page tables {Pagetables}.
-
diff --git a/checkman/esx_vsphere_hostsystem.mem_usage b/checkman/esx_vsphere_hostsystem.mem_usage
new file mode 100644
index 0000000..fb6a5cb
--- /dev/null
+++ b/checkman/esx_vsphere_hostsystem.mem_usage
@@ -0,0 +1,26 @@
+title: Usage of physical RAM on an ESX host system
+agents: vsphere
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check measures the current usage of physical RAM by
+ an ESX host system.
+
+inventory:
+ One check per ESX host system is being created.
+
+perfdata:
+ One value: the current usage in bytes.
+
+[parameters]
+warning (float): the percentage of virtual memory used
+ by processes at which WARNING state is triggered.
+critical (float): the percentage or absolute value
+ at which CRITICAL state is triggered
+
+[configuration]
+esx_host_mem_default_levels(float, float): Levels used by
+ all checks that are created by inventory. This defaults to {(80.0, 90.0)}.
+
+
Module: check_mk
Branch: master
Commit: ac40c72b220d8b1c9b01c086f2e99af397ec1125
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ac40c72b220d8b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 3 09:15:51 2013 +0200
handle exception in check_timeperiod
---
modules/check_mk_base.py | 24 ++++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index a24a650..09a3043 100755
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1493,13 +1493,21 @@ def check_timeperiod(timeperiod):
global g_inactive_timerperiods
# Let exceptions happen, they will be handled upstream.
if g_inactive_timerperiods == None:
- import socket
- s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s.connect(livestatus_unix_socket)
- # We just get the currently inactive timeperiods. All others
- # (also non-existing) are considered to be active
- s.send("GET timeperiods\nColumns:name\nFilter: in = 0\n")
- s.shutdown(socket.SHUT_WR)
- g_inactive_timerperiods = s.recv(10000000).splitlines()
+ try:
+ import socket
+ s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
+ s.connect(livestatus_unix_socket)
+ # We just get the currently inactive timeperiods. All others
+ # (also non-existing) are considered to be active
+ s.send("GET timeperiods\nColumns:name\nFilter: in = 0\n")
+ s.shutdown(socket.SHUT_WR)
+ g_inactive_timerperiods = s.recv(10000000).splitlines()
+ except Exception, e:
+ if opt_debug:
+ raise
+ else:
+ # If the query is not successful better skip this check then fail
+ return False
+
return timeperiod not in g_inactive_timerperiods
Module: check_mk
Branch: master
Commit: a77770fa6c7a34cc48986c6a71ff7810dbcd556f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a77770fa6c7a34…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed May 1 09:47:39 2013 +0200
Added draft LIESMICH.globalsettings
---
doc/drafts/LIESMICH.globalsettings | 41 ++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/doc/drafts/LIESMICH.globalsettings b/doc/drafts/LIESMICH.globalsettings
new file mode 100644
index 0000000..4a624c9
--- /dev/null
+++ b/doc/drafts/LIESMICH.globalsettings
@@ -0,0 +1,41 @@
+Manche der globalen Einstellungen wären schön, wenn man sie pro Host
+einstellen könnte. Dazu gehört z.B. das if_inventory_uses_description. Aber
+auch Dinge wie agent_min_version, agent_simulator, simulation_mode,
+inventory_max_cachefile_age, inventory_check_interval, inventory_check_severity
+und andere könnte man gut pro Host gebrauchen.
+
+Folgende Idee könnte das elegant lösen: Wir führen eine neue
+generische Regelkette global_setting_per_host[] ein. Diese
+ist eigentlich ein dict von Ketten. Beispiel:
+
+global_setting_per_host["inventory_check_interval"] = [
+ ( 120, [ "linux", "prod" ], ALL_HOSTS ),
+ ( 1440, [ "linux", "test" ], ALL_HOSTS ),
+]
+
+Die Umsetzung ist denkbar einfach: Nach dem Laden der Konfig
+wird die Variable einmal ausgewertet und die entsprechenden
+globalen Varialen gesetzt. Beim precompile muss man garnix
+ändern, weil diese Variablen dann ja schon gesetzt sind
+und korrekt einkodiert werden.
+
+In Fällen, in denen es um mehrere Host geht (z.B. cmk -I),
+muss die Funktion, die die globalen Variablen setzt, immer
+dann aufgerufen werden, wenn auf einen neuen Host umgeschaltet
+wird. Hier kann man evtl. noch ein Caching einführen, wenn
+das zulange dauert.
+
+Im WATO können wir dann etliche Variablen aus den global
+settings umziehen. Frage ist, ob wir dann auch automatisch
+eine Migration machen. Die könnte so gehen: Bei jeder globalen
+Variable, die vom Default abweicht und bei der eine Regelkette
+in der neuen Form existiert, wird - wenn diese Kette leer ist -
+eine Regeln eingefügt mit ALL_HOSTS, die genau den geänderten
+Wert einsetzt. Gleichzeitig setzen wir den Wert dann wieder
+auf den Default zurück.
+
+Dumm noch: der Benutzer sieht jetzt den Defaultwert nicht
+mehr. Aber das Problem haben wir bei allen Regelketten.
+Hier müsste man sowieso mal den Defaultwert anzeigen, der
+dann gilt, wenn keine Regel greift.
+