Module: check_mk
Branch: master
Commit: 59fdcffeb7398adab5858a496f4ebae093f447c8
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=59fdcffeb7398a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jan 21 17:51:19 2014 +0100
FIX Fixed incorrect formatting of checks with long output
Long output in check_mk checks was not formatted accordingly.
Newlines within a checks output are now escaped correctly: \n -> \\n
The incorrect formatting in previous versions could lead to missing long output texts in the monitoring core.
---
.werks/260 | 12 ++++++++++++
ChangeLog | 2 +-
modules/check_mk_base.py | 3 +++
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/260 b/.werks/260
new file mode 100644
index 0000000..6e34f34
--- /dev/null
+++ b/.werks/260
@@ -0,0 +1,12 @@
+Title: Fixed incorrect formatting of checks with long output
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390322620
+
+Long output in check_mk checks was not formatted accordingly.
+Newlines within a checks output are now escaped correctly: \n -> \\n
+
+The incorrect formatting in previous versions could lead to missing long output texts in the monitoring core.
diff --git a/ChangeLog b/ChangeLog
index ff848c2..e0257f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -123,6 +123,7 @@
* 0432 FIX: stulz_humidity: Fixed syntax error...
* 0120 FIX: stulz_humidity, apc_humidity: Fixed bug while processing check params...
* 0460 FIX: endless waiting for printer queues fixed...
+ * 0260 FIX: Fixed incorrect formatting of checks with long output...
Multisite:
* 0371 Added log class filter to hostsvcevents view
@@ -171,7 +172,6 @@
* 0428 Changed user profiles (e.g. pw changes) are now replicated in distributed setups...
* 0114 User Custom Attributes can now be exported to the core...
* 0448 New button in WATO service list for displaying check parameters...
- * 0353 New button in service list for refreshing all services...
* 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
* 0241 FIX: Improved sorting of WATO folders in dropdown menu...
* 0019 FIX: Fixed wording in WATO rule for MSSQL check
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index ea3ea0f..72f7160 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1287,6 +1287,7 @@ def submit_to_core(host, service, state, output):
# Replace \n to enable multiline ouput
output = output.replace('\n', '\\n')
if monitoring_core == "cmc":
+ output = output.replace("\n", "\x01", 1).replace("\n","\\n")
result = "\t%d\t%s\t%s\n" % (state, service, output.replace("\0", "")) # remove binary 0, CMC does not like it
if opt_keepalive:
global total_check_output
@@ -1297,6 +1298,7 @@ def submit_to_core(host, service, state, output):
# Send to Nagios/Icinga command pipe
elif check_submission == "pipe":
+# output = output.replace("\n", "\\n")
open_command_pipe()
if nagios_command_pipe:
nagios_command_pipe.write("[%d] PROCESS_SERVICE_CHECK_RESULT;%s;%s;%d;%s\n" %
@@ -1307,6 +1309,7 @@ def submit_to_core(host, service, state, output):
# Create check result files for Nagios/Icinga
elif check_submission == "file":
+# output = output.replace("\n", "\\n")
open_checkresult_file()
if checkresult_file_fd:
now = time.time()
Module: check_mk
Branch: master
Commit: 094b264a622d85667c0c323381ffb85e63e875a7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=094b264a622d85…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Jan 21 17:47:29 2014 +0100
fileinfo.groups: file groups now allow exclude patterns as well
---
.werks/570 | 8 ++++++++
ChangeLog | 3 ++-
checkman/fileinfo.groups | 27 +++++++++++++++++--------
checks/fileinfo | 13 +++++++-----
web/plugins/wato/check_parameters.py | 37 +++++++++++++++++++++-------------
5 files changed, 60 insertions(+), 28 deletions(-)
diff --git a/.werks/570 b/.werks/570
new file mode 100644
index 0000000..786f94d
--- /dev/null
+++ b/.werks/570
@@ -0,0 +1,8 @@
+Title: fileinfo.groups: file groups now allow exclude patterns as well
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1390322713
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 367c754..dfbe039 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -55,6 +55,7 @@
* 0461 emcvnx_raidgroups.list_luns: New check for EMC VNX storage system...
* 0462 emcvnx_raidgroups.list_disks: New check for EMC VNX storage system...
* 0463 emcvnx_raidgroups.capacity, emcvnx_raidgroups.capacity_contiguous: New Checks for EMC VNX Storage systems...
+ * 0570 fileinfo.groups: file groups now allow exclude patterns as well
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
@@ -154,8 +155,8 @@
* 0425 FIX: Fix login loop bug in distributed environments with different auth secrets
* 0117 FIX: Availability button is now visible for users without the right to edit views
* 0431 FIX: LDAP: Fixed group syncrhonisation when nested group sync is enabled
- * 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
* 0122 FIX: Multisite view editor not longer throwing a exception when loading views from other users
+ * 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/checkman/fileinfo.groups b/checkman/fileinfo.groups
index 1c4eea8..04d3b03 100644
--- a/checkman/fileinfo.groups
+++ b/checkman/fileinfo.groups
@@ -5,28 +5,39 @@ license: GPL
distribution: check_mk
description:
This check monitors the size, age and the count of a group of files
- in the target host's filesystem.
- You can set lower and upper
+ in the target host's filesystem. You can set lower and upper
limits for each: size of files, age of oldest, the newest file
and for the total count of files.
- This check needs some configuration in the agent,
- as the agent needs to know the information about
- which files need to be sent.
+ This check needs some configuration in the agent, as the agent needs to
+ know the information about which files need to be sent. Please refer to
+ fileinfos manpage for information about setting up the agent.
- Please refer to fileinfos manpage for information
- about setting up the agent
+ The check also needs a configured file grouping pattern. File grouping
+ patterns combine a simple pattern based on {*} and {?} to join a subset
+ of the file names send by the agent into a file group. In addition an
+ {exclude} pattern may be define to exclude certain filenames.
+ The name of the file group is referenced in the check configuration
+ as the item.
item:
- Configured name of the filesize group
+ Configured name of the file group
examples:
+# old syntax of file group patterns, still valid
fileinfo_groups = [
([("Auth_group",r"/var/log/auth*")], ALL_HOSTS),
([("Message_group", r"/var/log/messages*")], ['test2'], ALL_HOSTS),
]
+# new syntax of file group patterns, including exclude pattern
+ fileinfo_groups = [
+ ([("Auth_group", ("/var/log/auth*","/var/log/*.debug"))], ALL_HOSTS),
+ ([("Message_group", ("/var/log/messages*",""))], ['test2'], ALL_HOSTS),
+ ]
+
+# syntax of check
check_parameters = [
({
"minsize": (200.0, 300.0),
diff --git a/checks/fileinfo b/checks/fileinfo
index df28a08..7907fdf 100644
--- a/checks/fileinfo
+++ b/checks/fileinfo
@@ -65,7 +65,10 @@ def fileinfo_groups_of_file(check_filename):
groups = []
for line in host_extra_conf(g_hostname, fileinfo_groups):
for group_name, pattern in line:
- if fnmatch.fnmatch(check_filename, pattern):
+ if type(pattern) == str:
+ pattern = ( pattern, '' )
+ if fnmatch.fnmatch(check_filename, pattern[0]) \
+ and not fnmatch.fnmatch(check_filename, pattern[1]):
groups.append(group_name)
return groups
@@ -94,14 +97,13 @@ def check_fileinfo(item, params, info):
# Constructs simple list of patterns and makes them available for the check
def fileinfo_groups_precompile(hostname, item, params):
patterns = []
-
for line in host_extra_conf(hostname, fileinfo_groups):
for group_name, pattern in line:
if group_name == item:
+ if type(pattern) == str:
+ pattern = ( pattern, '' )
patterns.append(pattern)
-
params['precompiled_patterns'] = patterns
-
return params
def check_fileinfo_groups(item, params, info):
@@ -126,7 +128,8 @@ def check_fileinfo_groups(item, params, info):
# Start counting all values
for line in info[1:]:
for pattern in params['precompiled_patterns']:
- if fnmatch.fnmatch(line[0], pattern) and str(line[1]) != 'missing':
+ if fnmatch.fnmatch(line[0], pattern[0]) and str(line[1]) != 'missing' \
+ and not fnmatch.fnmatch(line[0], pattern[1]):
size = int(line[1])
size_all += size
if size_smallest == None:
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index a54a578..5ee83ba 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -899,6 +899,7 @@ register_rule(group + '/' + subgroup_storage,
),
match = 'all',
)
+
register_rule(group + '/' + subgroup_storage,
varname = "fileinfo_groups",
title = _('File Grouping Patterns'),
@@ -915,20 +916,28 @@ register_rule(group + '/' + subgroup_storage,
'of single services for each file. This rule also applies when '
'you use manually configured checks instead of inventorized ones.'),
valuespec = ListOf(
- Tuple(
- help = _("This defines one file grouping pattern"),
- show_titles = True,
- orientation = "horizontal",
- elements = [
- TextAscii(
- title = _("Name of group"),
- ),
- TextAscii(
- title = _("File pattern (using * and ?)"),
- ),
- ]
- ),
- add_label = _("Add pattern"),
+ Tuple(
+ help = _("This defines one file grouping pattern"),
+ show_titles = True,
+ orientation = "horizontal",
+ elements = [
+ TextAscii(
+ title = _("Name of group"),
+ ),
+ Transform(
+ Tuple(
+ show_titles = True,
+ orientation = "vertical",
+ elements = [
+ TextAscii(title = _("Include Pattern")),
+ TextAscii(title = _("Exclude Pattern"))
+ ],
+ ),
+ forth = lambda params: type(params) == str and ( params, '' ) or params
+ ),
+ ],
+ ),
+ add_label = _("Add pattern group"),
),
match = 'all',
)
Module: check_mk
Branch: master
Commit: d14350f81a933d2978f99ebc55bb37de09b33e1f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d14350f81a933d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Dec 18 11:45:17 2013 +0100
New button in service list for refreshing all services
In the list of a hosts's services there is now always a new button <i>Automatic
Refresh (Tabula Rasa)</i>. This button does the same as the bulk inventory
with the Tabula Rasa option, but just for that single host: It removes all
autochecks and reinventorizes the host. This is a conveniant way to reset
network interface checks to OK after some ports have changed from down to
up or vice versa. Also changes in the mount options of Linux filesystems
can thus be acknowledged.
Conflicts:
ChangeLog
web/htdocs/wato.py
---
.bugs/741 | 6 ++++--
.werks/353 | 14 ++++++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 21 +++++++++------------
4 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/.bugs/741 b/.bugs/741
index c1b68d7..b1b0fb7 100644
--- a/.bugs/741
+++ b/.bugs/741
@@ -1,9 +1,9 @@
Title: Refreshing autochecks in wato
Component: wato
-State: open
+Class: nastiness
+State: done
Date: 2012-09-19 11:58:31
Targetversion: 1.4.0
-Class: nastiness
If for example mount options of a services changes, there is no way in the
wato service section to refresh the autochecks to use the new options
@@ -11,3 +11,5 @@ wato service section to refresh the autochecks to use the new options
Resolution: Make next to [Save manual check configuration] a new button
[Refresh all services], that does a complete reinventory (like cmk -II,
but should only refresh services that are already there!!!)
+
+2013-12-18 11:43:05: changed state open -> done
diff --git a/.werks/353 b/.werks/353
new file mode 100644
index 0000000..7b6426b
--- /dev/null
+++ b/.werks/353
@@ -0,0 +1,14 @@
+Title: New button in service list for refreshing all services
+Level: 2
+Component: wato
+Version: 1.2.4b1
+Date: 1387363388
+Class: feature
+
+In the list of a hosts's services there is now always a new button <i>Automatic
+Refresh (Tabula Rasa)</i>. This button does the same as the bulk inventory
+with the Tabula Rasa option, but just for that single host: It removes all
+autochecks and reinventorizes the host. This is a conveniant way to reset
+network interface checks to OK after some ports have changed from down to
+up or vice versa. Also changes in the mount options of Linux filesystems
+can thus be acknowledged.
diff --git a/ChangeLog b/ChangeLog
index ea44f79..19446f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -170,6 +170,7 @@
* 0428 Changed user profiles (e.g. pw changes) are now replicated in distributed setups...
* 0114 User Custom Attributes can now be exported to the core...
* 0448 New button in WATO service list for displaying check parameters...
+ * 0353 New button in service list for refreshing all services...
* 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
* 0241 FIX: Improved sorting of WATO folders in dropdown menu...
* 0019 FIX: Fixed wording in WATO rule for MSSQL check
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4bc1877..481de8b 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -2457,9 +2457,6 @@ def mode_inventory(phase, firsttime):
return
cache_options = html.var("_scan") and [ '@scan' ] or [ '@noscan' ]
- table = check_mk_automation(host[".siteid"], "try-inventory", cache_options + [hostname])
- table.sort()
- active_checks = {}
new_target = "folder"
if html.var("_refresh"):
@@ -2486,16 +2483,15 @@ def mode_inventory(phase, firsttime):
active_checks[(ct, item)] = paramstring
if st == "clustered":
active_checks[(ct, item)] = paramstring
- if st == "clustered":
- active_checks[(ct, item)] = paramstring
- check_mk_automation(host[".siteid"], "set-autochecks", [hostname], active_checks)
- if host.get("inventory_failed"):
- del host["inventory_failed"]
- save_hosts()
- message = _("Saved check configuration of host [%s] with %d services") % \
- (hostname, len(active_checks))
- log_pending(LOCALRESTART, hostname, "set-autochecks", message)
+ check_mk_automation(host[".siteid"], "set-autochecks", [hostname], active_checks)
+ if host.get("inventory_failed"):
+ del host["inventory_failed"]
+ save_hosts()
+ message = _("Saved check configuration of host [%s] with %d services") % \
+ (hostname, len(active_checks))
+ log_pending(LOCALRESTART, hostname, "set-autochecks", message)
+
mark_affected_sites_dirty(g_folder, hostname, sync=False, restart=True)
return new_target, message
return "folder"
@@ -2546,6 +2542,7 @@ def show_service_table(host, firsttime):
if len(checktable) > 0:
html.button("_save", _("Save manual check configuration"))
+ html.button("_refresh", _("Automatic Refresh (Tabula Rasa)"))
html.write(" ")
if parameter_column:
Module: check_mk
Branch: master
Commit: 38976b2f617376da9a34953eb98c827ddec7f519
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=38976b2f617376…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jan 21 14:33:46 2014 +0100
Support multiline plugin output for Check_MK Checks
Check_MK checks can now return multiline ouput by just using the \n in it ouput.
---
.werks/124 | 8 ++++++++
ChangeLog | 3 ++-
modules/check_mk_base.py | 2 ++
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/.werks/124 b/.werks/124
new file mode 100644
index 0000000..dea32bf
--- /dev/null
+++ b/.werks/124
@@ -0,0 +1,8 @@
+Title: Support multiline plugin output for Check_MK Checks
+Level: 2
+Component: core
+Version: 1.2.5i1
+Date: 1390310917
+Class: feature
+
+Check_MK checks can now return multiline ouput by just using the \n in it ouput.
diff --git a/ChangeLog b/ChangeLog
index 82a883e..ea44f79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Core & Setup:
* 0386 Added all active checks to check_mk -L output...
* 0452 Speedup generation of configuration...
+ * 0124 Support multiline plugin output for Check_MK Checks...
* 0087 FIX: Fixed possible locking issue when using datasource program with long output...
* 0313 FIX: Avoid duplicate reading of configuration file on --create-rrd...
* 0379 FIX: check_mk -c: Now also rewrites the location of conf.d directory
@@ -155,8 +156,8 @@
* 0425 FIX: Fix login loop bug in distributed environments with different auth secrets
* 0117 FIX: Availability button is now visible for users without the right to edit views
* 0431 FIX: LDAP: Fixed group syncrhonisation when nested group sync is enabled
- * 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
* 0122 FIX: Multisite view editor not longer throwing a exception when loading views from other users
+ * 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index c2522d0..ea3ea0f 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -1284,6 +1284,8 @@ def submit_check_result(host, servicedesc, result, sa):
def submit_to_core(host, service, state, output):
# Save data for sending it to the Check_MK Micro Core
+ # Replace \n to enable multiline ouput
+ output = output.replace('\n', '\\n')
if monitoring_core == "cmc":
result = "\t%d\t%s\t%s\n" % (state, service, output.replace("\0", "")) # remove binary 0, CMC does not like it
if opt_keepalive:
Module: check_mk
Branch: master
Commit: 2be1976ee6714ca74a77ab93d99afc6407fd2e26
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2be1976ee6714c…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jan 21 12:31:44 2014 +0100
New time range filter for Downtimes and Comments
---
.werks/123 | 8 ++++++++
ChangeLog | 1 +
web/plugins/views/filters.py | 3 ++-
3 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.werks/123 b/.werks/123
new file mode 100644
index 0000000..d0dc3dc
--- /dev/null
+++ b/.werks/123
@@ -0,0 +1,8 @@
+Title: New time range filter for Downtimes and Comments
+Level: 1
+Component: multisite
+Version: 1.2.5i1
+Date: 1390303340
+Class: feature
+
+With the two new filters it is possible to filter list of comments or the list of downtimes for a special time range
diff --git a/ChangeLog b/ChangeLog
index 1c1ce3a..9ea09f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -131,6 +131,7 @@
* 0430 It is now possible to define custom time ranges in PNP graph search...
* 0449 Show all custom variables of hosts and services in the detail views...
* 0665 Added mail notificaton method to custom user notification dialog...
+ * 0123 New time range filter for Downtimes and Comments...
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
* 0239 FIX: Fixed incorrect html formatting when displaying host or service comments...
* 0307 FIX: Increased performance of multisite GUI with a large userbase...
diff --git a/web/plugins/views/filters.py b/web/plugins/views/filters.py
index 36663ee..5e00808 100644
--- a/web/plugins/views/filters.py
+++ b/web/plugins/views/filters.py
@@ -606,7 +606,8 @@ declare_filter(251, FilterTime("service", "svc_last_check", _("Last service chec
declare_filter(250, FilterTime("host", "host_last_state_change", _("Last host state change"), "host_last_state_change"))
declare_filter(251, FilterTime("host", "host_last_check", _("Last host check"), "host_last_check"))
-
+declare_filter(253, FilterTime("comment", "comment_entry_time", _("Time of comment"), "comment_entry_time" ))
+declare_filter(253, FilterTime("downtime", "downtime_entry_time", _("Time of Downtime"), "downtime_entry_time" ))
# _
# | | ___ __ _
# | | / _ \ / _` |
Module: check_mk
Branch: master
Commit: e9da7004446736f7dfa6142c6533f3f6ffc5d7b7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e9da7004446736…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Tue Jan 21 12:26:25 2014 +0100
FIX recurring updates of serial numbers of disabled ldap users fixed
If a user is disabled in LDAP, it gets locked in multisite and its serial number
is increased, so that the user gets kicked out. Before this change the serial
number was increased in every following sync. Now the serial number is only
increased the first time a disabled user is synced.
---
.werks/569 | 12 ++++++++++++
ChangeLog | 1 +
web/plugins/userdb/ldap.py | 2 +-
3 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/.werks/569 b/.werks/569
new file mode 100644
index 0000000..b8cddda
--- /dev/null
+++ b/.werks/569
@@ -0,0 +1,12 @@
+Title: recurring updates of serial numbers of disabled ldap users fixed
+Level: 2
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1390303011
+
+If a user is disabled in LDAP, it gets locked in multisite and its serial number
+is increased, so that the user gets kicked out. Before this change the serial
+number was increased in every following sync. Now the serial number is only
+increased the first time a disabled user is synced.
diff --git a/ChangeLog b/ChangeLog
index 2a51fe1..8b7d41c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -138,6 +138,7 @@
* 0425 FIX: Fix login loop bug in distributed environments with different auth secrets
* 0117 FIX: Availability button is now visible for users without the right to edit views
* 0431 FIX: LDAP: Fixed group syncrhonisation when nested group sync is enabled
+ * 0569 FIX: recurring updates of serial numbers of disabled ldap users fixed...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 3ba05d5..416902e 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -738,7 +738,7 @@ def ldap_convert_auth_expire(plugin, params, user_id, ldap_user, user):
# Special handling for active directory: Is the user enabled / disabled?
if config.ldap_connection['type'] == 'ad' and ldap_user.get('useraccountcontrol'):
# see http://www.selfadsi.de/ads-attributes/user-userAccountControl.htm for details
- if saveint(ldap_user['useraccountcontrol'][0]) & 2:
+ if saveint(ldap_user['useraccountcontrol'][0]) & 2 and not user.get("locked", False):
return {
'locked': True,
'serial': user.get('serial', 0) + 1,
Module: check_mk
Branch: master
Commit: f32521940c3dd05cb646e9bfb2c6b3609ae76892
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f32521940c3dd0…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Mon Jan 20 12:29:15 2014 +0100
emcvnx_raidgroups.list_luns: New check for EMC VNX storage system
reporting the List of LUNs used in a RAID Group
---
.werks/461 | 8 +++
ChangeLog | 1 +
agents/special/agent_emcvnx | 11 ++--
checkman/emcvnx_raidgroups.list_luns | 18 ++++++
checks/emcvnx_raidgroups | 105 +++++++++++++++++++++++++++++++
web/plugins/wato/datasource_programs.py | 1 +
6 files changed, 139 insertions(+), 5 deletions(-)
diff --git a/.werks/461 b/.werks/461
new file mode 100644
index 0000000..ee4d2af
--- /dev/null
+++ b/.werks/461
@@ -0,0 +1,8 @@
+Title: emcvnx_raidgroups.list_luns: New check for EMC VNX storage system
+Level: 2
+Component: checks
+Version: 1.2.5i1
+Date: 1390217290
+Class: feature
+
+reporting the List of LUNs used in a RAID Group
diff --git a/ChangeLog b/ChangeLog
index 1a7638a..26eb5e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -52,6 +52,7 @@
* 0450 mem.used: Add information about shared memory (on Linux hosts)
* 0458 hitachi_hnas_fc_if: New check for FibreChannel Interfaces in Hitachi HNAS storage systems
* 0459 emcvnx_info: New info check providing Model, Revision and Serial Number of EMC VNX storage systems
+ * 0461 emcvnx_raidgroups.list_luns: New check for EMC VNX storage system...
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/agents/special/agent_emcvnx b/agents/special/agent_emcvnx
index 2d5b76f..887ba29 100755
--- a/agents/special/agent_emcvnx
+++ b/agents/special/agent_emcvnx
@@ -64,10 +64,10 @@ OPTIONS:
--profile Enable performance profiling in Python source code
-i MODULES, --modules MODULES Modules to query. This is a comma separated list of
- which may contain the keywords "disks", "hba", "hwstatus"
- or "all" to define which information should be queried
- from the SP. You can define to use only view of them
- to optimize performance. The default is "all".
+ which may contain the keywords "disks", "hba", "hwstatus",
+ "raidgroups" or "all" to define which information should
+ be queried from the SP. You can define to use only view of
+ them to optimize performance. The default is "all".
""")
@@ -98,6 +98,7 @@ naviseccli_options = {
"disks" : {"cmd_option" : "-disk", "active" : False},
"hba" : {"cmd_option" : "-hba", "active" : False},
"hwstatus" : {"cmd_option" : "-array", "active" : False},
+ "raidgroups" : {"cmd_option" : "-rg", "active" : False},
# "agent-info" : {"cmd_option" : "-sp", "active" : False},
}
@@ -148,7 +149,7 @@ for module in naviseccli_options.keys():
# fetch information by calling naviseccli
#############################################################################
-basecmd="naviseccli -h %s -User %s -Password %s -Scope 0 getall " % (host_address, user, password)
+basecmd="naviseccli -h %s -User %s -Password '%s' -Scope 0 getall " % (host_address, user, password)
#
# check_mk section of agent output
diff --git a/checkman/emcvnx_raidgroups.list_luns b/checkman/emcvnx_raidgroups.list_luns
new file mode 100644
index 0000000..831e8e7
--- /dev/null
+++ b/checkman/emcvnx_raidgroups.list_luns
@@ -0,0 +1,18 @@
+title: EMC VNX Storage: RAID Group: List of LUNs
+agents: emc
+catalog: hw/storagehw/emc
+license: GPL
+distribution: check_mk
+description:
+ Reports the List of LUNs used in a RAID Group in an EMC VNX storage system.
+
+ This Check is just informational and always returns {OK}.
+
+ The information is retriefed by the special agent agent_emcvnx which uses
+ EMC's command line tool naviseccli.
+
+item:
+ The RAID Group ID.
+
+inventory:
+ Automatically configures one check for every RAID Group listed in the agent output.
diff --git a/checks/emcvnx_raidgroups b/checks/emcvnx_raidgroups
new file mode 100644
index 0000000..ded40c5
--- /dev/null
+++ b/checks/emcvnx_raidgroups
@@ -0,0 +1,105 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+# Example output from agent:
+# <<<emcvnx_raidgroups>>>
+#
+#
+# Server IP Address: 172.16.8.82
+# Agent Rev: 7.32.27 (0.14)
+#
+#
+# All RAID Groups Information
+# ----------------------------
+#
+#
+# RaidGroup ID: 0
+# RaidGroup Type: r5
+# RaidGroup State: Explicit_Remove
+# Valid_luns
+# List of disks: Bus 0 Enclosure 0 Disk 0
+# Bus 0 Enclosure 0 Disk 1
+# Bus 0 Enclosure 0 Disk 2
+# Bus 0 Enclosure 0 Disk 3
+# List of luns: 4
+# Max Number of disks: 16
+# Max Number of luns: 256
+# Raw Capacity (Blocks): 702504960
+# Logical Capacity (Blocks): 526878720
+# Free Capacity (Blocks,non-contiguous): 0
+# Free contiguous group of unbound segments: 0
+# Defrag/Expand priority: Medium
+# Percent defragmented: 100
+# Percent expanded: N/A
+# Disk expanding onto: N/A
+# Lun Expansion enabled: NO
+# Legal RAID types: r5
+#
+# RaidGroup ID: 124
+# RaidGroup Type: hot_spare
+# [...]
+
+# Parse agent output into a dict of the form:
+# (where the RAID Group ID is used as key)
+# parsed = {'0': {'luns': '4'},
+# '1': {'luns': '0,1'},
+# '124': {'luns': '4089'},
+# '2': {'luns': '2,3'}}
+
+
+def parse_emcvnx_raidgroups(info):
+ parsed = {}
+ for line in info:
+ if len(line) > 2 and line[0] == "RaidGroup" and line[1] == "ID:":
+ rg = {}
+ parsed[line[2]] = rg
+ elif len(line) > 3 and line[0] == "List" and line[1] == "of" and line[2] == "luns:":
+ luns = ",".join(line[3:])
+ rg["luns"] = luns
+ return parsed
+
+
+def inventory_emcvnx_raidgroups_list_luns(info):
+ parsed = parse_emcvnx_raidgroups(info)
+ #import pprint; pprint.pprint(parsed)
+ inventory = []
+ for rg in parsed:
+ inventory.append((rg, None))
+ return inventory
+
+
+def check_emcvnx_raidgroups_list_luns(item, _no_params, info):
+ parsed = parse_emcvnx_raidgroups(info)
+ if item not in parsed:
+ return 3, "RAID Group %s not found in agent output" % item
+ return 0, "List of LUNs: " + parsed[item]["luns"]
+
+
+check_info['emcvnx_raidgroups.list_luns'] = {
+ "inventory_function" : inventory_emcvnx_raidgroups_list_luns,
+ "check_function" : check_emcvnx_raidgroups_list_luns,
+ "service_description" : "RAID Group %s LUNs"
+}
diff --git a/web/plugins/wato/datasource_programs.py b/web/plugins/wato/datasource_programs.py
index 71660d8..50c4fe3 100644
--- a/web/plugins/wato/datasource_programs.py
+++ b/web/plugins/wato/datasource_programs.py
@@ -189,6 +189,7 @@ register_rule(group,
( "disks", _("Disks") ),
( "hba", _("iSCSI HBAs") ),
( "hwstatus", _("Hardware Status") ),
+ ( "raidgroups", _("RAID Groups") ),
],
default_value = [ "disks", "hba", "hwstatus", ],
allow_empty = False,