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
September
August
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
December 2016
----- 2024 -----
September 2024
August 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
10 participants
391 discussions
Start a n
N
ew thread
Cleaned up some OO related issues
by Lars Michelsen
Module: check_mk Branch: master Commit: 77d3f6853016d76edfe9f3f65906cda9f1d6f054 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=77d3f6853016d7…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 16 18:34:08 2016 +0100 Cleaned up some OO related issues Change-Id: Id61f1bed84ad7d59abd802d0780443266e004899 --- checks/elphase.include | 2 +- checks/supermicro | 2 +- doc/treasures/active_checks/check_cpu_peaks | 3 +++ doc/treasures/active_checks/check_form_submit | 1 + modules/automation.py | 2 +- tests/pylint/pylintrc | 4 ++-- web/htdocs/backup.py | 1 + web/htdocs/config.py | 18 +++++++++--------- web/htdocs/valuespec.py | 11 ++++++----- web/htdocs/watolib.py | 13 +++++-------- 10 files changed, 30 insertions(+), 27 deletions(-) diff --git a/checks/elphase.include b/checks/elphase.include index fa0e32d..3edcbf4 100644 --- a/checks/elphase.include +++ b/checks/elphase.include @@ -47,7 +47,7 @@ def check_elphase(item, params, parsed): else: return "%.1f" % value - class Bounds: + class Bounds(object): Lower, Upper, Both = range(3) if params is None: diff --git a/checks/supermicro b/checks/supermicro index 1fd699e..1de0dc6 100644 --- a/checks/supermicro +++ b/checks/supermicro @@ -118,7 +118,7 @@ def inventory_supermicro_sensors(info): yield name, None def check_supermicro_sensors(item, _no_params, info): - class Type: + class Type(object): Fan, Voltage, Temperature, Status = ('0', '1', '2', '3') def worst_status(*args): diff --git a/doc/treasures/active_checks/check_cpu_peaks b/doc/treasures/active_checks/check_cpu_peaks index 6a68549..30d90ab 100755 --- a/doc/treasures/active_checks/check_cpu_peaks +++ b/doc/treasures/active_checks/check_cpu_peaks @@ -28,7 +28,10 @@ import sys, os, time, getopt class MKGeneralException(Exception): def __init__(self, reason): + super(MKGeneralException, self).__init__() self.reason = reason + + def __str__(self): return self.reason diff --git a/doc/treasures/active_checks/check_form_submit b/doc/treasures/active_checks/check_form_submit index 835bb94..3b27a73 100755 --- a/doc/treasures/active_checks/check_form_submit +++ b/doc/treasures/active_checks/check_form_submit @@ -146,6 +146,7 @@ def debug(s): class HostResult(Exception): def __init__(self, result): + super(HostResult, self).__init__() self.result = result def new_state(rc, s): diff --git a/modules/automation.py b/modules/automation.py index f370722..e18c2e1 100644 --- a/modules/automation.py +++ b/modules/automation.py @@ -461,7 +461,7 @@ def automation_restart(job = "restart"): # os.closerange(3, 256) --> not available in older Python versions - class null_file: + class null_file(object): def write(self, stuff): pass def flush(self): diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc index 04aee49..4e28da5 100644 --- a/tests/pylint/pylintrc +++ b/tests/pylint/pylintrc @@ -18,9 +18,9 @@ errors-only=yes disable=C0111,bad-whitespace,unsubscriptable-object,unsupported-membership-test,unpacking-non-sequence,assignment-from-none # W0612: Unused variable # TODO: enable this and prepare code for it! -#enable=W0612 +#enable=unused-variable #
https://pylint.readthedocs.io/en/latest/reference_guide/features.html
-enable=unreachable,dangerous-default-value,duplicate-key,using-constant-test,duplicate-except,binary-op-exception,overlapping-except +enable=unreachable,dangerous-default-value,duplicate-key,using-constant-test,duplicate-except,binary-op-exception,overlapping-except,non-parent-init-called,super-init-not-called,no-init [TYPECHECK] # rrdtool diff --git a/web/htdocs/backup.py b/web/htdocs/backup.py index 8f3ed5c..e000f5a 100644 --- a/web/htdocs/backup.py +++ b/web/htdocs/backup.py @@ -1820,5 +1820,6 @@ class PageBackupRestore(object): class PageBackupRestoreState(PageBackupJobState): def __init__(self): + super(PageBackupRestoreState, self).__init__() self._job = RestoreJob(None, None) # TODO: target_ident and backup_ident needed? self._ident = "restore" diff --git a/web/htdocs/config.py b/web/htdocs/config.py index 41dfd0c..3976ca5 100644 --- a/web/htdocs/config.py +++ b/web/htdocs/config.py @@ -63,15 +63,15 @@ permission_declaration_functions = [] ALL_HOSTS = '(.*)' HOST_STATE = ('__HOST_STATE__',) HIDDEN = ('__HIDDEN__',) -class FOREACH_HOST: pass -class FOREACH_CHILD: pass -class FOREACH_CHILD_WITH: pass -class FOREACH_PARENT: pass -class FOREACH_SERVICE: pass -class REMAINING: pass -class DISABLED: pass -class HARD_STATES: pass -class DT_AGGR_WARN: pass +class FOREACH_HOST(object): pass +class FOREACH_CHILD(object): pass +class FOREACH_CHILD_WITH(object): pass +class FOREACH_PARENT(object): pass +class FOREACH_SERVICE(object): pass +class REMAINING(object): pass +class DISABLED(object): pass +class HARD_STATES(object): pass +class DT_AGGR_WARN(object): pass # Has to be declared here once since the functions can be assigned in # bi.py and also in multisite.mk. "Double" declarations are no problem diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py index d6386a4..f260c4e 100644 --- a/web/htdocs/valuespec.py +++ b/web/htdocs/valuespec.py @@ -25,6 +25,7 @@ # Boston, MA 02110-1301 USA. # FIXME: Cleanups +# - Change all class to be "new style" classes # - Consolidate ListChoice and DualListChoice to use the same class # and rename to better name # - Consolidate RadioChoice and DropdownChoice to use same class @@ -503,7 +504,7 @@ class ID(TextAscii): # Same as the ID class, but allowing unicode objects class UnicodeID(TextUnicode): def __init__(self, **kwargs): - TextAscii.__init__(self, **kwargs) + TextUnicode.__init__(self, **kwargs) self._regex = re.compile(r'^[\w][-\w0-9_]*$', re.UNICODE) self._regex_error = _("An identifier must only consist of letters, digits, dash and " "underscore and it must start with a letter or underscore.") @@ -511,7 +512,7 @@ class UnicodeID(TextUnicode): class UserID(TextUnicode): def __init__(self, **kwargs): - TextAscii.__init__(self, **kwargs) + TextUnicode.__init__(self, **kwargs) self._regex = re.compile(r'^[\w][-\w0-9_\.@]*$', re.UNICODE) self._regex_error = _("An identifier must only consist of letters, digits, dash, dot, " "at and underscore. But it must start with a letter or underscore.") @@ -2608,7 +2609,7 @@ month_names = [ ] -class TimeHelper: +class TimeHelper(object): @staticmethod def round(timestamp, unit): time_s = list(time.localtime(timestamp)) @@ -3554,7 +3555,7 @@ class ElementSelection(ValueSpec): class AutoTimestamp(FixedValue): def __init__(self, **kwargs): - ValueSpec.__init__(self, **kwargs) + FixedValue.__init__(self, **kwargs) def canonical_value(self): return time.time() @@ -3685,7 +3686,7 @@ class Transform(ValueSpec): class LDAPDistinguishedName(TextUnicode): def __init__(self, **kwargs): - TextAscii.__init__(self, **kwargs) + TextUnicode.__init__(self, **kwargs) self.enforce_suffix = kwargs.get('enforce_suffix') def validate_value(self, value, varprefix): diff --git a/web/htdocs/watolib.py b/web/htdocs/watolib.py index bb1dbe7..e0304f9 100644 --- a/web/htdocs/watolib.py +++ b/web/htdocs/watolib.py @@ -397,7 +397,7 @@ class ConfigDomainEventConsole(ConfigDomain): class WithPermissions(object): def __init__(self): - object.__init__(self) + super(WithPermissions, self).__init__() def may(self, how): # how is "read" or "write" return self.user_may(config.user.id, how) @@ -436,7 +436,7 @@ class WithPermissions(object): # for Host and Folder class WithPermissionsAndAttributes(WithPermissions): def __init__(self): - WithPermissions.__init__(self) + super(WithPermissionsAndAttributes, self).__init__() self._attributes = {} # .--------------------------------------------------------------------. @@ -483,10 +483,6 @@ class WithPermissionsAndAttributes(WithPermissions): # | Base class of SearchFolder and Folder. Implements common methods. | # '----------------------------------------------------------------------' class BaseFolder(WithPermissionsAndAttributes): - def __init__(self): - WithPermissions.__init__(self) - - def hosts(self): raise NotImplementedError() @@ -799,7 +795,7 @@ class Folder(BaseFolder): def __init__(self, name, folder_path=None, parent_folder=None, title=None, attributes=None): - WithPermissionsAndAttributes.__init__(self) + super(Folder, self).__init__() self._name = name self._parent = parent_folder self._subfolders = {} @@ -1890,6 +1886,7 @@ class SearchFolder(BaseFolder): # '--------------------------------------------------------------------' def __init__(self, base_folder, criteria): + super(SearchFolder, self).__init__() self._criteria = criteria self._base_folder = base_folder self._found_hosts = None @@ -2094,7 +2091,7 @@ class Host(WithPermissionsAndAttributes): # '--------------------------------------------------------------------' def __init__(self, folder, host_name, attributes, cluster_nodes): - WithPermissionsAndAttributes.__init__(self) + super(Host, self).__init__() self._folder = folder self._name = host_name self._attributes = attributes
7 years, 9 months
1
0
0
0
Cleaned up some unused variables
by Lars Michelsen
Module: check_mk Branch: master Commit: 44c0d7562411cc11e7527f31ff8b8394e0cf6567 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=44c0d7562411cc…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 16 18:40:08 2016 +0100 Cleaned up some unused variables Change-Id: I5c91cabd694094cb8bc38e4e22c51a74f901b469 --- bin/mkeventd | 2 +- checks/akcp_sensor.include | 6 +++--- checks/cmciii.include | 2 +- checks/cpu_util.include | 4 ++-- checks/df_netapp.include | 2 +- checks/filerdisks.include | 2 -- checks/fjdarye.include | 2 +- checks/mssql.include | 4 ++-- checks/printer_io.include | 2 +- cmk_base/localize.py | 2 +- doc/treasures/active_checks/check_bi_aggr | 2 +- modules/events.py | 4 ++-- modules/notify.py | 2 +- 13 files changed, 17 insertions(+), 19 deletions(-) diff --git a/bin/mkeventd b/bin/mkeventd index d86d5f3..9b68d71 100755 --- a/bin/mkeventd +++ b/bin/mkeventd @@ -4166,7 +4166,7 @@ def rbn_groups_contacts(groups): except livestatus.MKLivestatusNotFoundError: return [] - except Exception, e: + except Exception: if cmk.debug.enabled(): raise return [] diff --git a/checks/akcp_sensor.include b/checks/akcp_sensor.include index acdc3fb..586633d 100644 --- a/checks/akcp_sensor.include +++ b/checks/akcp_sensor.include @@ -72,7 +72,7 @@ def inventory_akcp_sensor_no_params(info): akcp_humidity_defaultlevels = (30, 35, 60, 65) def inventory_akcp_humidity(info): - for description, percent, status, online in info: + for description, _percent, _status, online in info: if online == "1": yield description, "akcp_humidity_defaultlevels" @@ -224,9 +224,9 @@ def check_akcp_sensor_drycontact(item, _no_params, info): for line in info: if item == line[0]: if len(line) == 5: - description, status, crit_desc, normal_desc, online = line + status, crit_desc, normal_desc, online = line[1:] else: - description, status, online = line + status, online = line[1:] normal_desc = "Drycontact OK" crit_desc = "Drycontact on Error" diff --git a/checks/cmciii.include b/checks/cmciii.include index d1f32a4..1ec289c 100644 --- a/checks/cmciii.include +++ b/checks/cmciii.include @@ -60,7 +60,7 @@ def inventory_cmciii_lcp_fanunit(zone, direction, info): def check_cmciii_lcp_fanunit(item, params, info): if params == None: params = {} - unit_desc, unit_status, desc, status = info[0][0:4] + _unit_desc, unit_status, _desc, status = info[0][1:4] temps = extract_cmciii_lcp_temps(info[0][4:]) status, message, perfdata = check_temperature( diff --git a/checks/cpu_util.include b/checks/cpu_util.include index a277242..ba0d7ee 100644 --- a/checks/cpu_util.include +++ b/checks/cpu_util.include @@ -139,7 +139,7 @@ def check_cpu_util_unix(values, params, cores = None): for v in values: n += 1 countername = "cpu.util.%d" % n - last_time, last_val = get_item_state(countername, (0, 0)) + last_val = get_item_state(countername, (0, 0))[1] diff_values.append(v - last_val) set_item_state(countername, (this_time, v)) @@ -210,7 +210,7 @@ def check_cpu_util_unix(values, params, cores = None): "core_util_time" in params): core_counter = 0 cores_padded = [line + [0] * (11 - len(line)) for line in cores] - for core, user, nice, system, idle, iowait,\ + for core, user, nice, system, _idle, iowait,\ irq, softirq, steal, guest, guest_nice in cores_padded: total = user + nice + system + iowait + irq + softirq + steal + guest + guest_nice diff --git a/checks/df_netapp.include b/checks/df_netapp.include index d108640..edc1428 100644 --- a/checks/df_netapp.include +++ b/checks/df_netapp.include @@ -26,7 +26,7 @@ def inventory_df_netapp(info): mplist = [] - for volume, size_kb, used_kb in info: + for volume, size_kb, _used_kb in info: if saveint(size_kb) > 0: # Exclude filesystems with zero size (some snapshots) mplist.append(volume) return df_inventory(mplist) diff --git a/checks/filerdisks.include b/checks/filerdisks.include index 766678e..40aa1e3 100644 --- a/checks/filerdisks.include +++ b/checks/filerdisks.include @@ -43,8 +43,6 @@ def check_filer_disks(disks, params): state['spare'] = [] total_capacity = 0 - prefaild_data_disk_count = 0 - prefaild_parity_disk_count = 0 for disk in disks: total_capacity += disk.get("capacity", 0) diff --git a/checks/fjdarye.include b/checks/fjdarye.include index ed53565..eb96d1a 100644 --- a/checks/fjdarye.include +++ b/checks/fjdarye.include @@ -68,7 +68,7 @@ fjdarye_disks_status = { 1: 'available', 2: 'broken', 3: 'notavailable', def fjdarye_disks_summary(info): # compute the number of disks in each state. states = {} - for index, state in info: + for _index, state in info: state = int(state) statename = fjdarye_disks_status[state] if state != 3: diff --git a/checks/mssql.include b/checks/mssql.include index 7ac4ea5..2ba0a7f 100644 --- a/checks/mssql.include +++ b/checks/mssql.include @@ -124,10 +124,10 @@ def check_mssql_datafiles(item, params, info): found = False for row in info: if len(row) == 8: - inst, database, file_name, physical_name, max_size, allocated_size, used_size, unlimited = row + inst, database, file_name, _physical_name, max_size, allocated_size, used_size, unlimited = row unlimited = unlimited == '1' else: - database, file_name, physical_name, max_size, allocated_size, used_size = row + database, file_name, _physical_name, max_size, allocated_size, used_size = row inst = None unlimited = False diff --git a/checks/printer_io.include b/checks/printer_io.include index 26aa7d6..dc8c487 100644 --- a/checks/printer_io.include +++ b/checks/printer_io.include @@ -73,7 +73,7 @@ def inventory_printer_io(info): index, name, descr, status = line[:4] if descr == '': continue - snmp_status, capacity_unit, capacity_max, level = line[3:] + snmp_status, _capacity_unit, capacity_max, _level = line[3:] if capacity_max == '0': # useless continue diff --git a/cmk_base/localize.py b/cmk_base/localize.py index 1ee0547..f23bc43 100644 --- a/cmk_base/localize.py +++ b/cmk_base/localize.py @@ -171,7 +171,7 @@ def localize_sniff(): sniff_files = [] for path in paths: - for root, dirs, files in os.walk(path): + for root, _dirs, files in os.walk(path): for f in files: if f.endswith(".py") or f.endswith(".mk"): sniff_files.append(os.path.join(root, f)) diff --git a/doc/treasures/active_checks/check_bi_aggr b/doc/treasures/active_checks/check_bi_aggr index 30e9ad5..07edef6 100755 --- a/doc/treasures/active_checks/check_bi_aggr +++ b/doc/treasures/active_checks/check_bi_aggr @@ -142,7 +142,7 @@ def init_auth(): if auth_mode == 'kerberos': from requests_kerberos import HTTPKerberosAuth - from subprocess import Popen, PIPE, check_call + from subprocess import Popen, PIPE kinit = Popen(["kinit", username], stdin=PIPE, stdout=PIPE, stderr=PIPE) output, errors = kinit.communicate("%s\n" % password) kinit.wait() diff --git a/modules/events.py b/modules/events.py index 4154b73..1bddd32 100644 --- a/modules/events.py +++ b/modules/events.py @@ -212,8 +212,8 @@ def livestatus_fetch_contacts(host, service): # Service not found: try again with contacts of host! return livestatus_fetch_contacts(host, None) - except Exception, e: - if True or cmk.debug.enabled(): + except Exception: + if cmk.debug.enabled(): raise return None # We must allow notifications without Livestatus access diff --git a/modules/notify.py b/modules/notify.py index 41d9201..06c8d11 100644 --- a/modules/notify.py +++ b/modules/notify.py @@ -816,7 +816,7 @@ def rbn_groups_contacts(groups): except livestatus.MKLivestatusNotFoundError: return [] - except Exception, e: + except Exception: if cmk.debug.enabled(): raise return []
7 years, 9 months
1
0
0
0
Cleaned up legacy sample config files
by Lars Michelsen
Module: check_mk Branch: master Commit: 6b3adcd42cbc40743fae2e5eb6399a660961852b URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6b3adcd42cbc40…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 16 19:05:32 2016 +0100 Cleaned up legacy sample config files Change-Id: Ied70a59e78d0957f22db44737abce8efbcf51d03 --- Makefile | 4 -- main.mk | 3 -- multisite.mk | 112 ------------------------------------------------------- scripts/setup.sh | 5 ++- 4 files changed, 4 insertions(+), 120 deletions(-) diff --git a/Makefile b/Makefile index 36b142a..ff34b46 100644 --- a/Makefile +++ b/Makefile @@ -130,10 +130,6 @@ dist: mk-livestatus gzip $(DISTNAME)/doc.tar tar czf $(DISTNAME)/modules.tar.gz $(TAROPTS) -C modules $$(cd modules ; ls *.py) - cp main.mk main.mk-$(VERSION) - cp multisite.mk multisite.mk-$(VERSION) - tar czf $(DISTNAME)/conf.tar.gz $(TAROPTS) main.mk-$(VERSION) multisite.mk-$(VERSION) - rm -f main.mk-$(VERSION) multisite.mk-$(VERSION) tar czf $(DISTNAME)/agents.tar.gz $(TAROPTS) -C agents \ --exclude "msibuild" \ --exclude "build_version" \ diff --git a/main.mk b/main.mk deleted file mode 100644 index ecd627c..0000000 --- a/main.mk +++ /dev/null @@ -1,3 +0,0 @@ -# Put your host names here -# all_hosts = [ 'localhost' ] -all_hosts = [ ] diff --git a/multisite.mk b/multisite.mk deleted file mode 100644 index 0501d43..0000000 --- a/multisite.mk +++ /dev/null @@ -1,112 +0,0 @@ -# Confguration for Check_MK Multisite - -# Users with unrestricted permissions. These users will always -# have the permissions to edit users, roles and permissions, -# even if configuration has been edited via WATO -admin_users = [ "nagiosadmin" ] - -# NagVis -# -# The NagVis-Snapin needs to know the URL to nagvis. -# This is not always /nagvis/ - especially not for OMD -nagvis_base_url = '/nagvis' - -# Views allow to play alarm sounds according to the -# "worst" state of the shown items. Enable sounds here: -# enable_sounds = True - -# You can configure here which sounds to play. Possible events are "critical", -# "warning", "unknown", "ok", "up", "down", "unreachable" and -# "pending". Sounds are expected in the sounds subdirectory -# of htdocs (Default is /usr/share/check_mk/web/htdocs/sounds). The -# following setting is the default: -# sounds = [ -# ( "down", "down.wav" ), -# ( "critical", "critical.wav" ), -# ( "unknown", "unknown.wav" ), -# ( "warning", "warning.wav" ), -# ( None, "ok.wav" ), -# ] - -# Tabs for choosing number of columns refresh -# view_option_refreshes = [ 30, 60, 90, 0 ] -# view_option_columns = [ 1, 2, 3, 4, 5, 6, 8 ] - -# Custom links for "Custom Links" Snapin. Feel free to add your -# own links here. The boolean values True and False determine -# wether the sections are open or closed by default. - -# Links for everyone -custom_links['guest'] = [ - ( "Classical Nagios GUI", "../nagios/", "icon_home.png" ), - ( "Addons", True, [ - ( "PNP4Nagios", "../pnp4nagios/", "icon_pnp.png" ), - ( "NagVis", "../nagvis/", "icon_nagvis.png" ), - ]), -] - -# The members of the role 'user' get the same links as the guests -# but some in addition -custom_links['user'] = custom_links['guest'] + [ - ( "Open Source Components", False, [ - ( "Multisite", "
http://mathias-kettner.de/checkmk_multisite.html
", None, "_blank"), - ( "MK Livestatus", "
http://mathias-kettner.de/checkmk_livestatus.html
", None, "_blank"), - ( "Check_MK", "
http://mathias-kettner.de/check_mk.html
", None, "_blank"), - ( "Nagios", "
http://www.nagios.org/
", None, "_blank"), - ( "PNP4Nagios", "
http://pnp4nagios.org/
", None, "_blank"), - ( "NagVis", "
http://nagvis.org/
", None, "_blank"), - ( "RRDTool", "
http://oss.oetiker.ch/rrdtool/
", None, "_blank"), - ]) -] - -# The admins yet get further links -custom_links['admin'] = custom_links['user'] + [ - ( "Support", False, [ - ( "Mathias Kettner", "
http://mathias-kettner.de/
" ), - ( "Check_MK Mailinglists", "
http://mathias-kettner.de/check_mk_lists.html
" ), - ( "Check_MK Exchange (inofficial)", "
http://exchange.check-mk.org/
", None, "_blank" ), - ( "Monitoring Portal (German)", "
http://monitoring-portal.org
", None, "_blank"), - ]) -] - -# Hide certain views from the sidebar -# hidden_views = [ "hosttiles", "allhosts_mini" ] -# Vice versa: hide all views except these (be carefull, this - -# will also exclude custom views) -# visible_views = [ "allhosts", "searchsvc" ] - -# Load custom style sheet which can override styles defined in check_mk.css -# Put your style sheet into web/htdocs/ -# custom_style_sheet = "my_styles.css" - -# __ ___ _____ ___ -# \ \ / / \|_ _/ _ \ -# \ \ /\ / / _ \ | || | | | -# \ V V / ___ \| || |_| | -# \_/\_/_/ \_\_| \___/ -# -# Check_MK's Web Administration Tool - -# If you do not like WATO, you can disable it: -# wato_enabled = False - -# Host tags to be used in WATO -# wato_host_tags = [ -# ( "os_type", "Operating System", [ -# ( "lnx", "Linux", [ 'tcp' ],), -# ( "win", "Windows", [ 'tcp', 'snmp' ]), -# ( "net", "Network device", [ 'snmp' ]), -# ( "ping", "Other PING-only device", ), -# ]), -# ( "prod", "Productivity", [ -# ( "prod", "Production System" ), -# ( "test", "Test System" ), -# ]), -# ( "bulkwalk", "Bulkwalk (SNMP v2c)", [ -# ( None, "simple walk (SNMP v1)"), -# ( "bulk", "Bulkwalk (SNMP v2c)"), -# ], [ 'snmp' ]), -# -# ] - diff --git a/scripts/setup.sh b/scripts/setup.sh index 1c8ca37..51dc654 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -804,7 +804,10 @@ do chgrp $wwwgroup $DESTDIR$confdir/conf.d/distributed_wato.mk && chmod 664 $DESTDIR$confdir/conf.d/distributed_wato.mk fi && - tar xzf $SRCDIR/conf.tar.gz -C $DESTDIR$confdir && + echo -e "# Main configuration file of Check_MK\nWe highly recommend to use WATO to configure Check_MK these days." \ + > $DESTDIR$confdir/main.mk-$VERSION && + echo -e "# Main configuration file of the Check_MK GUI\nWe highly recommend to use WATO to configure Check_MK these days." \ + > $DESTDIR$confdir/multisite.mk-$VERSION && if [ -e $DESTDIR$confdir/check_mk.cfg -a ! -e $DESTDIR$confdir/main.mk ] ; then mv -v $DESTDIR$confdir/check_mk.cfg $DESTDIR$confdir/main.mk echo "Renamed check_mk.cfg into main.mk."
7 years, 9 months
1
0
0
0
Enabled some more pylint checkers
by Lars Michelsen
Module: check_mk Branch: master Commit: 775635cf9bd960c0d5991e87b2dd7bfadabdb50e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=775635cf9bd960…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Dec 19 07:20:45 2016 +0100 Enabled some more pylint checkers Change-Id: I5b1a2d9d6f5e09cfab9ac3235be6c2ed975a6311 --- tests/conftest.py | 2 +- tests/pylint/pylintrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index d09731b..0fa0fe5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -30,7 +30,7 @@ def add_python_paths(): sys.path.insert(0, cmc_path()) sys.path.insert(0, cmk_path() + "/livestatus/api/python") - print("Import path: %s" % " ".join(sys.path)) + #print("Import path: %s" % " ".join(sys.path)) # Some pre-testing to ensure the developer uses the correct branches in all involved repos diff --git a/tests/pylint/pylintrc b/tests/pylint/pylintrc index 4e28da5..7b87670 100644 --- a/tests/pylint/pylintrc +++ b/tests/pylint/pylintrc @@ -20,7 +20,7 @@ disable=C0111,bad-whitespace,unsubscriptable-object,unsupported-membership-test, # TODO: enable this and prepare code for it! #enable=unused-variable #
https://pylint.readthedocs.io/en/latest/reference_guide/features.html
-enable=unreachable,dangerous-default-value,duplicate-key,using-constant-test,duplicate-except,binary-op-exception,overlapping-except,non-parent-init-called,super-init-not-called,no-init +enable=unreachable,dangerous-default-value,duplicate-key,using-constant-test,duplicate-except,binary-op-exception,overlapping-except,non-parent-init-called,super-init-not-called,no-init,bad-open-mode,redundant-unittest-assert,boolean-datetime,deprecated-method,nonstandard-exception [TYPECHECK] # rrdtool
7 years, 9 months
1
0
0
0
Small progress in cleanups
by Lars Michelsen
Module: check_mk Branch: master Commit: 381b2ed43de2989aeb846eaaa5d5cde1ce0cf0c9 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=381b2ed43de298…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Dec 12 09:02:02 2016 +0100 Small progress in cleanups Change-Id: Ideca96fbdde3c059361fdf9aaf62ed1e21bcdbe1 --- web/htdocs/wato.py | 63 ++++++---- web/htdocs/watolib.py | 332 +++++++++++++++++++++++++++----------------------- 2 files changed, 223 insertions(+), 172 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=381b2ed43d…
7 years, 9 months
1
0
0
0
First restructuring of ruleset related code
by Lars Michelsen
Module: check_mk Branch: master Commit: 8ff380c082a43d8884781445fc21a73e0b1a502f URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8ff380c082a43d…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 9 14:22:11 2016 +0100 First restructuring of ruleset related code --- web/htdocs/wato.py | 729 ++++++++++++-------------------------------------- web/htdocs/watolib.py | 590 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 768 insertions(+), 551 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=8ff380c082…
7 years, 9 months
1
0
0
0
Cleaned up toggle button/form js code a bit
by Lars Michelsen
Module: check_mk Branch: master Commit: 7f550543058e36ee057ef9ab37fc24123c5508e6 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7f550543058e36…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 16 12:07:53 2016 +0100 Cleaned up toggle button/form js code a bit Change-Id: I42cde8a33476c2a08d5e3f83013f57133ba5cf26 --- web/htdocs/js/checkmk.js | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js index 6547286..7663a88 100644 --- a/web/htdocs/js/checkmk.js +++ b/web/htdocs/js/checkmk.js @@ -2369,42 +2369,39 @@ function switch_help(how) } /* Switch filter, commands and painter options */ -function view_toggle_form(oButton, idForm) { - var oForm = document.getElementById(idForm); - if (oForm) { - if (oForm.style.display == "none") { - var display = ""; - var down = "down"; - } - else { - var display = "none"; - var down = "up"; - } +function view_toggle_form(button, form_id) { + var display = "none"; + var down = "up"; + + var form = document.getElementById(form_id); + if (form && form.style.display == "none") { + display = ""; + down = "down"; } // Close all other view forms var alldivs = document.getElementsByClassName('view_form'); for (var i=0; i<alldivs.length; i++) { - if (alldivs[i] != oForm) { + if (alldivs[i] != form) { alldivs[i].style.display = "none"; } } - if (oForm) - oForm.style.display = display; + if (form) + form.style.display = display; // Make other buttons inactive var allbuttons = document.getElementsByClassName('togglebutton'); for (var i=0; i<allbuttons.length; i++) { var b = allbuttons[i]; - if (b != oButton && !has_class(b, "empth") && !has_class(b, "checkbox")) { + if (b != button && !has_class(b, "empth") && !has_class(b, "checkbox")) { remove_class(b, "down") add_class(b, "up") } } - remove_class(oButton, "down"); - remove_class(oButton, "up"); - add_class(oButton, down); + remove_class(button, "down"); + remove_class(button, "up"); + add_class(button, down); } function wheel_event_name()
7 years, 9 months
1
0
0
0
Moved togglebutton to html.toggle_button
by Lars Michelsen
Module: check_mk Branch: master Commit: 9a3f48ff8e8c1d46827b14af6db43e30d48367ea URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9a3f48ff8e8c1d…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Thu Dec 15 12:15:37 2016 +0100 Moved togglebutton to html.toggle_button Change-Id: I13e85e3ee3265286771cc1404e2c36492f285ee5 --- web/htdocs/htmllib.py | 26 ++++++++++++++++++++++++++ web/htdocs/views.py | 31 +++++-------------------------- 2 files changed, 31 insertions(+), 26 deletions(-) diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py index 7d34b24..4bb3483 100644 --- a/web/htdocs/htmllib.py +++ b/web/htdocs/htmllib.py @@ -1789,6 +1789,32 @@ class html(DeprecationWrapper): self.add_keybinding([html.F1 + (fkey - 1)], "document.location='%s';" % self._escape_attribute(url)) + # TODO: Refactor the arguments. It is only used in views/wato + def toggle_button(self, id, isopen, icon, help, hidden=False, disabled=False): + self.begin_context_buttons() # TODO: Check all calls. If done before, remove this! + + if disabled: + state = "off" if disabled else "on" + cssclass = "" + help = "" + else: + state = "on" + if isopen: + cssclass = "down" + else: + cssclass = "up" + + self.open_div( + id_="%s_%s" % (id, state), + class_=["togglebutton", state, icon, cssclass], + title=help, + onclick="view_toggle_form(this, '%s');" % id, + style='display:none' if hidden else None, + ) + self.img(src="images/icon_%s.png" % icon) + self.close_div() + + def get_button_counts(self): raise NotImplementedError() diff --git a/web/htdocs/views.py b/web/htdocs/views.py index a4c1cbc..b25de82 100644 --- a/web/htdocs/views.py +++ b/web/htdocs/views.py @@ -2023,27 +2023,6 @@ def ajax_set_viewoption(): po.save_to_config() -def togglebutton(id, isopen, icon, help, hidden=False, disabled=False): - html.begin_context_buttons() # TODO: Check all calls. If done before, remove this! - - if disabled: - state = "off" if disabled else "on" - cssclass = "" - help = "" - else: - state = "on" - if isopen: - cssclass = "down" - else: - cssclass = "up" - - hide = hidden and ' style="display:none"' or '' - html.write('<div id="%s_%s" class="togglebutton %s %s %s" title="%s" ' - 'onclick="view_toggle_form(this, \'%s\');"%s>' - '<img src="images/icon_%s.png"></div>' % \ - (id, state, state, icon, cssclass, help, id, hide, icon)) - - def show_context_links(thisview, show_filters, enable_commands, enable_checkboxes, show_checkboxes, show_availability): @@ -2060,23 +2039,23 @@ def show_context_links(thisview, show_filters, else: icon = "filters" help = _("Set a filter for refining the shown data") - togglebutton("filters", filter_isopen, icon, help, disabled=not show_filters) + html.toggle_button("filters", filter_isopen, icon, help, disabled=not show_filters) if display_options.enabled(display_options.D): - togglebutton("painteroptions", False, "painteroptions", _("Modify display options"), + html.toggle_button("painteroptions", False, "painteroptions", _("Modify display options"), disabled=not painter_options.painter_option_form_enabled()) if display_options.enabled(display_options.C): - togglebutton("commands", False, "commands", _("Execute commands on hosts, services and other objects"), + html.toggle_button("commands", False, "commands", _("Execute commands on hosts, services and other objects"), hidden = not enable_commands) - togglebutton("commands", False, "commands", "", hidden=enable_commands, disabled=True) + html.toggle_button("commands", False, "commands", "", hidden=enable_commands, disabled=True) selection_enabled = (enable_commands and enable_checkboxes) or thisview.get("force_checkboxes") if not thisview.get("force_checkboxes"): toggler("checkbox", "checkbox", _("Enable/Disable checkboxes for selecting rows for commands"), "location.href='%s';" % html.makeuri([('show_checkboxes', show_checkboxes and '0' or '1')]), show_checkboxes, hidden = True) # not selection_enabled) - togglebutton("checkbox", False, "checkbox", "", hidden=not thisview.get("force_checkboxes"), disabled=True) + html.toggle_button("checkbox", False, "checkbox", "", hidden=not thisview.get("force_checkboxes"), disabled=True) html.javascript('g_selection_enabled = %s;' % (selection_enabled and 'true' or 'false')) if display_options.enabled(display_options.O):
7 years, 9 months
1
0
0
0
Use renamed togglebutton function
by Lars Michelsen
Module: check_mk Branch: master Commit: 609868d84321ef4f84df2790626cc3a88f694450 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=609868d84321ef…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 16 12:08:14 2016 +0100 Use renamed togglebutton function Change-Id: Ifc30de4a8f67b71dd6fa317811564a5f2ba8da6e --- web/plugins/views/availability.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py index 7aab6e5..912a6c1 100644 --- a/web/plugins/views/availability.py +++ b/web/plugins/views/availability.py @@ -219,7 +219,7 @@ def render_availability_page(view, datasource, filterheaders, only_sites, limit) if display_options.enabled(display_options.B): html.begin_context_buttons() - togglebutton("avoptions", html.has_user_errors(), "painteroptions", _("Configure details of the report")) + html.toggle_button("avoptions", html.has_user_errors(), "painteroptions", _("Configure details of the report")) html.context_button(_("Status View"), html.makeuri([("mode", "status")]), "status") if config.reporting_available() and config.user.may("general.reporting"): html.context_button(_("Export as PDF"), html.makeuri([], filename="report_instant.py"), "report") @@ -508,7 +508,7 @@ def render_bi_availability(title, aggr_rows): html.body_start(title, stylesheets=["pages","views","status", "bi"], javascripts=['bi']) html.top_heading(title) html.begin_context_buttons() - togglebutton("avoptions", False, "painteroptions", _("Configure details of the report")) + html.toggle_button("avoptions", False, "painteroptions", _("Configure details of the report")) html.context_button(_("Status View"), html.makeuri([("mode", "status")]), "status") if config.reporting_available() and config.user.may("general.reporting"): html.context_button(_("Export as PDF"), html.makeuri([], filename="report_instant.py"), "report")
7 years, 9 months
1
0
0
0
new wato rule search started
by Lars Michelsen
Module: check_mk Branch: master Commit: e768621ea0da861bb166e6199634bd528d416ffa URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e768621ea0da86…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Fri Dec 16 16:14:52 2016 +0100 new wato rule search started Change-Id: Ia4002a61351e642d3d1e995285327aba93657c29 --- web/htdocs/wato.py | 218 +++++++++++++++++++++++++++++++++++++++++--------- web/htdocs/watolib.py | 119 +++++++++++++++++++++++++++ 2 files changed, 297 insertions(+), 40 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=e768621ea0…
7 years, 9 months
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
20
...
40
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
Results per page:
10
25
50
100
200