Module: check_mk
Branch: master
Commit: 3714d6bf14ab8dc8af45b29672d4e28936bcbe12
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3714d6bf14ab8d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 13 11:40:09 2013 +0200
Implemented bulk walk mode for inline snmp
---
modules/snmp.py | 60 +++++++++++++++++++++++++++++++++++++++++++++++++------
1 file changed, 54 insertions(+), 6 deletions(-)
diff --git a/modules/snmp.py b/modules/snmp.py
index 064d6a8..e42871a 100644
--- a/modules/snmp.py
+++ b/modules/snmp.py
@@ -135,11 +135,57 @@ def init_snmp_host(hostname):
g_snmp_sessions[hostname] = s
return s
+# The net-snmp python bindings used by the new inline snmp method
+# does not provide a bulkwalk functionality. Though we need to
+# implement this on our own.
+def inline_bulkwalk(s, oid):
+ # Start from index 0, and use getbulk operations
+ startindex = 0
+ thistree = oid
+ results = []
+ while thistree == oid:
+ if startindex == 0:
+ var_list = netsnmp.VarList(netsnmp.Varbind(oid))
+ else:
+ var_list = netsnmp.VarList(netsnmp.Varbind(oid, startindex))
+ result = s.getbulk(0, 10, var_list)
+ for i in var_list:
+ if i.tag == thistree:
+ results.append(i)
+
+ # Proceed with another bulkget request or finished?
+
+ # If startindex is null
+ if not var_list[-1].iid:
+ break
+ else:
+ # Refresh thistree name and increment startindex
+ thistree = var_list[-1].tag
+ startindex = int(var_list[-1].iid)
+
+ # If startindex still 0
+ if startindex == 0:
+ break
+
+ return results
+
+def inline_walk(s, oid):
+ var_list = netsnmp.VarList(netsnmp.Varbind(oid))
+ res = s.walk(var_list)
+ results = []
+ for var in var_list:
+ if var.iid is not None:
+ results.append(var)
+ return results
+
def inline_snmpwalk_on_suboid(hostname, oid, strip_values = True):
s = init_snmp_host(hostname)
- # FIXME: handle bulkwalk/getnext walk. At the moment it seems only
- # a getnext walk is done in all cases.
+ bulkwalk = is_bulkwalk_host(hostname)
+ if bulkwalk:
+ what = 'BULKWALK'
+ else:
+ what = 'WALK'
# Remove trailing .0 for walks
# .1.3.6.1.2.1.1.5.0 but receive the value for 1.3.6.1.2.1.1.6.0.
@@ -147,10 +193,12 @@ def inline_snmpwalk_on_suboid(hostname, oid, strip_values = True):
oid = oid[:-2]
if opt_debug:
- sys.stdout.write("Executing SNMPWALK of \"%s\" on %s\n" % (oid, hostname))
+ sys.stdout.write("Executing %s of \"%s\" on %s\n" % (what, oid, hostname))
- var_list = netsnmp.VarList(netsnmp.Varbind(oid))
- res = s.walk(var_list)
+ if bulkwalk:
+ res = inline_bulkwalk(s, oid)
+ else:
+ res = inline_walk(s, oid)
if s.ErrorNum != 0:
if opt_verbose:
# s.ErrorStr, s.ErrorNum, s.ErrorInd
@@ -158,7 +206,7 @@ def inline_snmpwalk_on_suboid(hostname, oid, strip_values = True):
raise MKSNMPError('SNMP Error on %s while walking %s.' % (hostname, oid))
results = []
- for var in var_list:
+ for var in res:
if var.iid is None:
continue
Module: check_mk
Branch: master
Commit: da98a7ddaeb63fec850a9c5fe65da258ef6d83a1
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=da98a7ddaeb63f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 13 14:53:39 2013 +0200
Updated changelog
---
ChangeLog | 2 ++
1 file changed, 2 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index daa3f94..fb90209 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
to Karl Golland)
* New man page browser for console (cmk -m)
* New option explicit_snmp_communities to override rule based SNMP settings
+ * Preparations for significant SNMP monitoring performance improvement
+ (It's named Inline SNMP, which is available as special feature via subscriptions)
* livestatus: new service column staleness: indicator for outdated service checks
* livestatus: new host column staleness: indicator for outdated host checks
Module: check_mk
Branch: master
Commit: 7ec08ada1a3ef44a4ea6e7c8565968a719e4fb34
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7ec08ada1a3ef4…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Sep 13 11:49:51 2013 +0200
Updated bug entries #1051
---
.bugs/1051 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.bugs/1051 b/.bugs/1051
new file mode 100644
index 0000000..810b01a
--- /dev/null
+++ b/.bugs/1051
@@ -0,0 +1,12 @@
+Title: cache problem after adding service levels
+Component: multisite
+State: open
+Date: 2013-09-13 11:45:17
+Targetversion: 1.2.3i2
+Class: nastiness
+
+after adding service levels, they are not displayed in configuration dialog of
+custom notification for a user
+restart of apache is required before using the service levels
+should work without restart
+cache invalidation required