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
January 2019
----- 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
15 participants
490 discussions
Start a n
N
ew thread
agent_aws: Allow choosing specific buckets and fetch tagging information for S3 services
by Simon Betz
Module: check_mk Branch: master Commit: e828341d1b706b88a0d5774976be44f58ecef680 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e828341d1b706b…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jan 28 08:26:19 2019 +0100 agent_aws: Allow choosing specific buckets and fetch tagging information for S3 services Change-Id: Ie4be4185bf4216310c31751d185602e7d9f560ae --- agents/special/agent_aws | 51 ++++++++++++++++++++--------- checks/agent_aws | 10 ++++++ checks/aws_s3 | 10 +++--- cmk/gui/plugins/wato/datasource_programs.py | 15 +++++++-- tests/unit/checks/test_agent_aws.py | 11 ++++++- 5 files changed, 73 insertions(+), 24 deletions(-) diff --git a/agents/special/agent_aws b/agents/special/agent_aws index 6f0913d..08eb0e3 100755 --- a/agents/special/agent_aws +++ b/agents/special/agent_aws @@ -441,6 +441,20 @@ class EC2(AWSSectionCloudwatch): class S3(AWSSectionGeneric): + def __init__(self, client, distributor=None, buckets=None): + super(S3, self).__init__(client, distributor=distributor) + self._buckets = self._determine_buckets(buckets) + + def _determine_buckets(self, buckets): + if buckets: + return [{"Name": b} for b in buckets] + response = self._client.list_buckets() + try: + return response['Buckets'] + except KeyError as e: + logging.info("%s: KeyError %s; Available are %s", self.name, e, response.keys()) + return [] + @property def name(self): return "s3" @@ -450,15 +464,8 @@ class S3(AWSSectionGeneric): return 86400 def _extract_content_from_raw_result(self): - response = self._client.list_buckets() - try: - buckets = response['Buckets'] - except KeyError as e: - logging.info("%s: KeyError %s; Available are %s", self.name, e, response.keys()) - return [] - paginator = self._client.get_paginator('list_objects') - for bucket in buckets: + for bucket in self._buckets: bucket_name = bucket['Name'] response = self._client.get_bucket_location(Bucket=bucket_name) try: @@ -469,6 +476,18 @@ class S3(AWSSectionGeneric): else: bucket['LocationConstraint'] = location + try: + response = self._client.get_bucket_tagging(Bucket=bucket_name) + tagging = response['TagSet'] + except botocore.exceptions.ClientError as e: + # If there are no tags attached to a bucket we receive a 'ClientError' + logging.info("%s/%s: No tags set, %s", self.name, bucket_name, e) + except KeyError as e: + logging.info("%s/%s: KeyError %s; Available are %s", self.name, bucket_name, e, + response.keys()) + else: + bucket['Tagging'] = tagging + contents = [] pages = paginator.paginate(Bucket=bucket_name) for page in pages: @@ -480,7 +499,7 @@ class S3(AWSSectionGeneric): else: contents += objects bucket['Contents'] = contents - return buckets + return self._buckets def _format_content(self, content): return [AWSSectionResult("", content)] @@ -958,20 +977,24 @@ class AWSSectionsUSEast(AWSSections): def init_sections(self, **kwargs): #---clients--------------------------------------------------------- ce_client = self._init_client('ce') + s3_client = self._init_client('s3') #---sections-------------------------------------------------------- ce = CostsAndUsage(ce_client) + s3 = S3(s3_client, buckets=kwargs.get('buckets')) #---register sections for execution--------------------------------- if 'ce' in self._services: self._sections.append(ce) + if 's3' in self._services: + self._sections.append(s3) + class AWSSectionsGeneric(AWSSections): def init_sections(self, **kwargs): #---clients--------------------------------------------------------- ec2_client = self._init_client('ec2') - s3_client = self._init_client('s3') elb_client = self._init_client('elb') cloudtrail_client = self._init_client('cloudtrail') glacier_client = self._init_client('glacier') @@ -990,7 +1013,6 @@ class AWSSectionsGeneric(AWSSections): elb_summary = ELBSummary(elb_client, elb_summary_distributor) #---sections-------------------------------------------------------- - s3 = S3(s3_client) elb_health = ELBHealth(elb_client) cloudtrail = CloudTrail(cloudtrail_client) glacier = Glacier(glacier_client) @@ -1040,10 +1062,6 @@ class AWSSectionsGeneric(AWSSections): self._sections.append(elb_health) self._sections.append(elb) - # No dependencies - if 's3' in self._services: - self._sections.append(s3) - if 'cloudtrail' in self._services: self._sections.append(cloudtrail) @@ -1112,6 +1130,7 @@ def parse_arguments(argv): nargs='+', required=True, help="Services to monitor:\n%s" % "\n".join(["%-15s %s" % e for e in AWSServices])) + parser.add_argument('--buckets', nargs='+', help="Buckets to monitor") parser.add_argument( "--no-cache", action="store_true", help="Execute all sections, do not rely on cached data.") parser.add_argument("--hostname", required=True) @@ -1153,7 +1172,7 @@ def main(args=None): try: session = create_session(access_key_id, secret_access_key, "us-east-1") aws_sections_us_east = AWSSectionsUSEast(hostname, session, services) - aws_sections_us_east.init_sections() + aws_sections_us_east.init_sections(buckets=args.buckets) aws_sections_us_east.run(use_cache=use_cache) except Exception as e: if args.debug: diff --git a/checks/agent_aws b/checks/agent_aws index 6904ada..01b7171 100644 --- a/checks/agent_aws +++ b/checks/agent_aws @@ -42,6 +42,16 @@ def agent_aws_arguments(params, hostname, ipaddress): # in order to create reliable tests args += sorted(services.keys()) + # {'s3': {'buckets': 'all'} already handled by services.keys() + # {'s3': {'buckets', ('buckets', ['cmk-dev', 'foo'])}} + try: + _, buckets = services.get('s3', {}).get('buckets') + except (TypeError, ValueError): + pass + else: + args.append("--buckets") + args += buckets + args += [ "--hostname", hostname, diff --git a/checks/aws_s3 b/checks/aws_s3 index 9381d6c..8a8e287 100644 --- a/checks/aws_s3 +++ b/checks/aws_s3 @@ -51,8 +51,7 @@ def check_aws_s3_summary(item, params, parsed): if not region: region = "unknown" buckets_by_region.setdefault(region, []).append(row) - long_output.append("Bucket: %s, Region: %s, Creation date: %s"\ - % (bucket_name, region, row['CreationDate'])) + long_output.append("Bucket: %s, Region: %s" % (bucket_name, region)) for region, buckets in buckets_by_region.iteritems(): yield 0, "%s: %s" % (region, len(buckets)) @@ -93,9 +92,10 @@ def check_aws_s3_objects(item, params, metrics): if size >= largest_size: largest = row['Key'] largest_size = size - yield 0, 'Number of object: %s' % num_objects - yield 0, 'Size: %s' % get_bytes_human_readable(sum_size) - yield 0, 'Largest: %s, %s' % (largest, get_bytes_human_readable(largest_size)) + yield 0, 'Bucket size: %s' % get_bytes_human_readable(sum_size) + yield 0, 'Number of objects: %s' % num_objects + if largest: + yield 0, 'Largest object: %s, %s' % (largest, get_bytes_human_readable(largest_size)) check_info['aws_s3.objects'] = { diff --git a/cmk/gui/plugins/wato/datasource_programs.py b/cmk/gui/plugins/wato/datasource_programs.py index 7c5eeaf..1ab244f 100644 --- a/cmk/gui/plugins/wato/datasource_programs.py +++ b/cmk/gui/plugins/wato/datasource_programs.py @@ -1852,8 +1852,19 @@ class RulespecSpecialAgentsAws(HostRulespec): None, totext="", title=_("Elastic Compute Cloud (EC2)"))), ("ebs", FixedValue( None, totext="", title=_("Elastic Block Storage (EBS)"))), - ("s3", FixedValue(None, totext="", - title=_("Simple Storage Service (S3)"))), + ("s3", + Dictionary( + title=_("Simple Storage Service (S3)"), + elements=[('buckets', + CascadingDropdown( + title=_("Buckets"), + choices=[ + ('all', _("All buckets")), + ('buckets', _("Specific buckets"), + ListOfStrings()), + ]))], + optional_keys=[], + )), ], )), ], diff --git a/tests/unit/checks/test_agent_aws.py b/tests/unit/checks/test_agent_aws.py index 030b7f2..a5f907d 100644 --- a/tests/unit/checks/test_agent_aws.py +++ b/tests/unit/checks/test_agent_aws.py @@ -12,10 +12,19 @@ import pytest "--aws-access-key-id": "user", "--aws-secret-access-key": "d1ng", "--regions": ['region-eu'], - "--services": {'ec2': None, 's3': None}, + "--services": {'ec2': None, 's3': {'buckets': 'all'}}, }, [ '--aws-access-key-id', 'user', '--aws-secret-access-key', 'd1ng', '--regions', 'region-eu', '--services', 'ec2', 's3', '--hostname', 'host' +]),({ + "--aws-access-key-id": "user", + "--aws-secret-access-key": "d1ng", + "--regions": ['region-eu'], + "--services": {'ec2': None, 's3': {'buckets': ('buckets', ['A', 'B'])}}, +}, [ + '--aws-access-key-id', 'user', '--aws-secret-access-key', 'd1ng', + '--regions', 'region-eu', '--services', 'ec2', 's3', '--buckets', 'A', 'B', + '--hostname', 'host' ])]) def test_aws(check_manager, params, result): agent = check_manager.get_special_agent("agent_aws")
5 years, 8 months
1
0
0
0
agent_aws: Refactored WATO configuration which is more flexible
by Simon Betz
Module: check_mk Branch: master Commit: f67a2d22e67ce33a538897d7930f536127b16f27 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f67a2d22e67ce3…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Mon Jan 28 08:40:24 2019 +0100 agent_aws: Refactored WATO configuration which is more flexible Change-Id: Ibed9164c00b3505e8f8b28641e3dafce8ebbf7ca --- agents/special/agent_aws | 2 +- checks/agent_aws | 10 ++++++++-- cmk/gui/plugins/wato/datasource_programs.py | 27 +++++++++++++-------------- tests/unit/checks/test_agent_aws.py | 13 ++++++++++--- 4 files changed, 32 insertions(+), 20 deletions(-) diff --git a/agents/special/agent_aws b/agents/special/agent_aws index 289c32e..6f0913d 100755 --- a/agents/special/agent_aws +++ b/agents/special/agent_aws @@ -440,7 +440,7 @@ class EC2(AWSSectionCloudwatch): # '----------------------------------------------------------------------' -class S3(AWSSection): +class S3(AWSSectionGeneric): @property def name(self): return "s3" diff --git a/checks/agent_aws b/checks/agent_aws index bbe29f6..6904ada 100644 --- a/checks/agent_aws +++ b/checks/agent_aws @@ -34,8 +34,14 @@ def agent_aws_arguments(params, hostname, ipaddress): ] args.append("--regions") args += params["--regions"] - args.append("--services") - args += params["--services"] + + services = params.get("--services", {}) + if services: + args.append("--services") + # We need to sort the inner services-as-a-dict-params + # in order to create reliable tests + args += sorted(services.keys()) + args += [ "--hostname", hostname, diff --git a/cmk/gui/plugins/wato/datasource_programs.py b/cmk/gui/plugins/wato/datasource_programs.py index f6ee56a..7c5eeaf 100644 --- a/cmk/gui/plugins/wato/datasource_programs.py +++ b/cmk/gui/plugins/wato/datasource_programs.py @@ -1843,20 +1843,19 @@ class RulespecSpecialAgentsAws(HostRulespec): ], key=lambda x: x[1]), )), - ( - "--services", - ListChoice( - title=_("Services to monitor"), - choices=[ - ("ce", _("Costs and usage")), - ("ec2", _("Elastic Compute Cloud (EC2)")), - ("ebs", _("Elastic Block Storage (EBS)")), - ("s3", _("Simple Storage Service (S3)")), - #("elb", _("Elastic Load Balancing (ELB)")), - #("cloudtrail", _("")), - #("glacier", _("")), - ], - )), + ("--services", + Dictionary( + title=_("Services to monitor"), + elements=[ + ("ce", FixedValue(None, totext="", title=_("Costs and usage"))), + ("ec2", FixedValue( + None, totext="", title=_("Elastic Compute Cloud (EC2)"))), + ("ebs", FixedValue( + None, totext="", title=_("Elastic Block Storage (EBS)"))), + ("s3", FixedValue(None, totext="", + title=_("Simple Storage Service (S3)"))), + ], + )), ], optional_keys=[], ) diff --git a/tests/unit/checks/test_agent_aws.py b/tests/unit/checks/test_agent_aws.py index b85c6fe..030b7f2 100644 --- a/tests/unit/checks/test_agent_aws.py +++ b/tests/unit/checks/test_agent_aws.py @@ -5,10 +5,17 @@ import pytest "--aws-access-key-id": "user", "--aws-secret-access-key": "d1ng", "--regions": ['region-eu'], - "--services": ['ec2', 'ebs'], }, [ - '--aws-access-key-id', 'user', '--aws-secret-access-key', 'd1ng', '--regions', 'region-eu', - '--services', 'ec2', 'ebs', '--hostname', 'host' + '--aws-access-key-id', 'user', '--aws-secret-access-key', 'd1ng', + '--regions', 'region-eu', '--hostname', 'host' +]), ({ + "--aws-access-key-id": "user", + "--aws-secret-access-key": "d1ng", + "--regions": ['region-eu'], + "--services": {'ec2': None, 's3': None}, +}, [ + '--aws-access-key-id', 'user', '--aws-secret-access-key', 'd1ng', + '--regions', 'region-eu', '--services', 'ec2', 's3', '--hostname', 'host' ])]) def test_aws(check_manager, params, result): agent = check_manager.get_special_agent("agent_aws")
5 years, 8 months
1
0
0
0
CMK-1549 Docker containers to build on all supported Centos distros
by Alex Zurhake
Module: check_mk Branch: master Commit: 411ad81f3c4c0dc51340a341eb0af26aacd9a7f2 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=411ad81f3c4c0d…
Author: Alex Zurhake <az(a)mathias-kettner.de> Date: Thu Jan 24 10:48:03 2019 +0100 CMK-1549 Docker containers to build on all supported Centos distros Change-Id: I83142620a532902c16b95094c5452ec3d638d8b4 --- .../infrastructure/build-nodes/centos-6/Dockerfile | 83 +++++++++------------- .../infrastructure/build-nodes/centos-7/Dockerfile | 63 ++++++++++++++++ 2 files changed, 96 insertions(+), 50 deletions(-) diff --git a/buildscripts/infrastructure/build-nodes/centos-6/Dockerfile b/buildscripts/infrastructure/build-nodes/centos-6/Dockerfile index 283940f..9c301fb 100644 --- a/buildscripts/infrastructure/build-nodes/centos-6/Dockerfile +++ b/buildscripts/infrastructure/build-nodes/centos-6/Dockerfile @@ -3,77 +3,60 @@ FROM centos:6 SHELL ["/bin/bash", "-c"] RUN yum -y makecache \ - \ && yum -y install \ + bind-utils \ boost-devel \ + centos-release-scl \ + compat-readline5 \ curl-devel \ expat-devel \ - bind-utils \ + flex \ + freeradius-devel \ gcc \ gcc-c++ \ - libevent-devel \ - libtool-ltdl-devel \ - libtool-ltdl \ gd-devel \ + gettext \ + git \ + groff \ + httpd-devel \ libXpm-devel \ + libevent-devel \ + libffi-devel \ + libgsf-devel \ libjpeg-devel \ - httpd-devel \ libmcrypt-devel \ + libpcap-devel \ + libtool-ltdl \ + libtool-ltdl-devel \ + libuuid-devel \ libxml2-devel \ - sqlite-devel \ - tk-devel \ mysql-devel \ - postgresql-devel \ ncurses-devel \ + openssh-clients \ openssl-devel \ pango-devel \ - pcre-devel \ patch \ + pcre-devel \ + pcre-devel \ + perl-ExtUtils-Embed \ + perl-Time-HiRes \ + perl-devel \ php \ + postgresql-devel \ readline-devel \ - compat-readline5 \ + rpcbind \ rpm-build \ + rrdtool-devel \ + rsync \ samba-client \ - rpcbind \ - libuuid-devel \ + sqlite-devel \ + texinfo \ + tk-devel \ which \ - perl-devel \ - perl-ExtUtils-Embed \ - perl-Time-HiRes \ - rsync \ - freeradius-devel \ - groff \ - pcre-devel \ - libpcap-devel \ - gettext \ - libgsf-devel \ - rrdtool-devel \ - libffi-devel \ - flex \ - openssh-clients \ - git \ - && yum clean all - -RUN yum -y makecache \ - \ - && yum -y install \ wget \ + && yum -y install devtoolset-7 \ && yum clean all -COPY bw-build-gnu-toolchain /usr/sbin -# Nasty, nasty workaround... -# This will be moved to a jenkinsfile to build containers -# to avoid cloning and packing the binutils too often -RUN cd /tmp/build-gcc-toolchain/ \ - && git clone
git://sourceware.org/git/binutils-gdb.git
\ - && cd binutils-gdb \ - && git reset --hard bb27775165d9b992120371383012404e213b1981 \ - && git clean -dfX \ - && ./src-release.sh -x binutils \ - && cd .. \ - && ln -s binutils-gdb/binutils-2.31.51.tar.xz binutils-2.31.1.tar.xz - -RUN bw-build-gnu-toolchain -RUN mv /usr/bin/gcc /usr/bin/gcc-4 \ - && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ - && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN source scl_source enable devtoolset-7 \ + && bw-build-gnu-toolchain.sh -b diff --git a/buildscripts/infrastructure/build-nodes/centos-7/Dockerfile b/buildscripts/infrastructure/build-nodes/centos-7/Dockerfile new file mode 100644 index 0000000..1fbd2f6 --- /dev/null +++ b/buildscripts/infrastructure/build-nodes/centos-7/Dockerfile @@ -0,0 +1,63 @@ +FROM centos:7 + +SHELL ["/bin/bash", "-c"] + +RUN yum -y makecache \ + && yum -y install \ + bind-utils \ + boost-devel \ + curl-devel \ + expat-devel \ + flex \ + flex-devel \ + freeradius-devel \ + gcc \ + gcc-c++ \ + gd-devel \ + gettext \ + groff \ + httpd-devel \ + libXpm-devel \ + libdbi-devel \ + libevent-devel \ + libffi-devel \ + libgsf-devel \ + libjpeg-devel \ + libmcrypt-devel \ + libpcap-devel \ + libtool-ltdl \ + libtool-ltdl-devel \ + libuuid-devel \ + libxml2-devel \ + mariadb-devel \ + ncurses-devel \ + openssh-clients \ + openssl-devel \ + pango-devel \ + patch \ + pcre-devel \ + perl-ExtUtils-Embed \ + perl-IO-Zlib \ + perl-Locale-Maketext-Simple \ + perl-Time-HiRes \ + perl-devel \ + php \ + postgresql-devel \ + readline-devel \ + rpcbind \ + rpm-build \ + rrdtool-devel \ + rsync \ + samba-client \ + sqlite-devel \ + texinfo \ + tk-devel \ + wget \ + which \ + && yum clean all + +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-4 \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc
5 years, 8 months
1
0
0
0
CMK-1547 Docker Container zum bauen auf allen supporteten Ubuntu Distros
by Alex Zurhake
Module: check_mk Branch: master Commit: 4de744ae110f665e58474a9d6709e078b6220b3e URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4de744ae110f66…
Author: Alex Zurhake <az(a)mathias-kettner.de> Date: Thu Jan 24 08:14:21 2019 +0100 CMK-1547 Docker Container zum bauen auf allen supporteten Ubuntu Distros Change-Id: I8230bc5d4eca65437c6b3565754b903c0595b058 --- .../build-nodes/ubuntu-14.04/Dockerfile | 54 ++++++++++++++++++++ .../build-nodes/ubuntu-16.04/Dockerfile | 57 +++++++++++++++++++++ .../build-nodes/ubuntu-17.10/Dockerfile | 58 ++++++++++++++++++++++ .../build-nodes/ubuntu-18.04/Dockerfile | 47 ++++++------------ .../build-nodes/ubuntu-18.10/Dockerfile | 58 ++++++++++++++++++++++ 5 files changed, 241 insertions(+), 33 deletions(-) diff --git a/buildscripts/infrastructure/build-nodes/ubuntu-14.04/Dockerfile b/buildscripts/infrastructure/build-nodes/ubuntu-14.04/Dockerfile new file mode 100644 index 0000000..fd388ea --- /dev/null +++ b/buildscripts/infrastructure/build-nodes/ubuntu-14.04/Dockerfile @@ -0,0 +1,54 @@ +FROM ubuntu:14.04 + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y \ + apache2 \ + apache2-threaded-dev \ + build-essential \ + dietlibc-dev \ + dnsutils \ + dpatch \ + flex \ + gettext \ + git-buildpackage \ + libboost-all-dev \ + libcloog-ppl1 \ + libcurl4-openssl-dev \ + libevent-dev \ + libffi-dev \ + libgd2-xpm-dev \ + libglib2.0-dev \ + libgnutls-dev \ + libgsf-1-dev \ + libldap2-dev \ + libltdl-dev \ + libmcrypt-dev \ + libmysqlclient15-dev \ + libncurses5-dev \ + libpango1.0-dev \ + libpcap-dev \ + libperl-dev \ + libpq-dev \ + libradiusclient-ng-dev \ + libreadline-dev \ + librrd-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + openssh-client \ + patch \ + rpcbind \ + smbclient \ + texinfo \ + tk-dev \ + uuid-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-old \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc diff --git a/buildscripts/infrastructure/build-nodes/ubuntu-16.04/Dockerfile b/buildscripts/infrastructure/build-nodes/ubuntu-16.04/Dockerfile new file mode 100644 index 0000000..9df9c77 --- /dev/null +++ b/buildscripts/infrastructure/build-nodes/ubuntu-16.04/Dockerfile @@ -0,0 +1,57 @@ +FROM ubuntu:16.04 + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y \ + apache2 \ + apache2-dev \ + autoconf \ + build-essential \ + devscripts \ + dnsutils \ + dpatch \ + flex \ + gettext \ + git-buildpackage \ + libboost-all-dev \ + libcloog-ppl1 \ + libcurl4-openssl-dev \ + libevent-dev \ + libffi-dev \ + libfreeradius-dev \ + libgd-dev \ + libglib2.0-dev \ + libgnutls-dev \ + libgsf-1-dev \ + libldap2-dev \ + libltdl-dev \ + libmcrypt-dev \ + libmysqlclient-dev \ + libncurses5-dev \ + libpango1.0-dev \ + libpcap-dev \ + libperl-dev \ + libpq-dev \ + libreadline-dev \ + librrd-dev \ + libsqlite3-dev \ + libssl-dev \ + libtool \ + libxml2-dev \ + openssh-client \ + patch \ + rpcbind \ + rsync \ + smbclient \ + texinfo \ + tk-dev \ + uuid-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-old \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc diff --git a/buildscripts/infrastructure/build-nodes/ubuntu-17.10/Dockerfile b/buildscripts/infrastructure/build-nodes/ubuntu-17.10/Dockerfile new file mode 100644 index 0000000..53ba775 --- /dev/null +++ b/buildscripts/infrastructure/build-nodes/ubuntu-17.10/Dockerfile @@ -0,0 +1,58 @@ +FROM ubuntu:17.10 + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y \ + apache2 \ + apache2-dev \ + autoconf \ + build-essential \ + devscripts \ + dnsutils \ + dpatch \ + flex \ + gettext \ + git-buildpackage \ + libboost-all-dev \ + libcloog-ppl1 \ + libcurl4-openssl-dev \ + libevent-dev \ + libffi-dev \ + libfreeradius-dev \ + libgd-dev \ + libglib2.0-dev \ + libgnutls28-dev \ + libgsf-1-dev \ + libkrb5-dev \ + libldap2-dev \ + libltdl-dev \ + libmcrypt-dev \ + libmysqlclient-dev \ + libncurses5-dev \ + libpango1.0-dev \ + libpcap-dev \ + libperl-dev \ + libpq-dev \ + libreadline-dev \ + librrd-dev \ + libsqlite3-dev \ + libssl-dev \ + libtool \ + libxml2-dev \ + openssh-client \ + patch \ + rpcbind \ + rsync \ + smbclient \ + texinfo \ + tk-dev \ + uuid-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-old \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc diff --git a/buildscripts/infrastructure/build-nodes/ubuntu-18.04/Dockerfile b/buildscripts/infrastructure/build-nodes/ubuntu-18.04/Dockerfile index 93d324c..937f33a 100644 --- a/buildscripts/infrastructure/build-nodes/ubuntu-18.04/Dockerfile +++ b/buildscripts/infrastructure/build-nodes/ubuntu-18.04/Dockerfile @@ -8,28 +8,14 @@ RUN apt-get update \ apache2 \ apache2-dev \ autoconf \ - bear \ build-essential \ - chrpath \ - clang-6.0 \ - clang-format-6.0 \ - clang-tidy-6.0 \ devscripts \ - direnv \ dnsutils \ - doxygen \ dpatch \ - enchant \ - figlet \ flex \ - g++-8 \ gettext \ git-buildpackage \ - ksh \ libboost-all-dev \ - libboost-dev \ - libboost-system-dev \ - libclang-6.0-dev \ libcloog-ppl1 \ libcurl4-openssl-dev \ libevent-dev \ @@ -51,38 +37,33 @@ RUN apt-get update \ libpq-dev \ libreadline-dev \ librrd-dev \ - libsasl2-dev \ libsqlite3-dev \ libssl-dev \ libtool \ libxml2-dev \ - llvm-6.0-dev \ openssh-client \ - p7zip-full \ patch \ - pngcrush \ - poedit \ - python-pip \ - python-polib \ rpcbind \ rsync \ - slimit \ smbclient \ + texinfo \ tk-dev \ uuid-dev \ - valgrind \ && rm -rf /var/lib/apt/lists/* # For the common part, split later -RUN pip install pathlib2 \ - typing +#RUN pip install pathlib2 \ +# typing -RUN apt-get update \ - && apt-get install -y \ - rpm \ - alien \ - mono-xbuild \ - && rm -rf /var/lib/apt/lists/* +#RUN apt-get update \ +# && apt-get install -y \ +# rpm \ +# alien \ +# mono-xbuild \ +# && rm -rf /var/lib/apt/lists/* -COPY bw-build-gnu-toolchain /usr/sbin -RUN bw-build-gnu-toolchain +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-old \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc diff --git a/buildscripts/infrastructure/build-nodes/ubuntu-18.10/Dockerfile b/buildscripts/infrastructure/build-nodes/ubuntu-18.10/Dockerfile new file mode 100644 index 0000000..3897b56 --- /dev/null +++ b/buildscripts/infrastructure/build-nodes/ubuntu-18.10/Dockerfile @@ -0,0 +1,58 @@ +FROM ubuntu:18.10 + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y \ + apache2 \ + apache2-dev \ + autoconf \ + build-essential \ + devscripts \ + dnsutils \ + dpatch \ + flex \ + gettext \ + git-buildpackage \ + libboost-all-dev \ + libcloog-ppl1 \ + libcurl4-openssl-dev \ + libevent-dev \ + libffi-dev \ + libfreeradius-dev \ + libgd-dev \ + libglib2.0-dev \ + libgnutls28-dev \ + libgsf-1-dev \ + libkrb5-dev \ + libldap2-dev \ + libltdl-dev \ + libmcrypt-dev \ + libmysqlclient-dev \ + libncurses5-dev \ + libpango1.0-dev \ + libpcap-dev \ + libperl-dev \ + libpq-dev \ + libreadline-dev \ + librrd-dev \ + libsqlite3-dev \ + libssl-dev \ + libtool \ + libxml2-dev \ + openssh-client \ + patch \ + rpcbind \ + rsync \ + smbclient \ + texinfo \ + tk-dev \ + uuid-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-old \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc
5 years, 8 months
1
0
0
0
CMK-1469 Docker containers to build on all supported Debian distros
by Alex Zurhake
Module: check_mk Branch: master Commit: fac5d1251426b31a6d7409c596dd6db2205d4ebc URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fac5d1251426b3…
Author: Alex Zurhake <az(a)mathias-kettner.de> Date: Thu Jan 24 09:29:54 2019 +0100 CMK-1469 Docker containers to build on all supported Debian distros Change-Id: I3c0cbcd4bb75b2d988f6851e00ea32831528bc87 --- .../infrastructure/build-nodes/debian-8/Dockerfile | 55 +++++++++++++++++++++ .../infrastructure/build-nodes/debian-9/Dockerfile | 56 ++++++++++++++++++++++ 2 files changed, 111 insertions(+) diff --git a/buildscripts/infrastructure/build-nodes/debian-8/Dockerfile b/buildscripts/infrastructure/build-nodes/debian-8/Dockerfile new file mode 100644 index 0000000..4495110 --- /dev/null +++ b/buildscripts/infrastructure/build-nodes/debian-8/Dockerfile @@ -0,0 +1,55 @@ +FROM debian:8 + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y \ + apache2 \ + apache2-threaded-dev \ + build-essential \ + dietlibc-dev \ + dnsutils \ + dpatch \ + flex \ + gettext \ + git-buildpackage \ + libboost-all-dev \ + libcloog-ppl1 \ + libcurl4-openssl-dev \ + libdbi-dev \ + libevent-dev \ + libffi-dev \ + libfreeradius-client-dev \ + libgd-dev \ + libglib2.0-dev \ + libgnutls28-dev \ + libgsf-1-dev \ + libldap2-dev \ + libltdl-dev \ + libmcrypt-dev \ + libmysqlclient15-dev \ + libncurses5-dev \ + libpango1.0-dev \ + libpcap-dev \ + libperl-dev \ + libpq-dev \ + libreadline6-dev \ + librrd-dev \ + libsqlite3-dev \ + libssl-dev \ + libxml2-dev \ + openssh-client \ + patch \ + rpcbind \ + smbclient \ + texinfo \ + tk-dev \ + uuid-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-old \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc diff --git a/buildscripts/infrastructure/build-nodes/debian-9/Dockerfile b/buildscripts/infrastructure/build-nodes/debian-9/Dockerfile new file mode 100644 index 0000000..03d8af6 --- /dev/null +++ b/buildscripts/infrastructure/build-nodes/debian-9/Dockerfile @@ -0,0 +1,56 @@ +FROM debian:9 + +SHELL ["/bin/bash", "-c"] +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y \ + apache2 \ + apache2-dev \ + build-essential \ + default-libmysqlclient-dev \ + dietlibc-dev \ + dnsutils \ + dpatch \ + flex \ + gettext \ + git-buildpackage \ + libboost-all-dev \ + libcloog-ppl1 \ + libcurl4-openssl-dev \ + libdbi-dev \ + libevent-dev \ + libffi-dev \ + libfreeradius-dev \ + libgd-dev \ + libglib2.0-dev \ + libgnutls28-dev \ + libgsf-1-dev \ + libkrb5-dev \ + libldap2-dev \ + libltdl-dev \ + libmcrypt-dev \ + libncurses5-dev \ + libpango1.0-dev \ + libpcap-dev \ + libperl-dev \ + libpq-dev \ + libreadline-dev \ + librrd-dev \ + libsqlite3-dev \ + libssl1.0-dev \ + libxml2-dev \ + openssh-client \ + patch \ + rpcbind \ + smbclient \ + texinfo \ + tk-dev \ + uuid-dev \ + && rm -rf /var/lib/apt/lists/* + +COPY bw-build-gnu-toolchain.sh /usr/sbin +RUN bw-build-gnu-toolchain.sh -b +RUN mv /usr/bin/gcc /usr/bin/gcc-old \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/gcc \ + && ln -s /usr/local/bin/gcc-8 /usr/local/bin/cc
5 years, 8 months
1
0
0
0
azure: Smoothen configuration of azure agent
by Moritz Kiemer
Module: check_mk Branch: master Commit: 9c5fa114a2d4b819f8c7277c4c0b85e065e91562 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9c5fa114a2d4b8…
Author: Moritz Kiemer <mo(a)mathias-kettner.de> Date: Fri Jan 25 08:29:22 2019 +0100 azure: Smoothen configuration of azure agent * reduce VM piggyback options * simplify group configuration * improve titles Change-Id: I8f1eca438ba8112e38342a3077c41d84b23e4115 --- agents/special/agent_azure | 60 ++++--------- checks/agent_azure | 20 ++--- cmk/gui/plugins/wato/check_parameters/azure.py | 4 +- cmk/gui/plugins/wato/datasource_programs.py | 118 +++++++++---------------- tests/unit/cmk/gui/watolib/test_rulespecs.py | 8 +- 5 files changed, 71 insertions(+), 139 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=9c5fa114a2…
5 years, 8 months
1
0
0
0
azure: remove '-' from params keys for consistency
by Moritz Kiemer
Module: check_mk Branch: master Commit: 55fe7158429fced04c774008ba7a1f5aaa6f406d URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=55fe7158429fce…
Author: Moritz Kiemer <mo(a)mathias-kettner.de> Date: Fri Jan 25 07:28:28 2019 +0100 azure: remove '-' from params keys for consistency Change-Id: I32417cdda71a0fb4e6fa0fdcb658c88034bafb99 --- agents/special/agent_azure | 16 ++++++++-------- checks/agent_azure | 16 +++++++++------- cmk/gui/plugins/wato/datasource_programs.py | 23 +++++++++++------------ 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/agents/special/agent_azure b/agents/special/agent_azure index c6ba6d3..9c3106d 100755 --- a/agents/special/agent_azure +++ b/agents/special/agent_azure @@ -166,16 +166,16 @@ def parse_arguments(argv): type=int, help='''Timeout for individual processes in seconds (default 10)''') parser.add_argument( - "--piggyback-vms", + "--piggyback_vms", default="", choices=["agenthost", "self", "all"], help='''Additionally create VM piggyback data for the host running the agent, the VM iteself, or both''') # REQUIRED - parser.add_argument("--subscription-id", required=True, help="Azure subscription ID") - parser.add_argument("--client-id", required=True, help="Azure client ID") - parser.add_argument("--tenant-id", required=True, help="Azure tenant ID") + parser.add_argument("--subscription", required=True, help="Azure subscription ID") + parser.add_argument("--client", required=True, help="Azure client ID") + parser.add_argument("--tenant", required=True, help="Azure tenant ID") parser.add_argument("--secret", required=True, help="Azure authentication secret") # CONSTRAIN DATA TO REQUEST parser.add_argument( @@ -468,11 +468,11 @@ class AzureClient(object): # pylint: disable=too-many-instance-attributes self.remaining_reads = "unknown (no metrics fetched)" self._creds = ServicePrincipalCredentials( - client_id=args.client_id, secret=args.secret, tenant=args.tenant_id) + client_id=args.client, secret=args.secret, tenant=args.tenant) # azure-api-call - self._monitor_client = MonitorManagementClient(self._creds, self.args.subscription_id) + self._monitor_client = MonitorManagementClient(self._creds, self.args.subscription) # azure-api-call - self._resource_client = ResourceManagementClient(self._creds, self.args.subscription_id) + self._resource_client = ResourceManagementClient(self._creds, self.args.subscription) self.specific_clients = {} @@ -501,7 +501,7 @@ class AzureClient(object): # pylint: disable=too-many-instance-attributes for rtp in r_types: client_class = AzureClient.SPECIFIC_CLIENTS.get(rtp) if client_class is not None: - self.specific_clients[rtp] = client_class(self._creds, self.args.subscription_id) + self.specific_clients[rtp] = client_class(self._creds, self.args.subscription) def process_specific(self, resource): client = self.specific_clients.get(resource.info["type"]) diff --git a/checks/agent_azure b/checks/agent_azure index a67b86d..4aac3ae 100644 --- a/checks/agent_azure +++ b/checks/agent_azure @@ -24,25 +24,27 @@ # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA. -_FETCHALL = '*' - def agent_azure_arguments(params, _no_hostname, _no_ipaddress): args = [] - opts = (i for i in params.iteritems() if i[0].startswith("--")) - for key, value in opts: + keys = ("subscription", "tenant", "client", "secret", "piggyback_vms", "sequential") + present_keys = (k for k in keys if k in params.keys()) + + for key in present_keys: + option = "--%s" % key + value = params[key] if isinstance(value, bool): if value: - args.append(key) + args.append(option) else: - args += [key, quote_shell_string(value)] + args += [option, quote_shell_string(value)] config = params['config'] if "fetchall" in config: return args - explicit = config.get('explicit-config', []) + explicit = config.get('explicit', []) if explicit: args.append("--explicit-config") for group_dict in explicit: diff --git a/cmk/gui/plugins/wato/datasource_programs.py b/cmk/gui/plugins/wato/datasource_programs.py index d318861..be065d9 100644 --- a/cmk/gui/plugins/wato/datasource_programs.py +++ b/cmk/gui/plugins/wato/datasource_programs.py @@ -1564,25 +1564,24 @@ class RulespecSpecialAgentsAzure(HostRulespec): "service of the host owning the datasource program."), # element names starting with "--" will be passed do cmd line w/o parsing! elements=[ - ("--subscription-id", - TextAscii( - title=_("Subscription ID"), - allow_empty=False, - size=45, - )), - ("--tenant-id", + ("subscription", TextAscii( + title=_("Subscription ID"), + allow_empty=False, + size=45, + )), + ("tenant", TextAscii( title=_("Tenant ID / Directory ID"), allow_empty=False, size=45, )), - ("--client-id", + ("client", TextAscii( title=_("Client ID / Application ID"), allow_empty=False, size=45, )), - ("--secret", Password( + ("secret", Password( title=_("Secret"), allow_empty=False, size=45, @@ -1616,7 +1615,7 @@ class RulespecSpecialAgentsAzure(HostRulespec): )), ], )), - ("--piggyback-vms", + ("piggyback_vms", DropdownChoice( title=_("Create piggyback VM data"), help=_("You can choose to <i>additionally</i> send data concerning VMs to" @@ -1629,14 +1628,14 @@ class RulespecSpecialAgentsAzure(HostRulespec): ("all", _("Send data to both the agent host and the VM itself")), ], )), - ("--sequential", + ("sequential", Checkbox( title=_("Run in single thread"), help=_("Check this to avoid multiprocessing. " "Recommended for debugging purposes only."), )), ], - optional_keys=["--piggyback-vms"], + optional_keys=["piggyback_vms"], ) def _azure_group_config(self):
5 years, 8 months
1
0
0
0
azure_agent_info: create service only for azure host
by Moritz Kiemer
Module: check_mk Branch: master Commit: 703ed1673f03d9a2a27b74ed2b11f063c3edffae URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=703ed1673f03d9…
Author: Moritz Kiemer <mo(a)mathias-kettner.de> Date: Fri Jan 25 10:48:32 2019 +0100 azure_agent_info: create service only for azure host Also make pylint happy. Change-Id: Id89d91a35d2debe7df639ef567af353e2828a21b --- agents/special/agent_azure | 14 ++++++++------ checks/azure_agent_info | 16 ++++++++-------- tests/unit/cmk/gui/watolib/test_rulespecs.py | 1 + 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/agents/special/agent_azure b/agents/special/agent_azure index 9ac8379..b0bad53 100755 --- a/agents/special/agent_azure +++ b/agents/special/agent_azure @@ -311,6 +311,8 @@ class Section(object): return chr(Section.SEP).join(map(str, tokens)) + '\n' def add(self, info): + if not info: + return if isinstance(info[0], (list, tuple)): # we got a list of lines for row in info: self._cont.append(self.formatline(row)) @@ -318,6 +320,8 @@ class Section(object): self._cont.append(self.formatline(info)) def write(self): + if not self._cont: + return self.LOCK.acquire() sys.stdout.writelines(self._head + self._cont + self._foot) sys.stdout.flush() @@ -560,17 +564,15 @@ def process_resource(args): for metric in client.get_metrics(resource, err): resource.metrics.append(metric) - sections = [Section('agent_info')] - sections[0].add(('remaining-reads', client.remaining_reads)) + agent_info_section = Section('agent_info') + agent_info_section.add(('remaining-reads', client.remaining_reads)) + agent_info_section.add(err.dumpinfo()) + sections = [agent_info_section] for piggytarget in resource.piggytargets: section = Section(resource.section, piggytarget) section.add(resource.dumpinfo()) sections.append(section) - if err: - err_section = Section('agent_info', piggytarget) - err_section.add(err.dumpinfo()) - sections.append(err_section) return sections diff --git a/checks/azure_agent_info b/checks/azure_agent_info index dc948d5..1d295db 100644 --- a/checks/azure_agent_info +++ b/checks/azure_agent_info @@ -72,11 +72,11 @@ def parse_azure_agent_info(info): return parsed -def discovery_azure_agent_info(parsed): - yield "Azure Agent Info", {} +def discovery_azure_agent_info(_parsed): + yield None, {} -def check_azure_agent_info(item, params, parsed): +def check_azure_agent_info(_no_item, params, parsed): reads = parsed.get('remaining-reads') # this is only reported for the Datasource Host, so None @@ -98,10 +98,10 @@ def check_azure_agent_info(item, params, parsed): yield 0, "Monitored groups: %s" % ', '.join(groups[0]) issues = parsed.get('issues', {}) - for t in ('warning', 'exception'): - count = len(issues.get(t, ())) - state, txt = 0, "%d %ss" % (count, t) - warn, crit = params.get('%s_levels' % t, (None, None)) + for type_ in ('warning', 'exception'): + count = len(issues.get(type_, ())) + state, txt = 0, "%d %ss" % (count, type_) + warn, crit = params.get('%s_levels' % type_, (None, None)) if crit is not None and count >= crit: state = 2 elif warn is not None and count >= warn: @@ -120,7 +120,7 @@ check_info['azure_agent_info'] = { 'parse_function': parse_azure_agent_info, 'inventory_function': discovery_azure_agent_info, 'check_function': check_azure_agent_info, - 'service_description': "%s", + 'service_description': "Azure Agent Info", 'default_levels_variable': "azure_agent_info_levels", 'has_perfdata': True, 'group': "azure_agent_info", diff --git a/tests/unit/cmk/gui/watolib/test_rulespecs.py b/tests/unit/cmk/gui/watolib/test_rulespecs.py index 5a13678..d321f38 100644 --- a/tests/unit/cmk/gui/watolib/test_rulespecs.py +++ b/tests/unit/cmk/gui/watolib/test_rulespecs.py @@ -22,6 +22,7 @@ from cmk.gui.valuespec import ( from cmk.gui.plugins.wato.utils import register_check_parameters + def test_rulespec_sub_group(): class TestGroup(RulespecGroup): @property
5 years, 8 months
1
0
0
0
agent_aws: Remove duplicate code
by Simon Betz
Module: check_mk Branch: master Commit: bf08897d9003ea36022905ebafdcace97c8587b8 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bf08897d9003ea…
Author: Simon Betz <si(a)mathias-kettner.de> Date: Fri Jan 25 14:33:46 2019 +0100 agent_aws: Remove duplicate code Change-Id: I618084858a576260ea62e95c7623adb429a3c29e --- agents/special/agent_aws | 189 +++++++++++++++++------------------------------ 1 file changed, 66 insertions(+), 123 deletions(-) Diff:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commitdiff;h=bf08897d90…
5 years, 8 months
1
0
0
0
Try to fix new flanky test_lnx_if unit test
by Lars Michelsen
Module: check_mk Branch: master Commit: 044e2052b853790e1e7738bdb19d910f7aa43206 URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=044e2052b85379…
Author: Lars Michelsen <lm(a)mathias-kettner.de> Date: Mon Jan 28 08:24:10 2019 +0100 Try to fix new flanky test_lnx_if unit test Change-Id: If042c1a6e5ca373c029eacf28de36db1117679d5 --- tests/unit/checks/test_lnx_if.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/unit/checks/test_lnx_if.py b/tests/unit/checks/test_lnx_if.py index 9ce4f7f..22678a8 100644 --- a/tests/unit/checks/test_lnx_if.py +++ b/tests/unit/checks/test_lnx_if.py @@ -1,4 +1,4 @@ -import pytest +import pytest # type: ignore from cmk_base.check_api import MKCounterWrapped from checktestlib import CheckResult, assertCheckResultsEqual @@ -36,7 +36,16 @@ def parsed_change(bandwidth_change): ] -DISCOVERY = [('5', "{'state': ['1'], 'speed': 10000000}"), ('6', "{'state': ['1'], 'speed': 0}")] +DISCOVERY = [ + ('5', "%r" % { + 'state': ['1'], + 'speed': 10000000 + }), + ('6', "%r" % { + 'state': ['1'], + 'speed': 0 + }), +] @pytest.mark.parametrize('item, params, result', [
5 years, 8 months
1
0
0
0
← Newer
1
...
5
6
7
8
9
10
11
...
49
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
42
43
44
45
46
47
48
49
Results per page:
10
25
50
100
200