Module: check_mk
Branch: master
Commit: dbbd896c5c85a013f712201fa418d9a7ff78ff86
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dbbd896c5c85a0…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Mar 7 09:57:12 2016 +0100
update manpage
---
checkman/varnish | 3 ---
1 file changed, 3 deletions(-)
diff --git a/checkman/varnish b/checkman/varnish
index 73be2c2..9590256 100644
--- a/checkman/varnish
+++ b/checkman/varnish
@@ -7,8 +7,5 @@ description:
This check monitors the uptime of Varnish Server provided by 'varnishstat -1'.
The Linux Agent needs to be installed.
- This check can go WARN or CRIT when the uptime is below or above certain
- configured levels.
-
inventory:
One service is created.
Module: check_mk
Branch: master
Commit: 89de71379f519ed68f18b163138c67a0ded54571
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=89de71379f519e…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Mar 4 16:10:21 2016 +0100
3001 fileinfo: now able to configure resulting state if file is missing
---
.werks/3001 | 9 +++++++++
ChangeLog | 1 +
checks/fileinfo | 5 +++--
web/plugins/wato/check_parameters.py | 6 ++++++
4 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/.werks/3001 b/.werks/3001
new file mode 100644
index 0000000..971847a
--- /dev/null
+++ b/.werks/3001
@@ -0,0 +1,9 @@
+Title: fileinfo: now able to configure the checks status if the file is missing
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1457104202
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 2bdc503..2d0b64d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@
* 3083 mk_jolokia: The plugin can now be configured with a service url to treat the jolokia server as a jmx proxy
* 3085 fortigate_signatures: new check to monitor av and ips signatures on fortigate firewalls...
* 3257 dell_idrac_virtdisks: new check which monitors the virtual disks of a Dell IDrac Device
+ * 3001 fileinfo: now able to configure the checks status if the file is missing
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/fileinfo b/checks/fileinfo
index 405fc08..51c46a4 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -108,10 +108,11 @@ def check_fileinfo(item, params, info):
in_timerange = outof_range_txt == None
reftime = int(info[0][0])
check_definition = False
+ state_missing = params.get("state_missing", 3)
for line in info[1:]:
if item == line[0]:
if line[1] == "missing":
- return in_timerange and 3 or 0, "File not found" + (outof_range_txt or "")
+ return in_timerange and state_missing or 0, "File not found" + (outof_range_txt or "")
state = 0
size = int(line[1])
age = reftime - int(line[2])
@@ -121,7 +122,7 @@ def check_fileinfo(item, params, info):
("age", age, get_age_human_readable) ]
if check_definition == False:
- return in_timerange and 3 or 0, "File not found" + (outof_range_txt or "")
+ return in_timerange and state_missing or 0, "File not found" + (outof_range_txt or "")
return fileinfo_check_function(check_definition, params, outof_range_txt)
# Extracts patterns that are relevant for the current host and item.
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index c99ad00..9c2ba0c 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2390,6 +2390,12 @@ register_check_parameters(
help = _("Outside these ranges the check will always be OK"),
count = 3,
)),
+ ("state_missing",
+ MonitoringState(
+ default_value = 3,
+ title = _("State when file is missing")
+ )
+ ),
]
),
TextAscii(
Module: check_mk
Branch: master
Commit: 177ec6c70c67d68d9b50961fc2190a81b3f5f52b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=177ec6c70c67d6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Mar 4 15:08:39 2016 +0100
Fixed multiple loading of config plugins
---
web/htdocs/config.py | 7 ++++---
web/htdocs/html_mod_python.py | 3 +++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/web/htdocs/config.py b/web/htdocs/config.py
index 2944146..5bc4557 100644
--- a/web/htdocs/config.py
+++ b/web/htdocs/config.py
@@ -131,6 +131,10 @@ def include(filename):
# Load multisite.mk and all files in multisite.d/. This will happen
# for *each* HTTP request.
+# FIXME: Optimize this to cache the config etc. until either the config files or plugins
+# have changed. We could make this being cached for multiple requests just like the
+# plugins of other modules. This may save significant time in case of small requests like
+# the graph ajax page or similar.
def load_config():
global modification_timestamps, sites
modification_timestamps = []
@@ -598,6 +602,3 @@ def load_plugins(force):
# Make sure, builtin roles are present, even if not modified and saved with WATO.
for br in builtin_role_ids:
roles.setdefault(br, {})
-
-
-load_plugins(True)
diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py
index 8777e2b..8d56604 100644
--- a/web/htdocs/html_mod_python.py
+++ b/web/htdocs/html_mod_python.py
@@ -39,6 +39,9 @@ class FinalizeRequest(Exception):
class html_mod_python(htmllib.html):
+ # The constructor must not rely on "config.", because the configuration
+ # is not loaded yet. Earliest place is self.init_modes() where config
+ # is loaded.
def __init__(self, req, fields):
req.content_type = "text/html; charset=UTF-8"
req.header_sent = False