Module: check_mk
Branch: master
Commit: 4b31e8e646c3572ab3816450ec12ddd811ef4b43
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4b31e8e646c357…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Nov 21 13:13:06 2014 +0100
Force option -f, --force force using outdated persisted files
---
modules/check_mk.py | 4 ++++
modules/check_mk_base.py | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/modules/check_mk.py b/modules/check_mk.py
index 8b1b58a..16af22b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -4874,6 +4874,10 @@ NOTES:
of the RRDs has changed. The option --split will activate conversion
from exising RRDs in PNP storage type SINGLE to MULTIPLE.
+ -i, --inventory does a HW/SW-Inventory for all, one or several
+ hosts. If you add the option -f, --force then persisted sections
+ will be used even if they are outdated.
+
""" % (check_mk_configfile,
precompiled_hostchecks_dir,
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index d89e2a1..f03b192 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -478,7 +478,7 @@ def add_persisted_info(hostname, info):
now = time.time()
for section, (persisted_until, persisted_section) in persisted.items():
- if now < persisted_until:
+ if now < persisted_until or opt_force:
if section not in info:
info[section] = persisted_section
if opt_debug:
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 ] ),