Module: check_mk
Branch: master
Commit: 0b7c477f95085fdc54888ca43538643e93ff58b4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0b7c477f95085f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Nov 6 11:15:52 2013 +0100
Fixed cisco_wlc: Behavier in case of missing device
---
checks/cisco_wlc | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/checks/cisco_wlc b/checks/cisco_wlc
index 77208a3..f370532 100644
--- a/checks/cisco_wlc
+++ b/checks/cisco_wlc
@@ -51,13 +51,13 @@ def check_cisco_wlc(item, params, info):
# Special treatment if this device is missing
if params:
- for name, mac, state, model in data:
- for ap_name, ap_state in params.get("ap_name", []):
- if name.startswith(ap_name):
- return ap_state, "Accesspoint not found (State set to %s by rule)" % nagios_state_names[ap_state]
- for ap_model, ap_state in params.get("ap_model", []):
- if mode.startswith(ap_model):
- return ap_state, "Accesspoint not found (State set to %s by rule)" % nagios_state_names[ap_state]
+ for ap_name, ap_state in params.get("ap_name", []):
+ if item.startswith(ap_name):
+ return ap_state, "Accesspoint 1 not found (State set to %s by rule)" % nagios_state_names[ap_state]
+ # If the device is missin, with cannot know the model
+ #for ap_model, ap_state in params.get("ap_model", []):
+ # if mode.startswith(ap_model):
+ # return ap_state, "Accesspoint 2 not found (State set to %s by rule)" % nagios_state_names[ap_state]
return 2, "Accesspoint not found"
Module: check_mk
Branch: master
Commit: acf3a001da12940e29c9f86ae0ce61d1e3764670
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=acf3a001da1294…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Tue Nov 5 18:17:39 2013 +0100
brocade_mlx: check manpages
---
checkman/brocade_mlx.module_cpu | 52 ++++++++++++++++++++++++++++++++++++++
checkman/brocade_mlx.module_mem | 4 +--
checkman/brocade_mlx.temperature | 43 +++++++++++++++++++++++++++++++
checks/brocade_mlx | 2 +-
4 files changed, 98 insertions(+), 3 deletions(-)
diff --git a/checkman/brocade_mlx.module_cpu b/checkman/brocade_mlx.module_cpu
new file mode 100644
index 0000000..5a29277
--- /dev/null
+++ b/checkman/brocade_mlx.module_cpu
@@ -0,0 +1,52 @@
+title: Brocade NetIron MLX devices: NI-MLX Module CPU Utilization
+agents: snmp
+catalog: hw/network/brocade
+license: GPL
+distribution: check_mk
+description:
+ Checks the Module CPU Utilization of a NI-MLX module in Brocade
+ NetIron MLX switching / routing devices.
+
+ {WARN} or {CRIT} is returned, if the usage in the last 60 sec was above
+ given thresholds. {OK} is returned otherwise.
+
+ Please note: Even if the check reports and graphs the CPU Utilization in
+ the last 1/5/60/300 sec, the thresholds are only checked against the value
+ of the last 60 sec. The other values are informational only.
+
+item:
+ If a module description is delivered by SNMP, the item is build from the
+ module ID plus the description. Otherwise it is just the ID.
+
+examples:
+ # set default levels to 70 and 80 percent:
+ brocade_mlx_cpu_default_levels = (70.0, 80.0)
+
+ # Check Module with ID 33 on a box called my-mlx-device with default levels
+ checks += [
+ ("my-mlx-device", "brocade_mlx.module_cpu", '33 NI-MLX-32_MR Management Module', brocade_mlx_cpu_default_levels),
+ ]
+
+ # or use individual levels for warn and crit
+ checks += [
+ ("my-mlx-device", "brocade_mlx.module_cpu", '33 NI-MLX-32_MR Management Module', (75.0, 85.0)),
+ ]
+
+perfdata:
+ four value are returned, cpu_util1, cpu_util5, cpu_util60 and cpu_util300:
+ The CPU Utilization (in percent) in the last 1/5/60/300 sec.
+ cpu_util60 together with warn and crit levels.
+
+inventory:
+ Finds one item per NI-MLX module.
+ Empty modules are omitted.
+
+[parameters]
+warn(float): {WARN} state is triggered, if the CPU utilization in percent is higher
+ than this.
+crit(float): {CRIT} state is triggered, if the CPU utilization in percent is higher
+ than this.
+
+[configuration]
+brocade_mlx_cpu_default_levels(float, float): The standard levels for {WARN} and
+ {CRIT}. Defaults are (80.0, 90.0)
diff --git a/checkman/brocade_mlx.module_mem b/checkman/brocade_mlx.module_mem
index 4faa737..df88967 100644
--- a/checkman/brocade_mlx.module_mem
+++ b/checkman/brocade_mlx.module_mem
@@ -37,9 +37,9 @@ inventory:
Empty modules are omitted.
[parameters]
-warn(int): {WARN} state is triggered, if the memory usage in percent is higher
+warn(float): {WARN} state is triggered, if the memory usage in percent is higher
than this.
-crit(int): {CRIT} state is triggered, if the memory usage in percent is higher
+crit(float): {CRIT} state is triggered, if the memory usage in percent is higher
than this.
[configuration]
diff --git a/checkman/brocade_mlx.temperature b/checkman/brocade_mlx.temperature
new file mode 100644
index 0000000..0502d6d
--- /dev/null
+++ b/checkman/brocade_mlx.temperature
@@ -0,0 +1,43 @@
+title: Brocade NetIron MLX devices: Temperature Sensors
+agents: snmp
+catalog: hw/network/brocade
+license: GPL
+distribution: check_mk
+description:
+ Checks the temperature sensors in Brocade NetIron MLX switching / routing
+ devices.
+
+ {WARN} or {CRIT} is returned, if the temperature is above given thresholds.
+ {OK} is returned otherwise.
+
+item:
+ The description of the temperature sensor as provided by SNMP.
+
+examples:
+ # set default levels to 70°C and 80°C:
+ brocade_mlx_temperature_default_levels = (70, 80)
+
+ # Check a sensor with description Switch Fabric module 0, sensor 1 temperature
+ # on a box called my-mlx-device with default levels
+ checks += [
+ ("my-mlx-device", "brocade_mlx.temperature", 'Switch Fabric module 0, sensor 1 temperature', brocade_mlx_temperature_default_levels)
+ ]
+
+ # or use individual levels for warn and crit
+ checks += [
+ ("my-mlx-device", "brocade_mlx.temperature", 'Switch Fabric module 0, sensor 1 temperature', (80, 100)
+ ]
+
+perfdata:
+ one value is returned: The temperature in °C, together with warn and crit levels
+
+inventory:
+ Finds one item per temperature sensor
+
+[parameters]
+warn(int): {WARN} state is triggered, if the temperature is higher than this.
+crit(int): {CRIT} state is triggered, if the temperature is higher than this.
+
+[configuration]
+brocade_mlx_temperature_default_levels(int, int): The standard levels for {WARN}
+ and {CRIT}. Defaults are (100, 120)
diff --git a/checks/brocade_mlx b/checks/brocade_mlx
index f8bec7a..782a247 100644
--- a/checks/brocade_mlx
+++ b/checks/brocade_mlx
@@ -170,7 +170,7 @@ def check_brocade_mlx_module_mem(item, params, info):
status = 2
errorstring = " (!!)"
- return status, "%s Bytes used (%0.1f%%%s) of total %s Bytes" % \
+ return status, "%s used (%0.1f%%%s) of total %s" % \
(get_bytes_human_readable(mem_used), mem_used_percent, \
errorstring, get_bytes_human_readable(mem_total)), \
perfdata
Module: check_mk
Branch: master
Commit: 160d0d94595d516a860ae7efaf5f8fae24c3c51f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=160d0d94595d51…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 5 17:32:54 2013 +0100
New labelling options for availability table
In the availability reporting options there is now a new box called
<i>Labelling Options</i> with three new check boxes:
<ul>
<li><i>Do not display the host name</i>: This simply removes the column with the host name.
This is useful when you know that your report is about services of a single host anyway.</li>
<li><i>Use alternative display name for services</i>: When you have configured alternative
display names for (some of) your services then you can have this names being used instead
of the normal ones.</li>
<li><i>Do not display icons for history and timeline</i>: this simply removes the left-most
column with the icons. This is useful when you want to export the resulting table into
some report (by simply copying or screenshoting the HTML output).</li>
</ul>
---
.werks/54 | 21 ++++++++++++++
ChangeLog | 1 +
web/plugins/views/availability.py | 58 ++++++++++++++++++++++++++-----------
3 files changed, 63 insertions(+), 17 deletions(-)
diff --git a/.werks/54 b/.werks/54
new file mode 100644
index 0000000..7298192
--- /dev/null
+++ b/.werks/54
@@ -0,0 +1,21 @@
+Title: New labelling options for availability table
+Level: 2
+Component: reporting
+Version: 1.2.3i7
+Date: 1383668860
+Class: feature
+
+In the availability reporting options there is now a new box called
+<i>Labelling Options</i> with three new check boxes:
+
+<ul>
+<li><i>Do not display the host name</i>: This simply removes the column with the host name.
+This is useful when you know that your report is about services of a single host anyway.</li>
+<li><i>Use alternative display name for services</i>: When you have configured alternative
+display names for (some of) your services then you can have this names being used instead
+of the normal ones.</li>
+<li><i>Do not display icons for history and timeline</i>: this simply removes the left-most
+column with the icons. This is useful when you want to export the resulting table into
+some report (by simply copying or screenshoting the HTML output).</li>
+</ul>
+
diff --git a/ChangeLog b/ChangeLog
index 0920db1..eb78c38 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,7 @@
Reporting & Availability:
* 0051: Option for showing timeline directly in availability table...
* 0052: Visual colorization of availability according to levels...
+ * 0054: New labelling options for availability table...
Livestatus:
* 0023 FIX: table statehist: code cleanup / minor performance improvements...
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index b637a9e..1f7c933 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -67,7 +67,7 @@ def render_availability(view, datasource, filterheaders, display_options,
html.write(avoptions_html)
if not html.has_user_errors():
- rows = get_availability_data(datasource, filterheaders, range, only_sites, limit, timeline, timeline or avoptions["show_timeline"])
+ rows = get_availability_data(datasource, filterheaders, range, only_sites, limit, timeline, timeline or avoptions["show_timeline"], avoptions)
what = "service" in datasource["infos"] and "service" or "host"
do_render_availability(rows, what, avoptions, timeline, "")
@@ -112,6 +112,19 @@ avoption_entries = [
)
),
+ # Labelling and Texts
+ ( "labelling",
+ "double",
+ ListChoice(
+ title = _("Labelling Options"),
+ choices = [
+ ( "omit_host", _("Do not display the host name")),
+ ( "use_display_name", _("Use alternative display name for services")),
+ ( "omit_buttons", _("Do not display icons for history and timeline")),
+ ]
+ )
+ ),
+
# How to deal with downtimes
( "downtimes",
"double",
@@ -359,8 +372,6 @@ def render_availability_options():
"host_down" : "host_down",
},
"outage_statistics" : ([],[]),
- "av_levels" : None,
- "av_mode" : False,
"short_intervals" : 0,
"dont_merge" : False,
"show_timeline" : False,
@@ -371,6 +382,9 @@ def render_availability_options():
# original version. This code can be dropped in a couple of years.
avoptions.setdefault("notification_period", "honor")
avoptions.setdefault("outage_statistics", ([], []))
+ avoptions.setdefault("av_levels", None)
+ avoptions.setdefault("av_mode", False)
+ avoptions.setdefault("labelling", [])
is_open = False
html.begin_form("avoptions")
@@ -493,7 +507,7 @@ def compute_range(rangespec):
from_broken[0] -= 1
return (time.mktime(from_broken), until_time), titles[1]
-def get_availability_data(datasource, filterheaders, range, only_sites, limit, single_object, include_output):
+def get_availability_data(datasource, filterheaders, range, only_sites, limit, single_object, include_output, avoptions):
has_service = "service" in datasource["infos"]
av_filter = "Filter: time >= %d\nFilter: time <= %d\n" % range
if single_object:
@@ -518,6 +532,8 @@ def get_availability_data(datasource, filterheaders, range, only_sites, limit, s
"in_host_downtime", "in_notification_period", "is_flapping", ]
if include_output:
columns.append("log_output")
+ if "use_display_name" in avoptions["labelling"]:
+ columns.append("current_service_display_name")
add_columns = datasource.get("add_columns", [])
rows = do_query_data(query, columns, add_columns, None, filterheaders, only_sites, limit = None)
@@ -589,6 +605,7 @@ def do_render_availability(rows, what, avoptions, timeline, timewarpcode):
timeline_rows = []
considered_duration = 0
for span in service_entry:
+ display_name = span.get("current_service_display_name", service)
state = span["state"]
if state == -1:
s = "unmonitored"
@@ -650,7 +667,7 @@ def do_render_availability(rows, what, avoptions, timeline, timewarpcode):
if not show_timeline:
timeline_rows = None
- availability.append([site_host[0], site_host[1], service, states, considered_duration, statistics, timeline_rows])
+ availability.append([site_host[0], site_host[1], service, display_name, states, considered_duration, statistics, timeline_rows])
# Prepare number format function
range, range_title = avoptions["range"]
@@ -914,6 +931,7 @@ def render_availability_table(availability, from_time, until_time, range_title,
state_groups = [ sg["warn"], sg["unknown"], sg["host_down"] ]
show_timeline = avoptions["show_timeline"]
+ labelling = avoptions["labelling"]
if avoptions["av_levels"]: # and avoptions["timeformat"].startswith("percentage"):
av_levels = avoptions["av_levels"]
else:
@@ -943,20 +961,21 @@ def render_availability_table(availability, from_time, until_time, range_title,
summary_counts = {}
table.begin("av_items", _("Availability") + " " + range_title, css="availability",
searchable = False, limit = None)
- for site, host, service, states, considered_duration, statistics, timeline_rows in availability:
+ for site, host, service, display_name, states, considered_duration, statistics, timeline_rows in availability:
table.row()
if what != "bi":
- table.cell("", css="buttons")
- history_url = history_url_of(site, host, service, from_time, until_time)
- html.icon_button(history_url, _("Event History"), "history")
-
timeline_url = html.makeuri([
("timeline", "yes"),
("timeline_site", site),
("timeline_host", host),
("timeline_service", service)])
- html.icon_button(timeline_url, _("Timeline"), "timeline")
+
+ if not "omit_buttons" in labelling:
+ table.cell("", css="buttons")
+ history_url = history_url_of(site, host, service, from_time, until_time)
+ html.icon_button(history_url, _("Event History"), "history")
+ html.icon_button(timeline_url, _("Timeline"), "timeline")
else:
timeline_url = html.makeuri([("timeline", "1")])
@@ -966,10 +985,15 @@ def render_availability_table(availability, from_time, until_time, range_title,
table.cell(_("Aggregate"), '<a href="%s">%s</a>' % (bi_url, service))
availability_columns = bi_availability_columns
else:
- table.cell(_("Host"), '<a href="%s">%s</a>' % (host_url, host))
+ if not "omit_host" in labelling:
+ table.cell(_("Host"), '<a href="%s">%s</a>' % (host_url, host))
if what == "service":
service_url = "view.py?" + html.urlencode_vars([("view_name", "service"), ("site", site), ("host", host), ("service", service)])
- table.cell(_("Service"), '<a href="%s">%s</a>' % (service_url, service))
+ if "use_display_name" in labelling:
+ service_name = display_name
+ else:
+ service_name = service
+ table.cell(_("Service"), '<a href="%s">%s</a>' % (service_url, service_name))
availability_columns = service_availability_columns
else:
availability_columns = host_availability_columns
@@ -1026,8 +1050,10 @@ def render_availability_table(availability, from_time, until_time, range_title,
if show_summary:
table.row(css="summary")
- table.cell("")
- table.cell("", _("Summary"))
+ if not "omit_buttons" in labelling:
+ table.cell("")
+ if not "omit_host" in labelling:
+ table.cell("", _("Summary"))
if what == "service":
table.cell("", "")
@@ -1074,8 +1100,6 @@ def render_availability_table(availability, from_time, until_time, range_title,
html.write('<div class="state state2">%s</div><div class=level>< %.3f%%</div>' % (_("CRIT"), crit))
html.write('</div>')
- # html.debug("HIRNKI")
-
def check_av_levels(number, av_levels, considered_duration):
perc = 100 * float(number) / float(considered_duration)
Module: check_mk
Branch: master
Commit: 2162c79cd61d00609c1fda297b519e8f519fa2e0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2162c79cd61d00…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 5 16:55:02 2013 +0100
New rule for configuring the display_name of a service
Thew new rule set <i>Alternative display name for Services</i> allows you
to specify an alternative name to be displayed for certain services. It sets
the configuration parameter <tt>display_name</tt>. This name is available as
a column when creating new views or modifying existing ones. It is always
visible in the details view of a service. In the availability reporting there
is an option for using that name instead of the normal service description. It
does not automatically replace the normal service name in all views.
<b>Note</b>: The purpose of this rule set is to define unique names for several
well-known services. It cannot rename services in general.
---
.werks/53 | 17 +++++++++++++++++
ChangeLog | 3 +++
web/plugins/views/builtin.py | 2 ++
web/plugins/views/filters.py | 2 ++
web/plugins/views/painters.py | 8 ++++++++
web/plugins/views/sorters.py | 1 +
web/plugins/wato/check_mk_configuration.py | 18 ++++++++++++++++++
7 files changed, 51 insertions(+)
diff --git a/.werks/53 b/.werks/53
new file mode 100644
index 0000000..0e32d55
--- /dev/null
+++ b/.werks/53
@@ -0,0 +1,17 @@
+Title: New rule for configuring the display_name of a service
+Level: 2
+Component: wato
+Version: 1.2.3i7
+Date: 1383666760
+Class: feature
+
+Thew new rule set <i>Alternative display name for Services</i> allows you
+to specify an alternative name to be displayed for certain services. It sets
+the configuration parameter <tt>display_name</tt>. This name is available as
+a column when creating new views or modifying existing ones. It is always
+visible in the details view of a service. In the availability reporting there
+is an option for using that name instead of the normal service description. It
+does not automatically replace the normal service name in all views.
+
+<b>Note</b>: The purpose of this rule set is to define unique names for several
+well-known services. It cannot rename services in general.
diff --git a/ChangeLog b/ChangeLog
index c559e8a..0920db1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -10,6 +10,9 @@
* 0044 FIX: LDAP: Fixed error with empty groups during non nested group sync...
* 0045 FIX: LDAP: Fixed error when synchronizing non nested groups to roles...
+ WATO:
+ * 0053: New rule for configuring the display_name of a service...
+
Reporting & Availability:
* 0051: Option for showing timeline directly in availability table...
* 0052: Visual colorization of availability according to levels...
diff --git a/web/plugins/views/builtin.py b/web/plugins/views/builtin.py
index b43da9e..f9e7f7c 100644
--- a/web/plugins/views/builtin.py
+++ b/web/plugins/views/builtin.py
@@ -1219,6 +1219,7 @@ multisite_builtin_views.update({
'service_active_checks_enabled',
'summary_host',
'serviceregex',
+ 'service_display_name',
'check_command',
'hoststate',
'svcstate',
@@ -1284,6 +1285,7 @@ multisite_builtin_views.update({
('svc_in_downtime', None),
('svc_in_notifper', None),
('svc_notifper', None),
+ ('service_display_name', None),
('check_manpage', None),
('svc_custom_notes', None),
('svc_pnpgraph', None),
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 735edbd..66a93b9 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -68,6 +68,8 @@ declare_filter(200, FilterText("serviceregex", _("Service"), "service",
declare_filter(201, FilterText("service", _("Service (exact match)"), "service", "service_description", "service", "="),
_("Exact match, used for linking"))
+declare_filter(202, FilterText("service_display_name", _("Service alternative display name"), "service", "service_display_name", "service_display_name", "~~"),
+ _("Alternative display name of the service, regex match"))
declare_filter(101, FilterText("hostgroupnameregex", _("Hostgroup)"), "hostgroup", "hostgroup_name", "hostgroup_name", "~~"),
_("Search field allowing regular expressions and partial matches on the names of hostgroups"))
diff --git a/web/plugins/views/painters.py b/web/plugins/views/painters.py
index 67c20e2..d4e8889 100644
--- a/web/plugins/views/painters.py
+++ b/web/plugins/views/painters.py
@@ -482,6 +482,14 @@ multisite_painters["service_description"] = {
"sorter" : 'svcdescr',
}
+multisite_painters["service_display_name"] = {
+ "title" : _("Service alternative dislay name"),
+ "short" : _("Display name"),
+ "columns" : ["service_display_name"],
+ "paint" : lambda row: (None, row["service_display_name"]),
+ "sorter" : 'svcdispname',
+}
+
multisite_painters["svc_state_age"] = {
"title" : _("The age of the current service state"),
"short" : _("Age"),
diff --git a/web/plugins/views/sorters.py b/web/plugins/views/sorters.py
index 51fde64..c5d2419 100644
--- a/web/plugins/views/sorters.py
+++ b/web/plugins/views/sorters.py
@@ -128,6 +128,7 @@ multisite_sorters["host"] = {
# name title column sortfunction
declare_simple_sorter("svcdescr", _("Service description"), "service_description", cmp_simple_string)
+declare_simple_sorter("svcdispname", _("Service alternative display name"), "service_display_name", cmp_simple_string)
declare_simple_sorter("svcoutput", _("Service plugin output"), "service_plugin_output", cmp_simple_string)
declare_simple_sorter("svc_long_plugin_output", _("Long output of check plugin"), "service_long_plugin_output", cmp_simple_string)
declare_simple_sorter("site", _("Site"), "site", cmp_simple_string)
diff --git a/web/plugins/wato/check_mk_configuration.py b/web/plugins/wato/check_mk_configuration.py
index 7738b4f..b17bf65 100644
--- a/web/plugins/wato/check_mk_configuration.py
+++ b/web/plugins/wato/check_mk_configuration.py
@@ -1724,6 +1724,24 @@ register_rule(group,
),
)
+register_rule(group,
+ "extra_service_conf:display_name",
+ TextUnicode(
+ title = _("Alternative display name for Services"),
+ help = _("This rule set allows you to specify an alternative name "
+ "to be displayed for certain services. This name is available as "
+ "a column when creating new views or modifying existing ones. "
+ "It is always visible in the details view of a service. In the "
+ "availability reporting there is an option for using that name "
+ "instead of the normal service description. It does <b>not</b> automatically "
+ "replace the normal service name in all views.<br><br><b>Note</b>: The "
+ "purpose of this rule set is to define unique names for several well-known "
+ "services. It cannot rename services in general."),
+ size = 64,
+ ),
+ itemtype = "service")
+
+
group = "monconf/" + _("Inventory and Check_MK settings")
register_rule(group,