lists.checkmk.com
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
List overview
Download
Checkmk git commits
February 2016
----- 2024 -----
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
checkmk-commits@lists.checkmk.com
7 participants
402 discussions
Start a n
N
ew thread
Updated bug entries #2430
by Andreas Boesl
Module: check_mk Branch: master Commit: 1f0dca2523e1378596c365e224004c0cb72cc4c5 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1f0dca2523e137…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Wed Feb 17 14:36:01 2016 +0100 Updated bug entries #2430 --- .bugs/2430 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.bugs/2430 b/.bugs/2430 new file mode 100644 index 0000000..6a8313d --- /dev/null +++ b/.bugs/2430 @@ -0,0 +1,9 @@ +Title: Views in dashlets do use display options +Component: multisite +State: open +Date: 2016-02-17 14:33:10 +Targetversion: future +Class: nastiness + +Example: change time format in "normal" view to absolute. +Embedded "normal" view in dashlet still uses old (defautl) format.
8 years, 4 months
1
0
0
0
Reserved 30 bug IDS
by Andreas Boesl
Module: check_mk Branch: master Commit: 4ff806b95724781e599a0b8c20506d22c9c92504 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4ff806b9572478…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Wed Feb 17 14:32:33 2016 +0100 Reserved 30 bug IDS --- .bugs/first_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bugs/first_free b/.bugs/first_free index d5b4321..1db299c 100644 --- a/.bugs/first_free +++ b/.bugs/first_free @@ -1 +1 @@ -2430 +2460
8 years, 4 months
1
0
0
0
#3225 FIX Fixed exception when renaming a host which is configured as parent on a folder
by Lars Michelsen
Module: check_mk Branch: master Commit: 94e9374cc962bf5040dd8b048b8b8555d9421419 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=94e9374cc962bf…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Feb 17 14:26:24 2016 +0100 #3225 FIX Fixed exception when renaming a host which is configured as parent on a folder --- .werks/3225 | 10 ++++++++++ ChangeLog | 1 + web/htdocs/wato.py | 2 +- web/htdocs/watolib.py | 4 ++-- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.werks/3225 b/.werks/3225 new file mode 100644 index 0000000..afc5e54 --- /dev/null +++ b/.werks/3225 @@ -0,0 +1,10 @@ +Title: Fixed exception when renaming a host which is configured as parent on a folder +Level: 1 +Component: wato +Class: fix +Compatible: compat +State: unknown +Version: 1.2.9i1 +Date: 1455715567 + + diff --git a/ChangeLog b/ChangeLog index 332a18a..55c4c55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,7 @@ * 3216 FIX: Fixed exception when trying to edit an already deleted user * 3222 FIX: Fixed broken duplicate user id validation when creating new users * 3223 FIX: Fixed exception in network scan when hosts can not be resolved + * 3225 FIX: Fixed exception when renaming a host which is configured as parent on a folder Event Console: * 3058 FIX: Event Console is now allowing non loadable MIB modules on startup... diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py index c132dd4..610fa5d 100644 --- a/web/htdocs/wato.py +++ b/web/htdocs/wato.py @@ -1744,7 +1744,7 @@ def rename_host_as_parent(oldname, newname, in_folder=None): if in_folder.has_explicit_attribute("parents"): if in_folder.rename_parent(oldname, newname): - parents.append(somehost.name()) + parents.append(in_folder.name()) if parents: parents = [ "parents" ] * len(parents) diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py index b04283c..b74ebd2 100644 --- a/web/htdocs/watolib.py +++ b/web/htdocs/watolib.py @@ -1563,8 +1563,8 @@ class Folder(BaseFolder): # Must not fail because of auth problems. Auth is check at the # actually renamed host. changed = rename_host_in_list(self._attributes["parents"], oldname, newname) - self.mark_dirty() - self.folder().save_hosts() + self.mark_hosts_dirty() + self.save_hosts() return changed
8 years, 4 months
1
0
0
0
#3233 FIX Fixed shutdown of Nagios core with Livestatus module
by Sven Panne
Module: check_mk Branch: master Commit: ab402feaabdcf75005bcd9fa74e653a823b1b7a9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ab402feaabdcf7…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Wed Feb 17 14:07:34 2016 +0100 #3233 FIX Fixed shutdown of Nagios core with Livestatus module The Nagios core no longer hangs now during shutdown when the Livestatus module is used. This resulted in a long delay before the core was finally killed forcefully. --- .werks/3233 | 13 +++++++++++++ ChangeLog | 3 +++ livestatus/src/ClientQueue.cc | 15 ++++++++++++--- livestatus/src/ClientQueue.h | 3 ++- livestatus/src/module.c | 2 +- livestatus/src/store_c.cc | 2 +- livestatus/src/store_c.h | 2 +- 7 files changed, 33 insertions(+), 7 deletions(-) diff --git a/.werks/3233 b/.werks/3233 new file mode 100644 index 0000000..7faa26d --- /dev/null +++ b/.werks/3233 @@ -0,0 +1,13 @@ +Title: Fixed shutdown of Nagios core with Livestatus module +Level: 1 +Component: livestatus +Class: fix +Compatible: compat +State: unknown +Version: 1.2.9i1 +Date: 1455714163 + +The Nagios core no longer hangs now during shutdown when the Livestatus +module is used. This resulted in a long delay before the core was finally +killed forcefully. + diff --git a/ChangeLog b/ChangeLog index 15f8d55..332a18a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,9 @@ Event Console: * 3058 FIX: Event Console is now allowing non loadable MIB modules on startup... + Livestatus: + * 3233 FIX: Fixed shutdown of Nagios core with Livestatus module... + HW/SW-Inventory: * 3219 FIX: lnx_distro: Now detecting Oracle VM Server correctly diff --git a/livestatus/src/ClientQueue.cc b/livestatus/src/ClientQueue.cc index 254e928..a446580 100644 --- a/livestatus/src/ClientQueue.cc +++ b/livestatus/src/ClientQueue.cc @@ -31,7 +31,7 @@ using mk::mutex; using mk::unique_lock; using std::for_each; -ClientQueue::ClientQueue() {} +ClientQueue::ClientQueue() : _should_terminate(false) {} ClientQueue::~ClientQueue() { for_each(_queue.begin(), _queue.end(), close); } @@ -45,9 +45,12 @@ void ClientQueue::addConnection(int fd) { int ClientQueue::popConnection() { unique_lock<mutex> ul(_mutex); - while (_queue.empty()) { + while (_queue.empty() && !_should_terminate) { _cond.wait(ul); } + if (_queue.empty()) { + return -1; + } int fd = _queue.front(); _queue.pop_front(); return fd; @@ -55,4 +58,10 @@ int ClientQueue::popConnection() { // Note: What we *really* want here is the functionality of // notify_all_at_thread_exit. -void ClientQueue::wakeupAll() { _cond.notify_all(); } +void ClientQueue::terminate() { + { + lock_guard<mutex> lg(_mutex); + _should_terminate = true; + } + _cond.notify_all(); +} diff --git a/livestatus/src/ClientQueue.h b/livestatus/src/ClientQueue.h index 44d2138..7c155ed 100644 --- a/livestatus/src/ClientQueue.h +++ b/livestatus/src/ClientQueue.h @@ -37,13 +37,14 @@ public: ~ClientQueue(); void addConnection(int); int popConnection(); - void wakeupAll(); + void terminate(); private: typedef std::deque<int> _queue_t; _queue_t _queue; mk::mutex _mutex; mk::condition_variable _cond; + bool _should_terminate; }; #endif // ClientQueue_h diff --git a/livestatus/src/module.c b/livestatus/src/module.c index 15717e5..0671efd 100644 --- a/livestatus/src/module.c +++ b/livestatus/src/module.c @@ -281,7 +281,7 @@ void terminate_threads() { logger(LG_INFO, "Waiting for main to terminate..."); pthread_join(g_mainthread_id, NULL); logger(LG_INFO, "Waiting for client threads to terminate..."); - queue_wakeup_all(); + queue_terminate(); int t; for (t = 0; t < g_num_clientthreads; t++) { if (0 != pthread_join(g_clientthread_id[t], NULL)) { diff --git a/livestatus/src/store_c.cc b/livestatus/src/store_c.cc index 9d22bd1..b036516 100644 --- a/livestatus/src/store_c.cc +++ b/livestatus/src/store_c.cc @@ -58,7 +58,7 @@ void queue_add_connection(int cc) { g_client_queue->addConnection(cc); } int queue_pop_connection() { return g_client_queue->popConnection(); } -void queue_wakeup_all() { return g_client_queue->wakeupAll(); } +void queue_terminate() { return g_client_queue->terminate(); } void store_register_comment(nebstruct_comment_data *d) { g_store->registerComment(d); diff --git a/livestatus/src/store_c.h b/livestatus/src/store_c.h index ccef9eb..7b18ed5 100644 --- a/livestatus/src/store_c.h +++ b/livestatus/src/store_c.h @@ -45,7 +45,7 @@ void *create_inputbuffer(int fd, const int *termination_flag); void delete_inputbuffer(void *); void queue_add_connection(int cc); int queue_pop_connection(); -void queue_wakeup_all(); +void queue_terminate(); void update_timeperiods_cache(time_t); void log_timeperiods_cache();
8 years, 4 months
1
0
0
0
Fixed misspelled variable
by Lars Michelsen
Module: check_mk Branch: master Commit: 01cb0ae71625b2dfa1ba4ccb5c9b46d71f11865a URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=01cb0ae71625b2…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Feb 17 14:00:06 2016 +0100 Fixed misspelled variable --- web/htdocs/watolib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py index 3821d50..b04283c 100644 --- a/web/htdocs/watolib.py +++ b/web/htdocs/watolib.py @@ -1741,7 +1741,7 @@ class SearchFolder(BaseFolder): def path(self): if self._name: - return self._base_folder.path() + "//search:" + self_name + return self._base_folder.path() + "//search:" + self._name else: return self._base_folder.path() + "//search"
8 years, 4 months
1
0
0
0
Reserved 10 Werk IDS
by Sven Panne
Module: check_mk Branch: master Commit: 9af11b704dbd52ed5b6c6409b408a6f841959b9a URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9af11b704dbd52…
Author: Sven Panne <sp(a)mathias-kettner.de> Date: Wed Feb 17 13:54:59 2016 +0100 Reserved 10 Werk IDS --- .werks/first_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.werks/first_free b/.werks/first_free index 3c964c4..f698ab1 100644 --- a/.werks/first_free +++ b/.werks/first_free @@ -1 +1 @@ -3233 +3243
8 years, 4 months
1
0
0
0
Removed handling of deprecated OMD apache shared mode
by Lars Michelsen
Module: check_mk Branch: master Commit: 0346c8ca6e18e41d24dbfea2f3116f9731f90356 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0346c8ca6e18e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Feb 17 13:55:09 2016 +0100 Removed handling of deprecated OMD apache shared mode --- web/htdocs/html_mod_python.py | 14 -------------- web/htdocs/watolib.py | 27 +++++++++------------------ 2 files changed, 9 insertions(+), 32 deletions(-) diff --git a/web/htdocs/html_mod_python.py b/web/htdocs/html_mod_python.py index 6ff3577..8777e2b 100644 --- a/web/htdocs/html_mod_python.py +++ b/web/htdocs/html_mod_python.py @@ -227,20 +227,6 @@ class html_mod_python(htmllib.html): self.javascript('update_header_timer()') self.top_heading_right() - def omd_mode(self): - # Load mod_python env into regular environment - for k, v in self.req.subprocess_env.items(): - os.environ[k] = v - - omd_mode = None - omd_site = None - if 'OMD_SITE' in os.environ: - omd_site = os.environ['OMD_SITE'] - omd_mode = 'shared' - if omd_site == self.apache_user(): - omd_mode = 'own' - return (omd_mode, omd_site) - def log(self, *args): from lib import logger, LOG_NOTICE for arg in args: diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py index 85aa7b5..3821d50 100644 --- a/web/htdocs/watolib.py +++ b/web/htdocs/watolib.py @@ -3885,30 +3885,21 @@ def check_mk_local_automation(command, args=[], indata="", stdin_data=None, time # Gather the command to use for executing --automation calls to check_mk # - First try to use the check_mk_automation option from the defaults - # - When not set try to detect the command for OMD or non OMD installations - # - OMD 'own' apache mode or non OMD: check_mk --automation - # - OMD 'shared' apache mode: Full path to the binary and the defaults - sudoline = None + # - When not set use "check_mk --automation" if defaults.check_mk_automation: commandargs = defaults.check_mk_automation.split() - cmd = commandargs + [ command, '--' ] + args else: - omd_mode, omd_site = html.omd_mode() - if not omd_mode or omd_mode == 'own': - commandargs = [ 'check_mk', '--automation' ] - cmd = commandargs + [ command, '--' ] + args - else: # OMD shared mode - commandargs = [ 'sudo', '/bin/su', '-', omd_site, '-c', 'check_mk --automation' ] - cmd = commandargs[:-1] + [ commandargs[-1] + ' ' + ' '.join([ command, '--' ] + args) ] - sudoline = "%s ALL = (root) NOPASSWD: /bin/su - %s -c check_mk\\ --automation\\ *" % (html.apache_user(), omd_site) + commandargs = [ 'check_mk', '--automation' ] + cmd = commandargs + [ command, '--' ] + args sudo_msg = '' if commandargs[0] == 'sudo': - if not sudoline: - if commandargs[1] == '-u': # skip -u USER in /etc/sudoers - sudoline = "%s ALL = (%s) NOPASSWD: %s *" % (html.apache_user(), commandargs[2], " ".join(commandargs[3:])) - else: - sudoline = "%s ALL = (root) NOPASSWD: %s *" % (html.apache_user(), commandargs[0], " ".join(commandargs[1:])) + if commandargs[1] == '-u': # skip -u USER in /etc/sudoers + sudoline = "%s ALL = (%s) NOPASSWD: %s *" % \ + (html.apache_user(), commandargs[2], " ".join(commandargs[3:])) + else: + sudoline = "%s ALL = (root) NOPASSWD: %s *" % \ + (html.apache_user(), " ".join(commandargs[1:])) sudo_msg = ("<p>The webserver is running as user which has no rights on the " "needed Check_MK/Nagios files.<br>Please ensure you have set-up "
8 years, 4 months
1
0
0
0
Fixed broken error handling in ajax methods
by Lars Michelsen
Module: check_mk Branch: master Commit: f24eb41b544921237c1444048c7c7f2b32568cf4 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f24eb41b544921…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Wed Feb 17 13:31:35 2016 +0100 Fixed broken error handling in ajax methods --- web/htdocs/weblib.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/htdocs/weblib.py b/web/htdocs/weblib.py index c7e6fe0..7c39edb 100644 --- a/web/htdocs/weblib.py +++ b/web/htdocs/weblib.py @@ -35,7 +35,7 @@ def ajax_tree_openclose(): name = html.get_unicode_input("name") if not tree or not name: - MKUserError('tree or name parameter missing') + raise lib.MKUserError(_('tree or name parameter missing')) html.set_tree_state(tree, name, html.var("state")) html.save_tree_states() @@ -120,7 +120,7 @@ def ajax_set_rowselection(): action = html.var('action', 'set') if action not in [ 'add', 'del', 'set', 'unset' ]: - raise MKUserError(_('Invalid action')) + raise lib.MKUserError(_('Invalid action')) rows = html.var('rows', '').split(',')
8 years, 4 months
1
0
0
0
#3188 ps.include: fixed typo
by Simon Betz
Module: check_mk Branch: master Commit: b4679663434de8b3cdc7d2786f70d8e5fe93ab1e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b4679663434de8…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Wed Feb 17 13:10:25 2016 +0100 #3188 ps.include: fixed typo --- .werks/3188 | 10 ++++++++++ ChangeLog | 1 + checks/ps.include | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.werks/3188 b/.werks/3188 new file mode 100644 index 0000000..b6bdcb0 --- /dev/null +++ b/.werks/3188 @@ -0,0 +1,10 @@ +Title: ps.include: fixed typo +Level: 1 +Component: checks +Class: fix +Compatible: compat +State: unknown +Version: 1.2.9i1 +Date: 1455710969 + + diff --git a/ChangeLog b/ChangeLog index 467df0c..15f8d55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ * 3186 FIX: fortigate_node: fixed empty item NOTE: Please refer to the migration notes! * 2993 FIX: zfs_arc_cache: fixed crash, no longer reports unknown if not all data is available... + * 3188 FIX: ps.include: fixed typo Multisite: * 3187 notification view: new filter for log command via regex diff --git a/checks/ps.include b/checks/ps.include index a1e2be9..98093aa 100644 --- a/checks/ps.include +++ b/checks/ps.include @@ -340,7 +340,7 @@ def ps_has_extended_perfdata(process_info): def check_ps_common(item, params, parsed, cpu_cores = 1, info_name = "processes", total_ram = None): now = time.time() - parms = ps_cleanup_params(params) + params = ps_cleanup_params(params) count = 0 virtual_size = 0
8 years, 4 months
1
0
0
0
#2993 FIX zfs_arc_cache: fixed crash, no longer reports unknown if not all data is available
by Andreas Boesl
Module: check_mk Branch: master Commit: b56e15fe5e142dc4adf3894d9dd5796e87dbb83f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b56e15fe5e142d…
Author: Andreas Boesl <ab(a)mathias-kettner.de> Date: Wed Feb 17 12:52:06 2016 +0100 #2993 FIX zfs_arc_cache: fixed crash, no longer reports unknown if not all data is available Fixed division by zero exception. Some zfs systems do not report all data, the check is now able to tolerate this. --- .werks/2993 | 11 +++++++++ ChangeLog | 1 + checks/zfs_arc_cache | 60 +++++++++++++------------------------------------- 3 files changed, 27 insertions(+), 45 deletions(-) diff --git a/.werks/2993 b/.werks/2993 new file mode 100644 index 0000000..d22ec12 --- /dev/null +++ b/.werks/2993 @@ -0,0 +1,11 @@ +Title: zfs_arc_cache: fixed crash, no longer reports unknown if not all data is available +Level: 1 +Component: checks +Compatible: compat +Version: 1.2.9i1 +Date: 1455709812 +Class: fix + +Fixed division by zero exception. Some zfs systems do not report all data, the check +is now able to tolerate this. + diff --git a/ChangeLog b/ChangeLog index 01c621d..467df0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,7 @@ * 3217 FIX: fortigate_sessions: Fixed exception in case of empty data provided by the device * 3186 FIX: fortigate_node: fixed empty item NOTE: Please refer to the migration notes! + * 2993 FIX: zfs_arc_cache: fixed crash, no longer reports unknown if not all data is available... Multisite: * 3187 notification view: new filter for log command via regex diff --git a/checks/zfs_arc_cache b/checks/zfs_arc_cache index 4c038e0..b529191 100644 --- a/checks/zfs_arc_cache +++ b/checks/zfs_arc_cache @@ -116,60 +116,30 @@ def inventory_zfs_arc_cache(parsed): return [] def check_zfs_arc_cache(_no_item, _no_params, parsed): - status = 0 - perfdata = [] - message = "ZFS arc cache:" - - # hit ratio - if "hits" in parsed.keys() and "misses" in parsed.keys(): - hit_ratio = float(parsed["hits"]) / (parsed["hits"] + parsed["misses"]) * 100 - message += " hit ratio: %0.2f %%" % hit_ratio - perfdata.append(("hit_ratio", "%0.2f" % hit_ratio, '', '', 0, 100)) - else: - message += " no info about hit ratio available" - perfdata.append(("hit_ratio", 0, '', '', 0, 100)) - status = 3 - - # prefetch data hit ratio - if "prefetch_data_hits" in parsed.keys() and "prefetch_data_misses" in parsed.keys(): - prefetch_data_hit_ratio = float(parsed["prefetch_data_hits"]) / (parsed["prefetch_data_hits"] + parsed["prefetch_data_misses"]) * 100 - message += ", prefetch data hit ratio: %0.2f %%" % prefetch_data_hit_ratio - perfdata.append(("prefetch_data_hit_ratio", "%0.2f" % prefetch_data_hit_ratio, '', '', 0, 100)) - else: - message += ", no info about prefetch data hit ratio available" - perfdata.append(("prefetch_data_hit_ratio", 0, '', '', 0, 100)) - status = 3 - - # prefetch metadata hit ratio - if "prefetch_metadata_hits" in parsed.keys() and "prefetch_metadata_misses" in parsed.keys(): - prefetch_metadata_hit_ratio = float(parsed["prefetch_metadata_hits"]) / (parsed["prefetch_metadata_hits"] + parsed["prefetch_metadata_misses"]) * 100 - message += ", prefetch metadata hit ratio: %0.2f %%" % prefetch_metadata_hit_ratio - perfdata.append(("prefetch_metadata_hit_ratio", "%0.2f" % prefetch_metadata_hit_ratio, '', '', 0, 100)) - else: - message += ", no info about prefetch metadata hit ratio available" - perfdata.append(("prefetch_metadata_hit_ratio", 0, '', '', 0, 100)) - status = 3 + for key in [ "", "prefetch_data_", "prefetch_metadata_" ]: + human_key = key.replace("_", " ") + total_hits_misses = parsed["%shits" % key] + parsed["%smisses" % key] + if not total_hits_misses: + yield 0, " No %sHits or Misses" % human_key, [("%shit_ratio" % key, 0, '', '', 0, 100)] + else: + hit_ratio = float(parsed["%shits" % key]) / total_hits_misses * 100 + yield 0, " %sHit Ratio: %0.2f %%" % (human_key.title(), hit_ratio), [("%shit_ratio" % key, "%0.2f" % hit_ratio, '', '', 0, 100)] # size if "size" in parsed.keys(): - message += ", cache size: %d MB" % parsed["size"] - perfdata.append(("size", parsed["size"] * 1024 * 1024, '', '', 0)) - else: - message += ", no info about cache size available" - perfdata.append(("size", 0, '', '', 0)) - status = 3 + yield 0, "Cache size: %d MB" % parsed["size"], [("size", parsed["size"] * 1024 * 1024, '', '', 0)] # arc_meta # these values may be missing, this is ok too # in this case just do not report these values if "arc_meta_used" in parsed.keys() and "arc_meta_limit" in parsed.keys() and "arc_meta_max" in parsed.keys(): - message += ", arc meta %d MB used, limit %d MB, max %d MB" \ - % (parsed["arc_meta_used"], parsed["arc_meta_limit"], parsed["arc_meta_max"]) - perfdata.append(("arc_meta_used", parsed["arc_meta_used"] * 1024 * 1024, '', '', 0)) - perfdata.append(("arc_meta_limit", parsed["arc_meta_limit"] * 1024 * 1024, '', '', 0)) - perfdata.append(("arc_meta_max", parsed["arc_meta_max"] * 1024 * 1024, '', '', 0)) + yield 0, "Arc Meta %d MB used, Limit %d MB, Max %d MB" \ + % (parsed["arc_meta_used"], parsed["arc_meta_limit"], parsed["arc_meta_max"]),[ + ("arc_meta_used", parsed["arc_meta_used"] * 1024 * 1024, '', '', 0), + ("arc_meta_limit", parsed["arc_meta_limit"] * 1024 * 1024, '', '', 0), + ("arc_meta_max", parsed["arc_meta_max"] * 1024 * 1024, '', '', 0) + ] - return status, message, perfdata check_info["zfs_arc_cache"] = { "parse_function" : parse_zfs_arc_cache,
8 years, 4 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
41
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Results per page:
10
25
50
100
200