Module: check_mk
Branch: master
Commit: bd60f3425857b8412dd6b0b590b823261596be82
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bd60f3425857b8…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Nov 21 08:18:36 2014 +0100
Filters can now really be used for dashlets
---
web/htdocs/dashboard.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/web/htdocs/dashboard.py b/web/htdocs/dashboard.py
index 2537915..4967b13 100644
--- a/web/htdocs/dashboard.py
+++ b/web/htdocs/dashboard.py
@@ -479,12 +479,18 @@ dashboard_scheduler(1);
html.body_end() # omit regular footer with status icons, etc.
def render_dashlet_content(nr, the_dashlet):
+ html.stash_vars()
+ html.del_all_vars()
+ visuals.add_context_to_uri_vars(the_dashlet)
+
dashlet_type = dashlet_types[the_dashlet['type']]
if 'iframe_render' in dashlet_type:
dashlet_type['iframe_render'](nr, the_dashlet)
else:
dashlet_type['render'](nr, the_dashlet)
+ html.unstash_vars()
+
# Create the HTML code for one dashlet. Each dashlet has an id "dashlet_%d",
# where %d is its index (in board["dashlets"]). Javascript uses that id
# for the resizing. Within that div there is an inner div containing the
Module: check_mk
Branch: master
Commit: ab3e02ea981247bf11c940d4b44ac312e79b9d23
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab3e02ea981247…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Nov 20 16:54:40 2014 +0100
#1515 FIX cisco_secure: fix service description, fix OK state in case of no violation
---
.werks/1515 | 9 +++++++++
ChangeLog | 1 +
checks/cisco_secure | 36 ++++++++++++++++++++++--------------
3 files changed, 32 insertions(+), 14 deletions(-)
diff --git a/.werks/1515 b/.werks/1515
new file mode 100644
index 0000000..e9caca3
--- /dev/null
+++ b/.werks/1515
@@ -0,0 +1,9 @@
+Title: cisco_secure: fix service description, fix OK state in case of no violation
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1416498840
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 74f6c3f..86433f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
* 1511 FIX: oracle_jobs: avoid broken checks, make compatible with old version...
* 1513 FIX: Handle broken SNMP bulk walk implementation of Mikrotik Router firmware RouterOS v6.22...
* 1503 FIX: Fixed monitoring of multiple SAP instances with one mk_sap plugin...
+ * 1515 FIX: cisco_secure: fix service description, fix OK state in case of no violation
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/cisco_secure b/checks/cisco_secure
index e333f7e..898082d 100644
--- a/checks/cisco_secure
+++ b/checks/cisco_secure
@@ -24,48 +24,56 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-def cisco_secure_convert(info):
- data = []
+
+def parse_cisco_secure(info):
+ parsed = []
# l[1] = Name, l[2] = Portstate
names = dict([ (l[0], ( l[1], l[2] )) for l in info[0]] )
for num, enabled, status, violationCount, lastmac in info[1]:
mac = ":".join(["%02s" % hex(ord(m))[2:] for m in lastmac]).replace(' ', '0')
- data.append(( names[num][0], int(names[num][1]), int(enabled), int(status), int(violationCount), mac ))
- return data
+ parsed.append(( names[num][0], int(names[num][1]), int(enabled), int(status), int(violationCount), mac ))
+ return parsed
+
-def inventory_cisco_secure(info):
- info = cisco_secure_convert(info)
+def inventory_cisco_secure(parsed):
# search for at least one port with security
- for name, op_state, enabled, status, violationCount, lastmac in info:
- #if portsecurity enabled and port up OR currently there is sercurity issue`
+ for name, op_state, enabled, status, violationCount, lastmac in parsed:
+ # if portsecurity enabled and port up OR currently there is sercurity issue`
if ( enabled == 1 and op_state == 1) or status == 3:
return [ (None, None) ]
- return []
-def check_cisco_secure(item, params, info):
+
+def check_cisco_secure(item, params, parsed):
secure_states = {
1 : "full Operational",
2 : "could not be enabled due to certain reasons",
3 : "shutdown due to security violation"
- }
+ }
- info = cisco_secure_convert(info)
failed = []
- for name, op_state, enabled, status, violationCount, lastmac in info:
+ at_least_one_problem = False
+ for name, op_state, enabled, status, violationCount, lastmac in parsed:
message = "Port %s: %s (Violation Count: %s, Last Mac: %s)" % \
( name, secure_states[status], violationCount, lastmac )
# If port cant be enabled and is up
if status == 2 and op_state == 1:
yield 1, message
+ at_least_one_problem = True
# Security issue
elif status == 3:
yield 2, message
+ at_least_one_problem = True
+
+ if not at_least_one_problem:
+ yield 0, "No port security violation"
+
check_info["cisco_secure"] = {
+ "parse_function" : parse_cisco_secure,
"check_function" : check_cisco_secure,
"inventory_function" : inventory_cisco_secure,
- "service_description" : "Security Port %s",
+ "service_description" : "Port Security",
"snmp_scan_function" : lambda oid: "cisco" in oid(".1.3.6.1.2.1.1.1.0").lower() and \
oid(".1.3.6.1.4.1.9.9.315.1.2.1.1.1.*"),
"snmp_info" : [ (".1.3.6.1.2.1.2.2.1", [OID_END, 2, 8 ] ),
Module: check_mk
Branch: master
Commit: 7940885e7d67e6cd446977422df35bb0af7cc8a7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7940885e7d67e6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 20 16:32:51 2014 +0100
#1530 Dashboard: Host/service statistics dashlets now deal with the context
The host and service context dashlets now treat the provided context correctly.
Past versions did not care about the configured context at all.
---
.werks/1530 | 10 +++++
ChangeLog | 1 +
web/htdocs/dashboard.py | 31 ++++++++++++++-
web/htdocs/visuals.py | 2 +-
web/plugins/dashboard/dashlets.py | 75 +++++++++++++++----------------------
5 files changed, 72 insertions(+), 47 deletions(-)
Diff: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=7940885e7d…
Module: check_mk
Branch: master
Commit: 42327ea175d442eac8d0f529c94f0ee09faf09e2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=42327ea175d442…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Nov 20 15:40:57 2014 +0100
Updated bug entries #2228, #2229
---
.bugs/2228 | 9 +++++++++
.bugs/2229 | 10 ++++++++++
2 files changed, 19 insertions(+)
diff --git a/.bugs/2228 b/.bugs/2228
new file mode 100644
index 0000000..482810b
--- /dev/null
+++ b/.bugs/2228
@@ -0,0 +1,9 @@
+Title: WATO context button in a service view show not go to host properties
+Component: multisite
+State: open
+Date: 2014-11-20 15:39:15
+Targetversion: 1.2.5i1
+Class: nastiness
+
+If we really want this button then better point it to the list of service
+of the host.
diff --git a/.bugs/2229 b/.bugs/2229
new file mode 100644
index 0000000..91f8990
--- /dev/null
+++ b/.bugs/2229
@@ -0,0 +1,10 @@
+Title: WATO button for service parameters
+Component: multisite
+State: open
+Date: 2014-11-20 15:40:05
+Targetversion: 1.2.5i1
+Class: todo
+
+When you are at the details of a service there should be a context button for
+going to the parameters of that service. And also a button for going to the
+monitoring parameters (all rulesets) for that service.
Module: check_mk
Branch: master
Commit: a036c511b5d54c76cf1bbfeb1f3941f000e41ca6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a036c511b5d54c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Nov 20 15:09:17 2014 +0100
#1514 FIX Try harder to detect previous hard state in notification when using Nagios as core
In the case where you have more than one check attempt then now the previous
hard state is assumed to be the previous soft state when the new state is
OK or UP. This avoids some cases where the previous state had been set to
<tt>?</tt> in previous versions. The CMC does not have these problems anyway.
---
.werks/1514 | 12 ++++++++++++
ChangeLog | 1 +
modules/notify.py | 10 +++++++---
3 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/.werks/1514 b/.werks/1514
new file mode 100644
index 0000000..2cb0041
--- /dev/null
+++ b/.werks/1514
@@ -0,0 +1,12 @@
+Title: Try harder to detect previous hard state in notification when using Nagios as core
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.5i7
+Date: 1416492466
+Class: fix
+
+In the case where you have more than one check attempt then now the previous
+hard state is assumed to be the previous soft state when the new state is
+OK or UP. This avoids some cases where the previous state had been set to
+<tt>?</tt> in previous versions. The CMC does not have these problems anyway.
diff --git a/ChangeLog b/ChangeLog
index 1552b86..40ccb50 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -78,6 +78,7 @@
Notifications:
* 1512 Bulk notification can now be grouped according to custom macro values...
* 1168 FIX: HTML mails can now be configured to display graphs among each other...
+ * 1514 FIX: Try harder to detect previous hard state in notification when using Nagios as core...
BI:
* 1435 FIX: Saving BI aggregations: No longer reports 'Request-URI Too Large'...
diff --git a/modules/notify.py b/modules/notify.py
index 89ac7a8..87e94c9 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -1733,8 +1733,11 @@ def complete_raw_context(raw_context):
# Here We do not know. The transition might be OK -> WARN -> CRIT and
# the initial OK is completely lost. We use the artificial state "?"
# here, which matches all states and makes sure that when in doubt a
- # notification is being sent out.
- prev_state = "?"
+ # notification is being sent out. But when the new state is UP, then
+ # we know that the previous state was a hard state (otherwise there
+ # would not have been any notification)
+ if raw_context["HOSTSTATE"] != "UP":
+ prev_state = "?"
notify_log("Previous host hard state not known. Allowing all states.")
raw_context["PREVIOUSHOSTHARDSTATE"] = prev_state
@@ -1745,7 +1748,8 @@ def complete_raw_context(raw_context):
prev_state = "OK"
elif "SERVICEATTEMPT" not in raw_context or \
("SERVICEATTEMPT" in raw_context and raw_context["SERVICEATTEMPT"] != "1"):
- prev_state = "?"
+ if raw_context["SERVICESTATE"] != "OK":
+ prev_state = "?"
notify_log("Previous service hard state not known. Allowing all states.")
raw_context["PREVIOUSSERVICEHARDSTATE"] = prev_state
Module: check_mk
Branch: master
Commit: 7e3be87b46be3136aea5b46a136f004b1a89154d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7e3be87b46be31…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Nov 20 14:03:31 2014 +0100
Removed two uneeded table headers from WATO host table
---
web/htdocs/table.py | 2 ++
web/htdocs/wato.py | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/table.py b/web/htdocs/table.py
index c0fbdb4..c8ca35a 100644
--- a/web/htdocs/table.py
+++ b/web/htdocs/table.py
@@ -99,6 +99,8 @@ def add_row(css=None, state=0, collect_headers=True, fixed=False):
table["collect_headers"] = True
elif table["collect_headers"] == True:
table["collect_headers"] = "finished"
+ elif not collect_headers and table["collect_headers"]:
+ table["collect_headers"] = False
# Intermediate title, shown as soon as there is a following row.
# We store the group headers in the list of rows, with css None
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index c411961..fa121bf 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1388,7 +1388,7 @@ def show_hosts(folder):
for attr, topic in host_attributes:
if attr.show_in_table():
colspan += 1
- if config.may("wato.edit_hosts") and config.may("wato.move_hosts"):
+ if not g_folder.get(".lock_hosts") and config.may("wato.edit_hosts") and config.may("wato.move_hosts"):
colspan += 1
if show_checkboxes:
colspan += 1