diff --git a/active_directory/CHANGELOG.md b/active_directory/CHANGELOG.md index 0a0dc0281c9fd..9e47ee93b0212 100644 --- a/active_directory/CHANGELOG.md +++ b/active_directory/CHANGELOG.md @@ -6,6 +6,7 @@ * [DOCUMENTATION] Fix broken link to sample configuration file * [FIX] Moved conf.yaml to root of folder to ensure it is consistent and shipped with the wheel * [FIX] Remove non-existent counters +* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][] 1.0.0 / 2017-12-15 ================== @@ -13,3 +14,6 @@ ### Changes * [FEATURE] adds Active Directory integration. + + +[#1183]: https://github.com/DataDog/integrations-core/issues/1183 \ No newline at end of file diff --git a/active_directory/datadog_checks/active_directory/active_directory.py b/active_directory/datadog_checks/active_directory/active_directory.py index dd745cdfd66b8..9eccf31f03266 100644 --- a/active_directory/datadog_checks/active_directory/active_directory.py +++ b/active_directory/datadog_checks/active_directory/active_directory.py @@ -3,7 +3,7 @@ # Licensed under Simplified BSD License (see LICENSE) # datadog -from datadog_checks.checks.win.winpdh_base import PDHBaseCheck +from datadog_checks.checks.win import PDHBaseCheck DEFAULT_COUNTERS = [ # counterset, instance of counter, counter name, metric name @@ -36,12 +36,12 @@ ["NTDS", None, "DRA Outbound Values (DNs only)/sec", "active_directory.dra.outbound.values.dns_persec", "gauge"], # noqa: E501 ["NTDS", None, "DRA Outbound Values Total/sec", "active_directory.dra.outbound.values.total_persec", "gauge"], # noqa: E501 - #["NTDS", None, "DRA Remaining Replication Updates", "active_directory.dra.replication.remaining_updates", "gauge"], # noqa: E501 + # ["NTDS", None, "DRA Remaining Replication Updates", "active_directory.dra.replication.remaining_updates", "gauge"], # noqa: E501 ["NTDS", None, "DRA Pending Replication Synchronizations", "active_directory.dra.replication.pending_synchronizations", "gauge"], # noqa: E501 ["NTDS", None, "DRA Sync Requests Made", "active_directory.dra.sync_requests_made", "gauge"], # noqa: E501 - #["NTDS", None, "DS Security Descriptor Suboperations/sec", "active_directory.ds.security_descriptor.subops_persec", "gauge"], # noqa: E501 - #["NTDS", None, "DS Security Descriptor Propagation Events", "active_directory.ds.security_descriptor.propagation_events", "gauge"], # noqa: E501 + # ["NTDS", None, "DS Security Descriptor Suboperations/sec", "active_directory.ds.security_descriptor.subops_persec", "gauge"], # noqa: E501 + # ["NTDS", None, "DS Security Descriptor Propagation Events", "active_directory.ds.security_descriptor.propagation_events", "gauge"], # noqa: E501 ["NTDS", None, "DS Threads in Use", "active_directory.ds.threads_in_use", "gauge"], # noqa: E501 ["NTDS", None, "LDAP Client Sessions", "active_directory.ldap.client_sessions", "gauge"], # noqa: E501 @@ -49,8 +49,8 @@ ["NTDS", None, "LDAP Successful Binds/sec", "active_directory.ldap.successful_binds_persec", "gauge"], # noqa: E501 ["NTDS", None, "LDAP Searches/sec", "active_directory.ldap.searches_persec", "gauge"], # noqa: E501 - #["NTDS", None, "Kerberos Authentications/sec", "active_directory.kerberos.auths_persec", "gauge"], # noqa: E501 - #["NTDS", None, "NTLM Authentications/sec", "active_directory.ntlm.auths_persec", "gauge"], # noqa: E501 + # ["NTDS", None, "Kerberos Authentications/sec", "active_directory.kerberos.auths_persec", "gauge"], # noqa: E501 + # ["NTDS", None, "NTLM Authentications/sec", "active_directory.ntlm.auths_persec", "gauge"], # noqa: E501 ] diff --git a/active_directory/requirements.txt b/active_directory/requirements.txt index f89ecf55da555..765b9b74366c8 100644 --- a/active_directory/requirements.txt +++ b/active_directory/requirements.txt @@ -1 +1,6 @@ -# integration pip requirements +# +# This file is autogenerated by pip-compile +# To update, run: +# +# pip-compile --generate-hashes --output-file requirements.txt requirements.in +# diff --git a/active_directory/tox.ini b/active_directory/tox.ini index aa3092d49548c..30fddab2bbe00 100644 --- a/active_directory/tox.ini +++ b/active_directory/tox.ini @@ -6,9 +6,10 @@ envlist = flake8 [testenv] -platform = win32 +platform = win32|linux2|darwin [testenv:active_directory] +platform = win32 deps = ../datadog_checks_base ../datadog-checks-tests-helper diff --git a/appveyor.yml b/appveyor.yml index 9f5974699c66e..5152c3f692d9a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -53,30 +53,12 @@ install: - ps: (& "$env:PYTHON/Scripts/pip.exe" install -r requirements.txt) - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - cd .. - - cd iis - - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - - cd .. - cd windows_service - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - cd .. - cd wmi_check - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - cd .. - - cd pdh_check - - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - - cd .. - - cd aspdotnet - - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - - cd .. - - cd active_directory - - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - - cd .. - - cd dotnetclr - - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - - cd .. - - cd exchange_server - - ps: (& "$env:PYTHON/Scripts/pip.exe" install .) - - cd .. build: off test_script: - bundle exec rake ci:run[default] diff --git a/aspdotnet/CHANGELOG.md b/aspdotnet/CHANGELOG.md index 55a0d93264cf2..ff8d54731c420 100644 --- a/aspdotnet/CHANGELOG.md +++ b/aspdotnet/CHANGELOG.md @@ -1,5 +1,11 @@ # CHANGELOG - Aspdotnet +0.1.2 / Unreleased +================== +### Changes + +* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][] + 0.1.1 / 2018-03-07 ================== ### Changes @@ -14,4 +20,5 @@ * [FEATURE] adds aspdotnet integration. -[#1185]: https://github.com/DataDog/integrations-core/issues/1185 +[#1183]: https://github.com/DataDog/integrations-core/issues/1183 +[#1185]: https://github.com/DataDog/integrations-core/issues/1185 \ No newline at end of file diff --git a/aspdotnet/datadog_checks/aspdotnet/__about__.py b/aspdotnet/datadog_checks/aspdotnet/__about__.py index bc2bfa54de88c..cc552923ecf35 100644 --- a/aspdotnet/datadog_checks/aspdotnet/__about__.py +++ b/aspdotnet/datadog_checks/aspdotnet/__about__.py @@ -2,4 +2,4 @@ # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -__version__ = '0.2.0' +__version__ = '0.1.2' diff --git a/aspdotnet/datadog_checks/aspdotnet/aspdotnet.py b/aspdotnet/datadog_checks/aspdotnet/aspdotnet.py index 6a3a8ca22a45e..69902becfe2f9 100644 --- a/aspdotnet/datadog_checks/aspdotnet/aspdotnet.py +++ b/aspdotnet/datadog_checks/aspdotnet/aspdotnet.py @@ -3,11 +3,14 @@ # Licensed under Simplified BSD License (see LICENSE) # datadog -from datadog_checks.checks.win.winpdh_base import PDHBaseCheck +try: + from datadog_checks.checks.win import PDHBaseCheck +except ImportError: + class PDHBaseCheck: + pass EVENT_TYPE = SOURCE_TYPE_NAME = 'aspdotnet' - DEFAULT_COUNTERS = [ # counterset, instance of counter, counter name, metric name # This set is from the Microsoft recommended counters to monitor exchange: diff --git a/aspdotnet/tox.ini b/aspdotnet/tox.ini index 7d38bcb29ba2c..aeae939a53b17 100644 --- a/aspdotnet/tox.ini +++ b/aspdotnet/tox.ini @@ -6,9 +6,10 @@ envlist = flake8 [testenv] -platform = win32 +platform = win32|linux2|darwin [testenv:aspdotnet] +platform = win32 deps = ../datadog_checks_base ../datadog-checks-tests-helper diff --git a/datadog_checks_base/CHANGELOG.md b/datadog_checks_base/CHANGELOG.md index 50b2073c07766..9c56fc16ec9b2 100644 --- a/datadog_checks_base/CHANGELOG.md +++ b/datadog_checks_base/CHANGELOG.md @@ -1,20 +1,28 @@ # CHANGELOG - datadog_checks -## 1.2.2 / Unreleased +1.2.2 / Unreleased +================== * [BUG] Prometheus requests can use an insecure option * [BUG] Correctly handle missing counters/strings in PDH checks when possible * [BUG] Fix Prometheus Scrapper logger +* [SANITY] Clean-up export for `PDHBaseCheck` + export `WinPDHCounter`. [#1183][] -## 1.2.1 / 2018-03-23 +1.2.1 / 2018-03-23 +================== * [BUG] Correctly handle internationalized versions of Windows in the PDH library. * [FEATURE] Keep track of Service Checks in the Aggregator stub. -## 1.1.0 / 2018-03-23 +1.1.0 / 2018-03-23 +================== * [FEATURE] Add a generic prometheus check base class & rework prometheus check using a mixin -## 1.0.0 / 2017-03-22 +1.0.0 / 2017-03-22 +================== * [FEATURE] adds `datadog_checks` + + +[#1183]: https://github.com/DataDog/integrations-core/issues/1183 \ No newline at end of file diff --git a/datadog_checks_base/datadog_checks/checks/win/__init__.py b/datadog_checks_base/datadog_checks/checks/win/__init__.py index 925801458b61f..52506321d9799 100644 --- a/datadog_checks_base/datadog_checks/checks/win/__init__.py +++ b/datadog_checks_base/datadog_checks/checks/win/__init__.py @@ -5,9 +5,13 @@ try: # Agent5 compatibility layer from checks.libs.win.pdhbasecheck import PDHBaseCheck + from checks.libs.win.winpdh import WinPDHCounter except ImportError: from .winpdh_base import PDHBaseCheck + from .winpdh import WinPDHCounter + __all__ = [ 'PDHBaseCheck', + 'WinPDHCounter', ] diff --git a/datadog_checks_base/datadog_checks/checks/win/winpdh.py b/datadog_checks_base/datadog_checks/checks/win/winpdh.py index fd22956d76d29..8d8c1afe2d62f 100644 --- a/datadog_checks_base/datadog_checks/checks/win/winpdh.py +++ b/datadog_checks_base/datadog_checks/checks/win/winpdh.py @@ -12,6 +12,7 @@ DATA_TYPE_DOUBLE = win32pdh.PDH_FMT_DOUBLE DATA_POINT_INTERVAL = 0.10 SINGLE_INSTANCE_KEY = "__single_instance" + class WinPDHCounter(object): # store the dictionary of pdh counter names pdh_counter_dict = defaultdict(list) diff --git a/dotnetclr/CHANGELOG.md b/dotnetclr/CHANGELOG.md index c45d493db6e7a..aad7b37ffba0f 100644 --- a/dotnetclr/CHANGELOG.md +++ b/dotnetclr/CHANGELOG.md @@ -2,20 +2,23 @@ 1.0.0 / Unreleased ================== +### Changes * [Update] Adds wheel support and integrated unit tests +* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][] 0.1.1 / 2018-03-07 ================== ### Changes -* [Fix] Fixed tag initialization & reporting. See [#1185][]. + +* [FIX] Fixed tag initialization & reporting. See [#1185][]. 0.1.0 / 2018-01-10 ================== - ### Changes * [FEATURE] adds dotnetclr integration. +[#1183]: https://github.com/DataDog/integrations-core/issues/1183 [#1185]: https://github.com/DataDog/integrations-core/issues/1185 diff --git a/dotnetclr/datadog_checks/dotnetclr/dotnetclr.py b/dotnetclr/datadog_checks/dotnetclr/dotnetclr.py index eb2b30989dbff..0c84999d347f2 100644 --- a/dotnetclr/datadog_checks/dotnetclr/dotnetclr.py +++ b/dotnetclr/datadog_checks/dotnetclr/dotnetclr.py @@ -3,7 +3,7 @@ # Licensed under Simplified BSD License (see LICENSE) # datadog -from datadog_checks.checks.win.winpdh_base import PDHBaseCheck +from datadog_checks.checks.win import PDHBaseCheck EVENT_TYPE = SOURCE_TYPE_NAME = 'dotnetclr' diff --git a/exchange_server/CHANGELOG.md b/exchange_server/CHANGELOG.md index be035aa9d16b3..0b39a67f2836c 100644 --- a/exchange_server/CHANGELOG.md +++ b/exchange_server/CHANGELOG.md @@ -1,15 +1,18 @@ -# CHANGELOG - wmi_check +# CHANGELOG - exchange_server 1.1.0 / Unreleased ================== - ### Changes * [Update] Migrate to new wheels packaging and test framework +* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][] + 1.0.0 / 2017-03-22 ================== - ### Changes * [FEATURE] adds wmi_check integration. + + +[#1183]: https://github.com/DataDog/integrations-core/issues/1183 diff --git a/exchange_server/datadog_checks/exchange_server/exchange_server.py b/exchange_server/datadog_checks/exchange_server/exchange_server.py index 0575233fff385..70b16730ad554 100644 --- a/exchange_server/datadog_checks/exchange_server/exchange_server.py +++ b/exchange_server/datadog_checks/exchange_server/exchange_server.py @@ -3,7 +3,7 @@ # Licensed under Simplified BSD License (see LICENSE) # datadog -from datadog_checks.checks.win.winpdh_base import PDHBaseCheck +from datadog_checks.checks.win import PDHBaseCheck DEFAULT_COUNTERS = [ # counterset, instance of counter, counter name, metric name diff --git a/iis/CHANGELOG.md b/iis/CHANGELOG.md index cdaa2cf669fc7..c958848281d2e 100644 --- a/iis/CHANGELOG.md +++ b/iis/CHANGELOG.md @@ -4,7 +4,8 @@ ================== ### Changes -* [Update] Updates to new wheel packaging and test infrastructure +* [UPDATE] Updates to new wheel packaging and test infrastructure +* [SANITY] Clean-up import for `PDHBaseCheck` from `datadog-checks-base` wheel. [#1183][] 2.0.2 / 2018-03-07 ================== @@ -45,4 +46,5 @@ Please update your dashboards and monitors accordingly. [#927]: https://github.com/DataDog/integrations-core/issues/927 -[#1185]: https://github.com/DataDog/integrations-core/issues/1185 +[#1183]: https://github.com/DataDog/integrations-core/issues/1183 +[#1185]: https://github.com/DataDog/integrations-core/issues/1185 \ No newline at end of file diff --git a/iis/datadog_checks/iis/iis.py b/iis/datadog_checks/iis/iis.py index 4fde1528c5957..e34347a991eb2 100644 --- a/iis/datadog_checks/iis/iis.py +++ b/iis/datadog_checks/iis/iis.py @@ -8,8 +8,7 @@ # project from datadog_checks.checks import AgentCheck -from datadog_checks.checks.win.winpdh_base import PDHBaseCheck - +from datadog_checks.checks.win import PDHBaseCheck from datadog_checks.utils.containers import hash_mutable DEFAULT_COUNTERS = [ diff --git a/pdh_check/CHANGELOG.md b/pdh_check/CHANGELOG.md index ecfb8430e653f..3f1e6aac46f92 100644 --- a/pdh_check/CHANGELOG.md +++ b/pdh_check/CHANGELOG.md @@ -2,24 +2,24 @@ 1.2.0 / Unreleased ================== - ### Changes * [Update] Update to new wheels packaging and unit test framework +* [BUGFIX] Added resilience to failed import of `WinPDHCounter`. [#1183][] +* [SANITY] Use `WinPDHCounter` shipped with `datadog-checks-base` wheel. [#1183][] 1.1.0 / 2018-01-10 ================== - ### Changes * [BUGFIX] Fix tag key-value separator. [#927][] 1.0.0 / 2017-10-10 ================== - ### Changes * [FEATURE] adds pdh_check integration. [#927]: https://github.com/DataDog/integrations-core/issues/927 +[#1183]: https://github.com/DataDog/integrations-core/issues/1183 diff --git a/pdh_check/datadog_checks/pdh_check/pdh_check.py b/pdh_check/datadog_checks/pdh_check/pdh_check.py index c805ceec3bdb9..8229769c240ca 100644 --- a/pdh_check/datadog_checks/pdh_check/pdh_check.py +++ b/pdh_check/datadog_checks/pdh_check/pdh_check.py @@ -2,12 +2,12 @@ # All rights reserved # Licensed under Simplified BSD License (see LICENSE) -# project -from datadog_checks.utils.containers import hash_mutable # datadog -from datadog_checks.checks.win.winpdh import WinPDHCounter +from datadog_checks.checks.win import WinPDHCounter from datadog_checks.checks import AgentCheck +from datadog_checks.utils.containers import hash_mutable + class PDHCheck(AgentCheck): """ @@ -40,6 +40,8 @@ def __init__(self, name, init_config, agentConfig, instances=None): for inst_name, dd_name, mtype in metrics: m = getattr(self, mtype.lower()) obj = WinPDHCounter(counterset, inst_name, self.log) + if not obj: + continue entry = [inst_name, dd_name, m, obj] self.log.debug("entry: %s" % str(entry)) self._metrics[key].append(entry) diff --git a/pdh_check/manifest.json b/pdh_check/manifest.json index daf5773abd5e8..d0e86193d75bb 100644 --- a/pdh_check/manifest.json +++ b/pdh_check/manifest.json @@ -1,7 +1,6 @@ { "maintainer": "help@datadoghq.com", - "manifest_version": "0.1.1", - "max_agent_version": "6.0.0", + "manifest_version": "1.0.0", "min_agent_version": "5.21.0", "name": "pdh_check", "short_description": "Collect and graph any Windows PDH metrics.", @@ -9,7 +8,6 @@ "supported_os": [ "windows" ], - "version": "1.2.0", "guid": "D09B3410-00A0-4789-ABD7-7740C3FE211F", "public_title": "Datadog-Pdh Check Integration", "categories":["os & system"], diff --git a/pdh_check/setup.py b/pdh_check/setup.py index 38345ade1d5b2..85e483448b9e7 100644 --- a/pdh_check/setup.py +++ b/pdh_check/setup.py @@ -1,11 +1,13 @@ # (C) Datadog, Inc. 2018 # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) + +# Always prefer setuptools over distutils from setuptools import setup from codecs import open # To use a consistent encoding from os import path -HERE = path.dirname(path.abspath(__file__)) +HERE = path.abspath(path.dirname(__file__)) # Get version info ABOUT = {} diff --git a/pdh_check/tests/test_pdh_check.py b/pdh_check/tests/test_pdh_check.py index 8e5a3c358fdb5..a800f3a67fba1 100644 --- a/pdh_check/tests/test_pdh_check.py +++ b/pdh_check/tests/test_pdh_check.py @@ -1,8 +1,9 @@ -# (C) Datadog, Inc. 2018 +# (C) Datadog, Inc. 2010-2017 # All rights reserved -# Licensed under a 3-clause BSD style license (see LICENSE) +# Licensed under Simplified BSD License (see LICENSE) import pytest + from datadog_checks.stubs import aggregator from datadog_checks.pdh_check import PDHCheck @@ -10,6 +11,7 @@ # it's used below. noqa to suppress that error. from datadog_test_libs.win.pdh_mocks import pdh_mocks_fixture, initialize_pdh_tests # noqa: F401 +CHECK_NAME = 'pdh_check' INSTANCE = { 'countersetname': 'System', @@ -31,18 +33,21 @@ def Aggregator(): return aggregator -CHECK_NAME = 'pdh_check' - - # flake8 then says this is a redefinition of unused, which it's not. @pytest.mark.usefixtures("pdh_mocks_fixture") # noqa: F811 def test_basic_check(Aggregator, pdh_mocks_fixture): + """ + Returns the right metrics and service checks + """ + # Set up & run the check + config = { + 'instances': [INSTANCE] + } initialize_pdh_tests() - instance = INSTANCE - c = PDHCheck(CHECK_NAME, {}, {}, [instance]) - c.check(instance) + c = PDHCheck(CHECK_NAME, {}, {}, config['instances']) + c.check(config['instances'][0]) for metric in INSTANCE_METRICS: Aggregator.assert_metric(metric, tags=None, count=1) - assert Aggregator.metrics_asserted_pct == 100.0 + Aggregator.assert_all_metrics_covered() diff --git a/pdh_check/tox.ini b/pdh_check/tox.ini index cdf29ae203013..a2400791c2b4a 100644 --- a/pdh_check/tox.ini +++ b/pdh_check/tox.ini @@ -6,9 +6,10 @@ envlist = flake8 [testenv] -platform = win32 +platform = win32|linux2|darwin [testenv:pdh_check] +platform = win32 deps = ../datadog_checks_base ../datadog-checks-tests-helper diff --git a/tasks/constants.py b/tasks/constants.py index 08a02309c20e6..de0118d980421 100644 --- a/tasks/constants.py +++ b/tasks/constants.py @@ -10,6 +10,7 @@ # Note: these are the names of the folder containing the check AGENT_BASED_INTEGRATIONS = [ + 'active_directory', 'apache', 'aspdotnet', 'btrfs', @@ -17,6 +18,7 @@ 'directory', 'disk', 'envoy', + 'iis', 'istio', 'kube_proxy', 'kubelet', @@ -25,6 +27,7 @@ 'mcache', 'network', 'nfsstat', + 'pdh_check', 'postgres', 'powerdns_recursor', 'prometheus',