From 87d952718e3b00b3aba68c0d5cf6a12664736c7b Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Thu, 16 Jan 2020 12:26:32 +0100 Subject: [PATCH 01/13] Add the option to provide a different administrative share --- .../base/checks/win/winpdh_base.py | 46 +++++++++++++++++-- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py index c2f45d7c1ca71..ae6494edf6dfc 100644 --- a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py +++ b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py @@ -13,6 +13,9 @@ from .winpdh_stub import WinPDHCounter, DATA_TYPE_INT, DATA_TYPE_DOUBLE +RESOURCETYPE_ANY = 0 +DEFAULT_SHARE = 'c$' + int_types = ["int", "long", "uint"] double_types = ["double", "float"] @@ -52,10 +55,7 @@ def __init__(self, name, init_config, agentConfig, instances, counter_list): username = instance.get('username') password = instance.get('password') - nr = win32wnet.NETRESOURCE() - nr.lpRemoteName = r"\\%s\c$" % remote_machine - nr.dwType = 0 - nr.lpLocalName = None + nr = self._get_netresource(remote_machine, instance.get('admin_share', DEFAULT_SHARE)) win32wnet.WNetAddConnection2(nr, password, username, 0) except Exception as e: @@ -105,6 +105,44 @@ def __init__(self, name, init_config, agentConfig, instances, counter_list): if key is None or not self._metrics.get(key): raise AttributeError('No valid counters to collect') + def _get_netresource(self, remote_machine, administrative_share): + """ + :param remote_machine: + :param administrative_share: The administrative share can be: + * A disk volume like c$ + * admin$: The folder in which Windows is installed + * fax$: The folder in which faxed pages and cover pages are cached + * ipc$: Area used for interprocess communication and is not part of the file system. + * print$: Virtual folder that contains a representation of the installed printers + * Domain controller shares: Windows creates two domain controller specific shares called sysvol and netlogon + which do not have $ appended to their names. + :return: a win32 netresource + """ + nr = win32wnet.NETRESOURCE() + + # Specifies the network resource to connect to. + # + # To connect you have to use the name of the server followed by an administrative share. + # Administrative shares are hidden network shares created that allow system administrators to have remote access + # to every disk volume on a network-connected system. + # These shares may not be permanently deleted but may be disabled. + # Administrative shares cannot be accessed by users without administrative privileges. + # + # This page explains how to enable them: https://www.wintips.org/how-to-enable-admin-shares-windows-7/ + nr.lpRemoteName = r"\\%s\%s" % (remote_machine, administrative_share) + + # The type of network resource to connect to. + # If lpLocalName is NULL, dwType can be RESOURCETYPE_DISK, RESOURCETYPE_PRINT, or RESOURCETYPE_ANY. + # + # Although this member is required, its information may be ignored by the network service provider. + nr.dwType = RESOURCETYPE_ANY + + # Specifies the name of a local device to redirect, such as "F:" or "LPT1". + # If the string is empty, NULL, it connects to the network resource without redirecting a local device. + nr.lpLocalName = None + + return nr + def check(self, instance): self.log.debug("PDHBaseCheck: check()") key = hash_mutable(instance) From b508ca0ca305886735750abe76c597b0c41d09b7 Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Thu, 16 Jan 2020 12:31:11 +0100 Subject: [PATCH 02/13] Add admin_share config option --- pdh_check/datadog_checks/pdh_check/data/conf.yaml.example | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example index 0d40fbf533716..24199bb0a6538 100644 --- a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example +++ b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example @@ -55,6 +55,13 @@ instances: # - active_directory.dra.inbound.bytes.total,int # - active_directory.ldap.bind_time,float + ## @param admin_share - string - optional - default: c$ + ## The administrative share to connect to. + ## Note that to be able to connect to remote hosts the administrative share needs to be enabled and the + ## dd-agent user needs network administrator permissions + # + # admin_share: c$ + ## @param tags - list of key:value element - optional ## List of tags to attach to every metric, event and service check emitted by this integration. ## From 4688d62fec8c092290770cc84b2911ece27140ef Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Thu, 16 Jan 2020 12:32:48 +0100 Subject: [PATCH 03/13] Bump check base dependency --- pdh_check/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdh_check/setup.py b/pdh_check/setup.py index 9b05035f135ab..e9ee60d15145d 100644 --- a/pdh_check/setup.py +++ b/pdh_check/setup.py @@ -26,7 +26,7 @@ def get_requirements(fpath): return f.readlines() -CHECKS_BASE_REQ = 'datadog_checks_base' +CHECKS_BASE_REQ = 'datadog_checks_base>10.2' setup( name='datadog-pdh_check', From 148fea33d66570aab72f212acc552ce82daf655d Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Thu, 16 Jan 2020 13:07:12 +0100 Subject: [PATCH 04/13] Add tests for new config option --- .../base/checks/win/winpdh_base.py | 39 +++++++++---------- .../tests/test_pdhbasecheck.py | 39 ++++++++++++++----- 2 files changed, 47 insertions(+), 31 deletions(-) diff --git a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py index ae6494edf6dfc..b19c79e7ec9cc 100644 --- a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py +++ b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py @@ -55,7 +55,7 @@ def __init__(self, name, init_config, agentConfig, instances, counter_list): username = instance.get('username') password = instance.get('password') - nr = self._get_netresource(remote_machine, instance.get('admin_share', DEFAULT_SHARE)) + nr = self._get_netresource(remote_machine) win32wnet.WNetAddConnection2(nr, password, username, 0) except Exception as e: @@ -102,26 +102,10 @@ def __init__(self, name, init_config, agentConfig, instances, counter_list): self.log.debug("Exception in PDH init: %s", str(e)) raise - if key is None or not self._metrics.get(key): - raise AttributeError('No valid counters to collect') - - def _get_netresource(self, remote_machine, administrative_share): - """ - :param remote_machine: - :param administrative_share: The administrative share can be: - * A disk volume like c$ - * admin$: The folder in which Windows is installed - * fax$: The folder in which faxed pages and cover pages are cached - * ipc$: Area used for interprocess communication and is not part of the file system. - * print$: Virtual folder that contains a representation of the installed printers - * Domain controller shares: Windows creates two domain controller specific shares called sysvol and netlogon - which do not have $ appended to their names. - :return: a win32 netresource - """ - nr = win32wnet.NETRESOURCE() + # if key is None or not self._metrics.get(key): + # raise AttributeError('No valid counters to collect') - # Specifies the network resource to connect to. - # + def _get_netresource(self, remote_machine): # To connect you have to use the name of the server followed by an administrative share. # Administrative shares are hidden network shares created that allow system administrators to have remote access # to every disk volume on a network-connected system. @@ -129,10 +113,23 @@ def _get_netresource(self, remote_machine, administrative_share): # Administrative shares cannot be accessed by users without administrative privileges. # # This page explains how to enable them: https://www.wintips.org/how-to-enable-admin-shares-windows-7/ + # + # The administrative share can be: + # * A disk volume like c$ + # * admin$: The folder in which Windows is installed + # * fax$: The folder in which faxed pages and cover pages are cached + # * ipc$: Area used for interprocess communication and is not part of the file system. + # * print$: Virtual folder that contains a representation of the installed printers + # * Domain controller shares: Windows creates two domain controller specific shares called sysvol and netlogon + # which do not have $ appended to their names. + administrative_share = self.instance.get('admin_share', DEFAULT_SHARE) + + nr = win32wnet.NETRESOURCE() + + # Specifies the network resource to connect to. nr.lpRemoteName = r"\\%s\%s" % (remote_machine, administrative_share) # The type of network resource to connect to. - # If lpLocalName is NULL, dwType can be RESOURCETYPE_DISK, RESOURCETYPE_PRINT, or RESOURCETYPE_ANY. # # Although this member is required, its information may be ignored by the network service provider. nr.dwType = RESOURCETYPE_ANY diff --git a/datadog_checks_base/tests/test_pdhbasecheck.py b/datadog_checks_base/tests/test_pdhbasecheck.py index 7682426ac28ee..28bc76893e498 100644 --- a/datadog_checks_base/tests/test_pdhbasecheck.py +++ b/datadog_checks_base/tests/test_pdhbasecheck.py @@ -2,6 +2,8 @@ # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) +import copy + import pytest from .utils import requires_windows @@ -26,6 +28,16 @@ ["Processor", "1", "% Processor Time", "test.processor_time_1", "gauge"], ] +PARTIAL_COUNTER_LIST = [ + ["NTDS", None, "LDAP Client Sessions", "active_directory.ldap.client_sessions", "gauge"], + ["NTDS", None, "LDAP Bind Time", "active_directory.ldap.bind_time", "gauge"], + ["NTDS", None, "LDAP Successful Binds/sec", "active_directory.ldap.successful_binds_persec", "gauge"], + ["NTDS", None, "LDAP Searches/sec", "active_directory.ldap.searches_persec", "gauge"], + # these two don't exist + ["NTDS", None, "Kerberos Authentications/sec", "active_directory.kerberos.auths_persec", "gauge"], + ["NTDS", None, "NTLM Authentications/sec", "active_directory.ntlm.auths_persec", "gauge"], +] + @requires_windows def test_single_instance_counter(aggregator, pdh_mocks_fixture): # noqa F811 @@ -69,18 +81,9 @@ def test_multi_instance_counter_specific_instances(aggregator, pdh_mocks_fixture @requires_windows def test_returns_partial_metrics(aggregator, pdh_mocks_fixture): # noqa F811 - COUNTER_LIST = [ - ["NTDS", None, "LDAP Client Sessions", "active_directory.ldap.client_sessions", "gauge"], - ["NTDS", None, "LDAP Bind Time", "active_directory.ldap.bind_time", "gauge"], - ["NTDS", None, "LDAP Successful Binds/sec", "active_directory.ldap.successful_binds_persec", "gauge"], - ["NTDS", None, "LDAP Searches/sec", "active_directory.ldap.searches_persec", "gauge"], - # these two don't exist - ["NTDS", None, "Kerberos Authentications/sec", "active_directory.kerberos.auths_persec", "gauge"], - ["NTDS", None, "NTLM Authentications/sec", "active_directory.ntlm.auths_persec", "gauge"], - ] initialize_pdh_tests() instance = DEFAULT_INSTANCE - c = PDHBaseCheck("testcheck", {}, {}, [instance], COUNTER_LIST) + c = PDHBaseCheck("testcheck", {}, {}, [instance], PARTIAL_COUNTER_LIST) c.check(instance) aggregator.assert_metric("active_directory.ldap.client_sessions", tags=None, count=1) @@ -88,3 +91,19 @@ def test_returns_partial_metrics(aggregator, pdh_mocks_fixture): # noqa F811 aggregator.assert_metric("active_directory.ldap.successful_binds_persec", tags=None, count=1) aggregator.assert_metric("active_directory.ldap.searches_persec", tags=None, count=1) assert aggregator.metrics_asserted_pct == 100.0 + + +@requires_windows +def test_default_admin_share(): + c = PDHBaseCheck("testcheck", {}, {}, [DEFAULT_INSTANCE], PARTIAL_COUNTER_LIST) + nr = c._get_netresource('1.1.1.1') + assert nr.IpRemoteName == '\\\\1.1.1.1\\c$' + + +@requires_windows +def test_custom_admin_share(): + instance = copy.deepcopy(DEFAULT_INSTANCE) + instance['admin_share'] = 'ipc$' + c = PDHBaseCheck("testcheck", {}, {}, [instance], PARTIAL_COUNTER_LIST) + nr = c._get_netresource('1.2.3.4') + assert nr.IpRemoteName == '\\\\1.2.3.4\\ipc$' From 17f54e49a9f7de1e65ebab63b16e51130d936bfc Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Thu, 16 Jan 2020 13:23:23 +0100 Subject: [PATCH 05/13] Fix typo --- .../datadog_checks/base/checks/win/winpdh_base.py | 4 ++-- datadog_checks_base/tests/test_pdhbasecheck.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py index b19c79e7ec9cc..fb86e08a1eafb 100644 --- a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py +++ b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py @@ -102,8 +102,8 @@ def __init__(self, name, init_config, agentConfig, instances, counter_list): self.log.debug("Exception in PDH init: %s", str(e)) raise - # if key is None or not self._metrics.get(key): - # raise AttributeError('No valid counters to collect') + if key is None or not self._metrics.get(key): + raise AttributeError('No valid counters to collect') def _get_netresource(self, remote_machine): # To connect you have to use the name of the server followed by an administrative share. diff --git a/datadog_checks_base/tests/test_pdhbasecheck.py b/datadog_checks_base/tests/test_pdhbasecheck.py index 28bc76893e498..bf0e14ab3fdbf 100644 --- a/datadog_checks_base/tests/test_pdhbasecheck.py +++ b/datadog_checks_base/tests/test_pdhbasecheck.py @@ -97,7 +97,7 @@ def test_returns_partial_metrics(aggregator, pdh_mocks_fixture): # noqa F811 def test_default_admin_share(): c = PDHBaseCheck("testcheck", {}, {}, [DEFAULT_INSTANCE], PARTIAL_COUNTER_LIST) nr = c._get_netresource('1.1.1.1') - assert nr.IpRemoteName == '\\\\1.1.1.1\\c$' + assert nr.lpRemoteName == '\\\\1.1.1.1\\c$' @requires_windows @@ -106,4 +106,4 @@ def test_custom_admin_share(): instance['admin_share'] = 'ipc$' c = PDHBaseCheck("testcheck", {}, {}, [instance], PARTIAL_COUNTER_LIST) nr = c._get_netresource('1.2.3.4') - assert nr.IpRemoteName == '\\\\1.2.3.4\\ipc$' + assert nr.lpRemoteName == '\\\\1.2.3.4\\ipc$' From 579a226a213485657c0dcba87603299fdcc101d6 Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Thu, 16 Jan 2020 17:34:29 +0100 Subject: [PATCH 06/13] call initialize_pdh_tests --- datadog_checks_base/tests/test_pdhbasecheck.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datadog_checks_base/tests/test_pdhbasecheck.py b/datadog_checks_base/tests/test_pdhbasecheck.py index bf0e14ab3fdbf..a94a7d34e0945 100644 --- a/datadog_checks_base/tests/test_pdhbasecheck.py +++ b/datadog_checks_base/tests/test_pdhbasecheck.py @@ -95,15 +95,17 @@ def test_returns_partial_metrics(aggregator, pdh_mocks_fixture): # noqa F811 @requires_windows def test_default_admin_share(): - c = PDHBaseCheck("testcheck", {}, {}, [DEFAULT_INSTANCE], PARTIAL_COUNTER_LIST) + initialize_pdh_tests() + c = PDHBaseCheck("testcheck", {}, {}, [DEFAULT_INSTANCE], SINGLE_INSTANCE_COUNTER) nr = c._get_netresource('1.1.1.1') assert nr.lpRemoteName == '\\\\1.1.1.1\\c$' @requires_windows def test_custom_admin_share(): + initialize_pdh_tests() instance = copy.deepcopy(DEFAULT_INSTANCE) instance['admin_share'] = 'ipc$' - c = PDHBaseCheck("testcheck", {}, {}, [instance], PARTIAL_COUNTER_LIST) + c = PDHBaseCheck("testcheck", {}, {}, [instance], SINGLE_INSTANCE_COUNTER) nr = c._get_netresource('1.2.3.4') assert nr.lpRemoteName == '\\\\1.2.3.4\\ipc$' From 511bbd0fbce385a7ea0df216178318fa0a5d124e Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Fri, 17 Jan 2020 10:40:32 +0100 Subject: [PATCH 07/13] Allow for empty admin share --- .../datadog_checks/base/checks/win/winpdh_base.py | 6 ++++-- datadog_checks_base/tests/test_pdhbasecheck.py | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py index fb86e08a1eafb..6073fda589333 100644 --- a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py +++ b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py @@ -106,7 +106,7 @@ def __init__(self, name, init_config, agentConfig, instances, counter_list): raise AttributeError('No valid counters to collect') def _get_netresource(self, remote_machine): - # To connect you have to use the name of the server followed by an administrative share. + # To connect you have to use the name of the server followed by an optional administrative share. # Administrative shares are hidden network shares created that allow system administrators to have remote access # to every disk volume on a network-connected system. # These shares may not be permanently deleted but may be disabled. @@ -121,13 +121,15 @@ def _get_netresource(self, remote_machine): # * ipc$: Area used for interprocess communication and is not part of the file system. # * print$: Virtual folder that contains a representation of the installed printers # * Domain controller shares: Windows creates two domain controller specific shares called sysvol and netlogon - # which do not have $ appended to their names. + # which do not have $ appended to their names. + # * Empty string: No admin share specified administrative_share = self.instance.get('admin_share', DEFAULT_SHARE) nr = win32wnet.NETRESOURCE() # Specifies the network resource to connect to. nr.lpRemoteName = r"\\%s\%s" % (remote_machine, administrative_share) + nr.rstrip('\\') # The type of network resource to connect to. # diff --git a/datadog_checks_base/tests/test_pdhbasecheck.py b/datadog_checks_base/tests/test_pdhbasecheck.py index a94a7d34e0945..db05ae1f44d0d 100644 --- a/datadog_checks_base/tests/test_pdhbasecheck.py +++ b/datadog_checks_base/tests/test_pdhbasecheck.py @@ -109,3 +109,13 @@ def test_custom_admin_share(): c = PDHBaseCheck("testcheck", {}, {}, [instance], SINGLE_INSTANCE_COUNTER) nr = c._get_netresource('1.2.3.4') assert nr.lpRemoteName == '\\\\1.2.3.4\\ipc$' + + +@requires_windows +def test_no_admin_share(): + initialize_pdh_tests() + instance = copy.deepcopy(DEFAULT_INSTANCE) + instance['admin_share'] = '' + c = PDHBaseCheck("testcheck", {}, {}, [instance], SINGLE_INSTANCE_COUNTER) + nr = c._get_netresource('1.2.3.4') + assert nr.lpRemoteName == '\\\\1.2.3.4' From 88f353ee632d2a2cd901353c3d4b0d0347f12d78 Mon Sep 17 00:00:00 2001 From: Julia Simon <611228+hithwen@users.noreply.github.com> Date: Fri, 17 Jan 2020 11:32:20 +0100 Subject: [PATCH 08/13] Inline rstrip --- .../datadog_checks/base/checks/win/winpdh_base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py index 6073fda589333..c6d7e6e12e60e 100644 --- a/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py +++ b/datadog_checks_base/datadog_checks/base/checks/win/winpdh_base.py @@ -128,8 +128,7 @@ def _get_netresource(self, remote_machine): nr = win32wnet.NETRESOURCE() # Specifies the network resource to connect to. - nr.lpRemoteName = r"\\%s\%s" % (remote_machine, administrative_share) - nr.rstrip('\\') + nr.lpRemoteName = r"\\{}\{}".format(remote_machine, administrative_share).rstrip('\\') # The type of network resource to connect to. # From 98dd528e72dc2d6833c10058faba4ec48eded263 Mon Sep 17 00:00:00 2001 From: Julia <611228+hithwen@users.noreply.github.com> Date: Fri, 17 Jan 2020 15:17:55 +0100 Subject: [PATCH 09/13] Update conf.yaml.example --- pdh_check/datadog_checks/pdh_check/data/conf.yaml.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example index 24199bb0a6538..55854cd978298 100644 --- a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example +++ b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example @@ -58,7 +58,7 @@ instances: ## @param admin_share - string - optional - default: c$ ## The administrative share to connect to. ## Note that to be able to connect to remote hosts the administrative share needs to be enabled and the - ## dd-agent user needs network administrator permissions + ## user needs network administrator permissions # # admin_share: c$ From 47111eae7f2cee672253b37ae52b164458dae698 Mon Sep 17 00:00:00 2001 From: Julia <611228+hithwen@users.noreply.github.com> Date: Mon, 20 Jan 2020 13:19:37 +0100 Subject: [PATCH 10/13] Apply suggestions from code review Co-Authored-By: FlorianVeaux --- pdh_check/datadog_checks/pdh_check/data/conf.yaml.example | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example index 55854cd978298..46c0c898c7610 100644 --- a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example +++ b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example @@ -56,9 +56,10 @@ instances: # - active_directory.ldap.bind_time,float ## @param admin_share - string - optional - default: c$ - ## The administrative share to connect to. + ## The administrative share to connect to. Can be a drive or the `ipc$` share if available. ## Note that to be able to connect to remote hosts the administrative share needs to be enabled and the ## user needs network administrator permissions + ## If the remote machine doesn't expose any, set this to the empty string `""` to connect without an admin share. # # admin_share: c$ From dc29c9d82704fe36302801aed14259be58450532 Mon Sep 17 00:00:00 2001 From: Julia <611228+hithwen@users.noreply.github.com> Date: Mon, 20 Jan 2020 13:20:42 +0100 Subject: [PATCH 11/13] Update conf.yaml.example --- .../pdh_check/data/conf.yaml.example | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example index 46c0c898c7610..5be054c180aac 100644 --- a/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example +++ b/pdh_check/datadog_checks/pdh_check/data/conf.yaml.example @@ -18,6 +18,14 @@ instances: # # password: + ## @param admin_share - string - optional - default: c$ + ## The administrative share to connect to. Can be a drive or the `ipc$` share if available. + ## Note that to be able to connect to remote hosts the administrative share needs to be enabled and the + ## user needs network administrator permissions + ## If the remote machine doesn't expose any, set this to the empty string `""` to connect without an admin share. + # + # admin_share: c$ + ## The following example fetches the number of processes and users: ## ## - countersetname: Processor @@ -55,14 +63,6 @@ instances: # - active_directory.dra.inbound.bytes.total,int # - active_directory.ldap.bind_time,float - ## @param admin_share - string - optional - default: c$ - ## The administrative share to connect to. Can be a drive or the `ipc$` share if available. - ## Note that to be able to connect to remote hosts the administrative share needs to be enabled and the - ## user needs network administrator permissions - ## If the remote machine doesn't expose any, set this to the empty string `""` to connect without an admin share. - # - # admin_share: c$ - ## @param tags - list of key:value element - optional ## List of tags to attach to every metric, event and service check emitted by this integration. ## From cb365745e0ac96a87b4e6225eb55515aa96f7c4f Mon Sep 17 00:00:00 2001 From: Julia <611228+hithwen@users.noreply.github.com> Date: Tue, 21 Jan 2020 14:18:19 +0100 Subject: [PATCH 12/13] Update pdh_check/setup.py Co-Authored-By: Florimond Manca --- pdh_check/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdh_check/setup.py b/pdh_check/setup.py index e9ee60d15145d..02a8523ed3dda 100644 --- a/pdh_check/setup.py +++ b/pdh_check/setup.py @@ -26,7 +26,7 @@ def get_requirements(fpath): return f.readlines() -CHECKS_BASE_REQ = 'datadog_checks_base>10.2' +CHECKS_BASE_REQ = 'datadog_checks_base>=10.3' setup( name='datadog-pdh_check', From 76500460060f40755f4f8aa16c8e68ddc3478958 Mon Sep 17 00:00:00 2001 From: Florimond Manca Date: Tue, 21 Jan 2020 14:24:32 -0500 Subject: [PATCH 13/13] Remove pin on unreleased base version --- pdh_check/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdh_check/setup.py b/pdh_check/setup.py index 02a8523ed3dda..9b05035f135ab 100644 --- a/pdh_check/setup.py +++ b/pdh_check/setup.py @@ -26,7 +26,7 @@ def get_requirements(fpath): return f.readlines() -CHECKS_BASE_REQ = 'datadog_checks_base>=10.3' +CHECKS_BASE_REQ = 'datadog_checks_base' setup( name='datadog-pdh_check',