Module: check_mk
Branch: master
Commit: 7869f2d3dd7bb9af288c6537335ddd3020699fe9
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7869f2d3dd7bb9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Nov 18 15:03:05 2013 +0100
Logwatch: context lines can now be disabled using nocontext=1
Each line which comes together with a line matching a logwatch pattern
is proceeded to the monitoring host as context line. This can now be
disabled using the linux agent plugin by adding the option "nocontext=1"
to the header line of a logfile configuration in logwatch.cfg
---
.werks/214 | 11 +++++++++++
ChangeLog | 1 +
agents/plugins/mk_logwatch | 5 +++++
3 files changed, 17 insertions(+)
diff --git a/.werks/214 b/.werks/214
new file mode 100644
index 0000000..30d8ab0
--- /dev/null
+++ b/.werks/214
@@ -0,0 +1,11 @@
+Title: Logwatch: context lines can now be disabled using nocontext=1
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1384783276
+Class: feature
+
+Each line which comes together with a line matching a logwatch pattern
+is proceeded to the monitoring host as context line. This can now be
+disabled using the linux agent plugin by adding the option "nocontext=1"
+to the header line of a logfile configuration in logwatch.cfg
diff --git a/ChangeLog b/ChangeLog
index 0573e06..e8d4e8d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
* 0093 check_http: Default service description prefix can be avoided...
* 0004 df: dynamic filesystem levels now reorder levels automatically...
* 0069 veeam_client: limits for time since last backup introduced
+ * 0214 Logwatch: context lines can now be disabled using nocontext=1...
* 0024 FIX: cisco_wlc: removed configuration parameter ap_model
* 0065 FIX: veeam_client: check behaviour improved when backup is in progress
* 0066 FIX: veeam_jobs: check behaviour improved when backup is in progress
diff --git a/agents/plugins/mk_logwatch b/agents/plugins/mk_logwatch
index 6cd4e3f..3dbca32 100755
--- a/agents/plugins/mk_logwatch
+++ b/agents/plugins/mk_logwatch
@@ -293,6 +293,8 @@ def process_logfile(logfile, patterns):
line = line.replace("\1", "\nCONT:")
if level == "I":
level = "."
+ if opt_nocontext and level == '.':
+ continue
outputtxt += "%s%s %s%s\n" % (color, level, line[:-1], tty_normal)
new_offset = os.lseek(fl, 0, 1) # os.SEEK_CUR not available in Python 2.4
@@ -328,6 +330,7 @@ for filenames, patterns in config:
opt_regex = None
opt_overflow = 'C'
opt_overflow_level = 2
+ opt_nocontext = False
try:
options = [ o.split('=', 1) for o in filenames if '=' in o ]
for key, value in options:
@@ -344,6 +347,8 @@ for filenames, patterns in config:
opt_regex = re.compile(value)
elif key == 'iregex':
opt_regex = re.compile(value, re.I)
+ elif key == 'nocontext':
+ opt_nocontext = True
else:
raise Exception("Invalid option %s" % key)
except Exception, e:
Module: check_mk
Branch: master
Commit: 515577287cb7106a6ad6cf4db397c38e554fae4c
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=515577287cb710…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 15 00:03:21 2013 +0100
Updated bug entries #1025
---
.bugs/1025 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/.bugs/1025 b/.bugs/1025
new file mode 100644
index 0000000..6e927e5
--- /dev/null
+++ b/.bugs/1025
@@ -0,0 +1,11 @@
+Title: HTML tags are interpreted on Global Settings page
+Component: wato
+State: open
+Date: 2013-11-14 23:58:41
+Targetversion: 1.2.3i6
+Class: bug
+
+Mail template, parameters in mail command or
+page title might contain < or > chars which are interpreted
+as html tags on the global settings page. These tags should
+really be escaped somehow.
Module: check_mk
Branch: master
Commit: f68a98683ec025cc9faafff9df139d97f2bd862f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f68a98683ec025…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Fri Nov 15 10:56:52 2013 +0100
veeam_client: limits for time since last backup introduced
---
.werks/69 | 8 +++++++
ChangeLog | 2 +-
checkman/veeam_client | 24 +++++++++++++++++---
checks/veeam_client | 40 +++++++++++++++++++++++++++++-----
web/plugins/wato/check_parameters.py | 20 +++++++++++++++++
5 files changed, 85 insertions(+), 9 deletions(-)
diff --git a/.werks/69 b/.werks/69
new file mode 100644
index 0000000..acfad14
--- /dev/null
+++ b/.werks/69
@@ -0,0 +1,8 @@
+Title: veeam_client: limits for time since last backup introduced
+Level: 1
+Component: checks
+Version: 1.2.3i7
+Date: 1384509363
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 3639ddb..f2aede8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@
* 0208 fileinfo.groups: Added minimum/maximum file size parameters...
* 0093 check_http: Default service description prefix can be avoided...
* 0004 df: dynamic filesystem levels now reorder levels automatically...
+ * 0069 veeam_client: limits for time since last backup introduced
* 0024 FIX: cisco_wlc: removed configuration parameter ap_model
* 0065 FIX: veeam_client: check behaviour improved when backup is in progress
* 0066 FIX: veeam_jobs: check behaviour improved when backup is in progress
@@ -37,7 +38,6 @@
WATO:
* 0053 New rule for configuring the display_name of a service...
- * 0008 Test - Please ignore...
* 0048 FIX: Fixed locking issue on host diagnose page
* 0033 FIX: WATO forms: incorrect handling of checkbox state
* 0205 FIX: Allowing star chars in variable names to fix role/permission editing...
diff --git a/checkman/veeam_client b/checkman/veeam_client
index 83ce3fb..c74a1f6 100644
--- a/checkman/veeam_client
+++ b/checkman/veeam_client
@@ -17,11 +17,29 @@ description:
or {InProgress}. It is {WARN} if the status is {Warning}. It is {CRIT}
if the status of the backup is {Failed}.
-inventory:
- A check will be created for all hosts known to check_mk and reported
- by the Veeam agent plugin.
+ In addition {WARN} and {CRIT} levels can be set for the time since the end
+ of the last backup.
+
+examples:
+ # sets the warning and critical levels to 5 and 10 days, respectively
+ veeam_client_default_levels = { "age": ( 432000, 864000 ) }
perfdata:
Total Size, duration and the average speed of the backup will be recorded
as performance data. Duration will not be recorded if the status of the backup
is {Pending} or {InProgress}.
+
+inventory:
+ A check will be created for all hosts known to check_mk and reported
+ by the Veeam agent plugin.
+
+[parameters]
+parameters(tuple): parameters is a dictionary with one value
+
+ {"age"}: a tuple of warning and critical limits for the time since last
+ backup in seconds
+
+
+[configuration]
+veeam_client_default_levels (dict): This variable is preset to
+{{ "age": ( 108000, 172800 ) } }
diff --git a/checks/veeam_client b/checks/veeam_client
index 2b11b8f..53c1c1e 100644
--- a/checks/veeam_client
+++ b/checks/veeam_client
@@ -24,13 +24,22 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+import datetime, time
+
+veeam_client_default_levels = { "age": ( 108000, 172800 ) } # 30h/2d
+
state = { "Success": 0, "Failed": 2, "Warning":1, "InProgress":0, "Pending":0 }
def inventory_veeam_client(info):
if info[0][0] == "Status":
- return [ (None, None) ]
+ return [ (None, veeam_client_default_levels) ]
def check_veeam_client(item, params, info):
+ if params.get("age"):
+ warn, crit = params['age']
+ else:
+ warn, crit = veeam_default_levels.get("age")
+
if not info[0][0] == "Status":
return 3, "No status data found in first line of agent data"
result = ""
@@ -57,18 +66,39 @@ def check_veeam_client(item, params, info):
elif line[0] == "TotalSizeByte":
totalsize = saveint(line[1])
perfdata.append(("totalsize", totalsize, 0, 0, 0))
- else:
- if (result == "InProgress" or result == "Pending") and line[0] == "StopTime":
+ elif line[0] == "StopTime":
+ if (result == "InProgress" or result == "Pending"):
infotxt += line[0] + ": - "
else:
- infotxt += line[0] + ":" + line[1] + " "
+ now = datetime.datetime.now()
+ date, time = line[1].split(" ")
+ day, month, year = map(int, date.split("."))
+ hour, minute, second = map(int, time.split(":"))
+ stoptime = datetime.datetime( year, month, day, hour, minute, second)
+ warndiff = datetime.timedelta(seconds=warn)
+ critdiff = datetime.timedelta(seconds=crit)
+
+ if critdiff < now - stoptime:
+ stopstate = 2
+ stopsym = "( >%s ago)(!!)" % get_age_human_readable(crit)
+ elif warndiff < now - stoptime:
+ stopstate = 1
+ stopsym = "( >%s ago)(!)" % get_age_human_readable(warn)
+ else:
+ stopstate = 0
+ stopsym = ""
+ infotxt += line[0] + ":" + line[1] + stopsym + " "
+ else:
+ infotxt += line[0] + ":" + line[1] + " "
- return (state[result], infotxt, perfdata)
+ status = max(state[result], stopstate)
+ return (status, infotxt, perfdata)
check_info["veeam_client"] = {
'check_function': check_veeam_client,
'inventory_function': inventory_veeam_client,
'service_description': 'VEEAM Client',
+ 'group': 'veeam_backup',
'has_perfdata': True,
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index e970bc3..bb4f649 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2410,6 +2410,26 @@ register_check_parameters(
register_check_parameters(
subgroup_applications,
+ "veeam_backup",
+ _("Veeam Time since last Backup"),
+ Dictionary(
+ elements = [
+ ("age",
+ Tuple(
+ title = _("Time since end of last backup"),
+ elements = [
+ Age(title = _("Warning if older than"), default_value = 108000),
+ Age(title = _("Critical if older than"), default_value = 172800)
+ ]
+ )
+ )]
+ ),
+ None,
+ None
+)
+
+register_check_parameters(
+ subgroup_applications,
"mssql_counters_locks",
_("MSSQL Locks"),
Dictionary(