Module: check_mk
Branch: master
Commit: b7187a1738b9334b6314ec3bb99353a5bd21e59a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b7187a1738b933…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Oct 1 13:03:55 2012 +0200
Added option to win_dhcp_pool to prevent inventorization of empty pools
---
checkman/win_dhcp_pools | 2 ++
checks/win_dhcp_pools | 24 +++++++++++++++++++++++-
web/plugins/wato/check_mk_configuration.py | 10 ++++++++++
3 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/checkman/win_dhcp_pools b/checkman/win_dhcp_pools
index a0f4e83..f040ac1 100644
--- a/checkman/win_dhcp_pools
+++ b/checkman/win_dhcp_pools
@@ -36,3 +36,5 @@ critical (int): Percentage of free leases to be left in the pool to issue a crit
win_dhcp_pools_default_levels (float, float): The global default levels for all checks
of this type. This is preset to {(10, 5)} (which means that the check
gets critical if the pool has less than 5 percent of free leases left).
+win_dhcp_pools_inventorize_empty (bool): Set to {True} if you want to inventorize
+ pools without any IP Address in it.
diff --git a/checks/win_dhcp_pools b/checks/win_dhcp_pools
index 1da4c77..d85a45e 100644
--- a/checks/win_dhcp_pools
+++ b/checks/win_dhcp_pools
@@ -61,6 +61,9 @@
# No. of pending offers = 0.
win_dhcp_pools_default_levels = (10, 5)
+win_dhcp_pools_inventorize_empty = False
+
+check_config_variables += [ "win_dhcp_pools_inventorize_empty"]
win_dhcp_pools_stats_translate = {
'Entdeckungen': 'Discovers',
@@ -82,9 +85,28 @@ def parse_win_dhcp_pools(info):
def inventory_win_dhcp_pools(info):
inventory = []
+ if win_dhcp_pools_inventorize_empty == True:
+ for line in parse_win_dhcp_pools(info):
+ if win_dhcp_pools_stats_translate.get(line[0], line[0]) == 'Subnet':
+ inventory.append((line[1], 'win_dhcp_pools_default_levels'))
+ return inventory
+
+ inBlock = False
+ last_pool = ""
+ poolStats = []
for line in parse_win_dhcp_pools(info):
if win_dhcp_pools_stats_translate.get(line[0], line[0]) == 'Subnet':
- inventory.append((line[1], 'win_dhcp_pools_default_levels'))
+ inBlock = True
+ last_pool = line[1]
+ continue
+ if inBlock:
+ poolStats.append(saveint(line[1]))
+ if len(poolStats) == 3:
+ inBlock = False
+ used, free, pending = poolStats
+ size = used + free + pending
+ if size > 0:
+ inventory.append((last_pool, 'win_dhcp_pools_default_levels'))
return inventory
def check_win_dhcp_pools(item, params, info):
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 09bda23..4cf93bf 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -563,6 +563,16 @@ register_configvar(group,
)
register_configvar(group,
+ "win_dhcp_pools_inventorize_empty",
+ Checkbox(
+ title = _("Invetorize empty windows dhcp pools"),
+ help = _("You can activate the inventorization of "
+ "dhcp pools, which have no ip addresses in it"),
+ ),
+ need_restart = True
+ )
+
+register_configvar(group,
"printer_supply_some_remaining_status",
DropdownChoice(
title = _("Printer supply some ramaining status"),
Module: check_mk
Branch: master
Commit: 7cb2859a60b1e52a7a411160fe28303f52765505
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7cb2859a60b1e5…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Oct 1 12:23:32 2012 +0200
Fix: new rule to change the output of logwatch
---
checkman/logwatch | 5 +++--
web/plugins/wato/check_mk_configuration.py | 12 +++++++-----
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/checkman/logwatch b/checkman/logwatch
index da4d90c..153c6bc 100644
--- a/checkman/logwatch
+++ b/checkman/logwatch
@@ -88,5 +88,6 @@ logwatch_dir (string): Directory where log messages are
replaced by backslashes.
logwatch_service_output (string): Change the output of the service to ony
- print stats and not the last error message. Default is {default}, use {small} if
- you only want to have the stats.
+ show the count of events whitout the last error message. Default is {default} which
+ shows the last error message and the count, use {count} if
+ you only want to see the count.
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index f71b035..d3749d2 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -549,15 +549,17 @@ register_configvar(group,
register_configvar(group,
"logwatch_service_output",
DropdownChoice(
- title = _("Service output of Logwatch"),
- help = _("You can change the output of the logwatch service "
- "between an view with oh"),
+ title = _("Service output for logwatch"),
+ help = _("You can change the plugin output of logwatch "
+ "to show only the count of messages or also "
+ "to show the last worst message"),
choices = [
- ( 'default' , _("Output last log message in service output") ),
- ( 'small', _("Only print stats in service output")),
+ ( 'default' , _("Show count and last message") ),
+ ( 'count', _("Show only count")),
],
default_value = 'default',
),
+ need_restart = True
)
register_configvar(group,
Module: check_mk
Branch: master
Commit: c9ac411584132f5b87d89c58b2f2d4519884a1ad
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c9ac411584132f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Oct 1 11:29:35 2012 +0200
FIX: BI: Assuming "OK" for hosts is now possible
---
.bugs/779 | 7 +++++--
ChangeLog | 1 +
web/htdocs/js/bi.js | 8 +++++---
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/.bugs/779 b/.bugs/779
index e6dd858..c37ddfb 100644
--- a/.bugs/779
+++ b/.bugs/779
@@ -1,9 +1,12 @@
Title: BI cannot assume UP host state
Component: bi
-State: open
+Class: bug
+State: done
Date: 2012-06-26 17:54:41
Targetversion: 1.2.0
-Class: bug
You can assume OK as service state but not UP
as host state (just DOWN and UNREACH).
+
+2012-10-01 11:29:28: changed state open -> done
+Has just been fixed.
diff --git a/ChangeLog b/ChangeLog
index db3f7e0..b879144 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
1.2.0p3:
Mulitisite
* Added "view" parameter to dashlet_pnpgraph webservice
+ * FIX: BI: Assuming "OK" for hosts is now possible
WATO
* Added "profile" option to be configurable via browser
diff --git a/web/htdocs/js/bi.js b/web/htdocs/js/bi.js
index 345001a..334de7e 100644
--- a/web/htdocs/js/bi.js
+++ b/web/htdocs/js/bi.js
@@ -87,14 +87,16 @@ function toggle_assumption(oImg, site, host, service)
current = current.substr(7);
current = current.substr(0, current.length - 4);
if (current == 'none')
+ // Assume WARN when nothing assumed yet
current = '1';
- else if (current == '3')
+ else if (current == '3' || (service == '' && current == '2'))
+ // Assume OK when unknown assumed (or when critical assumed for host)
current = '0'
else if (current == '0')
- current = 'none'
- else if (current == '2' && service == '')
+ // Disable assumption when ok assumed
current = 'none'
else
+ // In all other cases increas the assumption
current = parseInt(current) + 1;
var url = "bi_set_assumption.py?site=" + encodeURIComponent(site)