Module: check_mk
Branch: master
Commit: 170e0806ef588a75ec7113b2969cad08d96603d5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=170e0806ef588a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Sep 12 17:28:44 2013 +0200
Updated bug entries #0951
---
.bugs/951 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.bugs/951 b/.bugs/951
new file mode 100644
index 0000000..38ba855
--- /dev/null
+++ b/.bugs/951
@@ -0,0 +1,12 @@
+Title: Folder-Tree Snapin shows foreign folders, but filter does not work
+Component: multisite
+State: open
+Date: 2013-09-12 17:27:28
+Targetversion: 1.2.3i2
+Class: bug
+
+If you create a disributed monitoring then the folder tree snapin
+can show folders from remote sites (without alias), which is OK.
+But when you click on a folder then the filter does not work
+because (i think) it does not know the folder and hence ignored
+it.
Module: check_mk
Branch: master
Commit: 6948623fca0ae3dcc0a59c6d4ca320a4cbeb335f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6948623fca0ae3…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Sep 12 16:50:32 2013 +0200
Added help text for levels in process inventory rule
---
web/plugins/wato/check_parameters.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 748d822..b367fd2 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -360,6 +360,8 @@ register_rule(group + '/' + subgroup_inventory,
)),
('levels', Tuple(
title = _('Levels'),
+ help = _("Please note that if you specify and also if you modify levels here, the change is activated "
+ "only during an inventory. Saving this rule is not enough. This is due to the nature of inventory rules."),
elements = [
Integer(
title = _("Critical below"),
Module: check_mk
Branch: master
Commit: 01cf6cec40b6e7cae217cd22096145b7e4c602b4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=01cf6cec40b6e7…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Thu Sep 12 15:11:02 2013 +0200
service description for inventory processes must not be empty since
serveral rules are configurable which need to have different service
descriptions.
---
web/plugins/wato/check_parameters.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 58fe698..1596630 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -292,6 +292,7 @@ register_rule(group + '/' + subgroup_inventory,
elements = [
('descr', TextAscii(
title = _('Service Description'),
+ allow_empty = False,
help = _('<p>The service description may contain one or more occurances of <tt>%s</tt>. If you do this, then the pattern must be a regular '
'expression and be prefixed with ~. For each <tt>%s</tt> in the description, the expression has to contain one "group". A group '
'is a subexpression enclosed in brackets, for example <tt>(.*)</tt> or <tt>([a-zA-Z]+)</tt> or <tt>(...)</tt>. When the inventory finds a process '
Module: check_mk
Branch: master
Commit: 2f3575bbde4cb97740d5a499d7fe6b7a737d151e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2f3575bbde4cb9…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 12 14:35:19 2013 +0200
check_form_submit: Finished implementing checking multiple hosts ; added number of succeeded check levels
---
checks/check_form_submit | 17 ++++++-----
doc/treasures/active_checks/check_form_submit | 8 +++--
web/htdocs/userdb.py | 2 +-
web/plugins/wato/active_checks.py | 40 ++++++++++++-------------
4 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/checks/check_form_submit b/checks/check_form_submit
index 6a76dfa..ee69015 100644
--- a/checks/check_form_submit
+++ b/checks/check_form_submit
@@ -29,12 +29,7 @@ def check_form_submit_arguments(params):
args = ''
if "virthost" in settings:
- vhost, omit_ip = settings["virthost"]
- args += ' -H %s' % quote_shell_string(vhost)
- if omit_ip:
- args += ' -I %s' % quote_shell_string(vhost)
- else:
- omit_ip = False
+ args += ' -H %s' % quote_shell_string(settings["virthost"])
if "port" in settings:
args += ' -p %d' % settings["port"]
@@ -57,8 +52,14 @@ def check_form_submit_arguments(params):
if "query" in settings:
args += ' -q %s' % quote_shell_string(settings["query"])
- if not omit_ip:
- args = " -I $HOSTADDRESS$" + args
+ if "num_succeeded" in settings:
+ args += ' -n %s' % ','.join(map(str, settings["num_succeeded"]))
+
+ if not settings.get('hosts'):
+ args += " -I $HOSTADDRESS$"
+ else:
+ for address in settings['hosts']:
+ args += " -I %s" % quote_shell_string(address)
return args
diff --git a/doc/treasures/active_checks/check_form_submit b/doc/treasures/active_checks/check_form_submit
index dcd3858..cb69f80 100755
--- a/doc/treasures/active_checks/check_form_submit
+++ b/doc/treasures/active_checks/check_form_submit
@@ -48,7 +48,7 @@
#
# ./check_form_submit -I localhost -u /event -q '_origtarget=wato.py&_username=omdadmin&_password=omd' -e 'WATO'
-import sys, getopt, urllib2, urllib, re
+import sys, getopt, urllib2, urllib, re, socket
def usage():
sys.stderr.write("""
@@ -200,6 +200,8 @@ def open_url(url, method = 'GET', data = None):
new_state(2, 'Unable to open %s: [%d] %s' % (url, e.code, e.reason))
except urllib2.URLError, e:
new_state(2, 'Unable to open %s: %s' % (url, e.reason))
+ except socket.timeout, e:
+ new_state(2, 'Unable to open %s: %s' % (url, e))
real_url = fd.geturl()
code = fd.getcode()
content = fd.read()
@@ -324,10 +326,10 @@ try:
# use the worst state as summary state
sum_state = max_state
- elif num_crit is not None and len(failed) >= num_crit:
+ elif num_crit is not None and len(success) <= num_crit:
sum_state = 2
- elif num_warn is not None and len(failed) >= num_warn:
+ elif num_warn is not None and len(success) <= num_warn:
sum_state = 1
txt = '%d succeeded, %d failed' % (len(success), len(failed))
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 2e9b55e..13281b9 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -302,7 +302,7 @@ def load_users(lock = False):
id = d
# read special values from own files
- for val, conv_func in [ ('num_failed', int), ('last_seen', float) ]:
+ for val, conv_func in [ ('num_failed', saveint), ('last_seen', savefloat) ]:
if id in result:
try:
result[id][val] = conv_func(file(dir + d + '/' + val + '.mk').read().strip())
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index f8dfe06..449693a 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -928,27 +928,20 @@ register_rule(group,
Dictionary(
title = _("Check the URL"),
elements = [
- ("virthost", Tuple(
+ ("hosts", ListOfStrings(
+ title = _('Check specific host(s)'),
+ help = _('By default, if you do not specify any host addresses here, '
+ 'the host address of the host this service is assigned to will '
+ 'be used. But by specifying one or several host addresses here, '
+ 'it is possible to let the check monitor one or multiple hosts.')
+ )),
+ ("virthost", TextAscii(
title = _("Virtual host"),
- elements = [
- TextAscii(
- title = _("Name of the virtual host"),
- help = _("Set this in order to specify the name of the "
- "virtual host for the query (using HTTP/1.1). When you "
- "leave this empty, then the IP address of the host "
- "will be used instead."),
- allow_empty = False
- ),
- Checkbox(
- label = _("Omit specifying an IP address"),
- help = _("Usually Check_MK will nail this check to the "
- "IP address of the host it is attached to. With this "
- "option you can have the check use the name of the "
- "virtual host instead and do a dynamic DNS lookup."),
- true_label = _("omit IP address"),
- false_label = _("specify IP address"),
- ),
- ]
+ help = _("Set this in order to specify the name of the "
+ "virtual host for the query (using HTTP/1.1). When you "
+ "leave this empty, then the IP address of the host "
+ "will be used instead."),
+ allow_empty = False,
)),
("uri", TextAscii(
title = _("URI to fetch (default is <tt>/</tt>)"),
@@ -990,6 +983,13 @@ register_rule(group,
"is URL-encoded (for example \"key1=val1&key2=val2\")."),
size = 40,
)),
+ ("num_succeeded", Tuple(
+ title = _("Multiple Hosts: Number of successful results"),
+ elements = [
+ Integer(title = _("Warning if equal or below")),
+ Integer(title = _("Critical if equal or below")),
+ ]
+ )),
]
),
]
Module: check_mk
Branch: master
Commit: 97ee4e048d1ddf66593d901b59a85368305a5dfb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=97ee4e048d1ddf…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Sep 12 13:30:29 2013 +0200
cisco_wlc:
new rule group cisco_wlc: allows to configure handling of missing AP
---
ChangeLog | 2 ++
checkman/cisco_wlc | 18 +++++++++++++++++
checks/cisco_wlc | 24 +++++++++++++++--------
web/plugins/wato/check_parameters.py | 36 ++++++++++++++++++++++++++++++++++
4 files changed, 72 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f8dac3e..daa3f94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,7 @@
* ADD: etherbox: new check for etherbox (messpc) sensors.
currently supported: temperature, humidity, switch contact and smoke sensors
* cisco_wlc_client: now supports low/high warn and crit levels
+ * cisco_wlc: now supports configuration options for missing AP
Notifications:
@@ -185,6 +186,7 @@
* ADD: Rule to check state of physical switch (currently used by etherbox check)
* FIX: Cisco ruleset "Cisco WLC WiFi client connections" has been generalized to
"WLC WiFi client connections"
+ * ADD: new ruleset cisco_wlc: Allows to configure handling of missing AP
Notifications:
* Flexible Notification can now filter service levels
diff --git a/checkman/cisco_wlc b/checkman/cisco_wlc
index 9fdb0c6..300270f 100644
--- a/checkman/cisco_wlc
+++ b/checkman/cisco_wlc
@@ -11,3 +11,21 @@ description:
inventory:
One check for each online accesspoint is created
+
+examples:
+ checkgroup_parameters.setdefault('cisco_wlc', [])
+
+ checkgroup_parameters['cisco_wlc'] = [
+ ( {'ap_name': [('HOMEOFFICE', 0), ('FALLBACK', 2)], 'ap_model': [('K7-B30329', 3)]}, [], ALL_HOSTS, ALL_SERVICES ),
+ ] + checkgroup_parameters['cisco_wlc']
+
+
+[parameters]
+parameters(dict): with the keys "ap_model" and "ap_name"
+
+ The values of in this dict are list of tuples. Each tuple contain
+ eiter (ap_name(string), action(int)) or (ap_model(string), action(int)),
+ whereas the ap_name is the human readable name of the AP and the ap_model is the model number
+ The action represent the outcome when this model is missing and can be
+ set from 0 to 3 (OK, WARN, CRIT, UNKNOWN)
+
diff --git a/checks/cisco_wlc b/checks/cisco_wlc
index c0bdbde..77208a3 100644
--- a/checks/cisco_wlc
+++ b/checks/cisco_wlc
@@ -24,27 +24,22 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# Example output from agent:
-# Put here the example output from your TCP-Based agent. If the
-# check is SNMP-Based, then remove this section
-
-
# States:
# 1: OK, 2: Crit, 3: Warn
def cisco_wlc_convert(info):
data = []
for i in range(0, len(info[0])):
- data.append((info[0][i][1], info[1][i][1], info[2][i][1] ))
+ data.append((info[0][i][1], info[1][i][1], info[2][i][1], info[3][i][1] ))
return data
def inventory_cisco_wlc(info):
data = cisco_wlc_convert(info)
return [ (x[0], None) for x in data ]
-def check_cisco_wlc(item, _no_params, info):
+def check_cisco_wlc(item, params, info):
data = cisco_wlc_convert(info)
- for name, mac, state in data:
+ for name, mac, state, model in data:
if name == item:
state = saveint(state)
if state == 1:
@@ -53,17 +48,30 @@ def check_cisco_wlc(item, _no_params, info):
return 1, "Accesspoint state Warning"
if state == 2:
return 2, "State Critical"
+
+ # 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]
+
return 2, "Accesspoint not found"
check_info["cisco_wlc"] = {
"check_function" : check_cisco_wlc,
"inventory_function" : inventory_cisco_wlc,
+ "group" : "cisco_wlc",
"service_description" : "AP %s",
"has_perfdata" : False,
"snmp_scan_function" : lambda oid: oid('.1.3.6.1.2.1.1.2.0') in [".1.3.6.1.4.1.9.1.1069"],
"snmp_info" : [( ".1.3.6.1.4.1.14179.2.2.1.1.3", [ OID_END, '' ]),
( ".1.3.6.1.4.1.14179.2.2.1.1.1", [ OID_END, '' ]),
( ".1.3.6.1.4.1.14179.2.2.1.1.6", [ OID_END, '' ]),
+ ( ".1.3.6.1.4.1.14179.2.2.1.1.16", [ OID_END, '' ]),
],
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 58fe698..7e05a33 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1120,6 +1120,42 @@ register_check_parameters(
)
register_check_parameters(
+ subgroup_networking,
+ "cisco_wlc",
+ _("Cisco WLAN AP"),
+ Dictionary(
+ help = _("Here you can set which alert type is set when the given "
+ "access point is missing (might be powered off). The access point "
+ "can be specified by the AP name or the AP model"),
+ elements = [
+ ( "ap_name",
+ ListOf(
+ Tuple(
+ elements = [
+ TextAscii(title = _("AP name")),
+ MonitoringState( title=_("State when missing"), default_value = 2)
+ ]
+ ),
+ title = _("Access point name"),
+ add_label = _("Add name"))
+ ),
+ ( "ap_model",
+ ListOf(
+ Tuple(
+ elements = [
+ TextAscii(title = _("AP model")),
+ MonitoringState( title=_("State when missing"), default_value = 2)
+ ]
+ ),
+ title = _("Access point device id"),
+ add_label = _("Add id"))
+ )
+ ]
+ ),
+ TextAscii(title = _("Access Point")),
+ "first",
+)
+register_check_parameters(
subgroup_networking,
"tcp_conn_stats",
("TCP connection stats (LINUX / UNIX)"),