diff --git a/process/check.py b/process/check.py index 327523a642738..aa3a08547dab0 100644 --- a/process/check.py +++ b/process/check.py @@ -325,14 +325,7 @@ def _get_child_processes(self, pids): def check(self, instance): name = instance.get('name', None) tags = instance.get('tags', []) - exact_match = None - - if instance.get('match_on_process_name', None) is not None: - exact_match = instance.get('match_on_process_name', True) - - if instance.get('exact_match', None) is not None: - exact_match = instance.get('exact_match', True) - + exact_match = _is_affirmative(instance.get('exact_match', True)) search_string = instance.get('search_string', None) ignore_ad = _is_affirmative(instance.get('ignore_denied_access', True)) pid = instance.get('pid') diff --git a/process/conf.yaml.example b/process/conf.yaml.example index a61f4c0c59c07..e808b2bacfe91 100644 --- a/process/conf.yaml.example +++ b/process/conf.yaml.example @@ -18,9 +18,9 @@ instances: # return the counter of all the processes that contain the string # pid: STRING. A Process id. # pid_file: STRING. A Pid file. -# match_on_proc_name: (optional) Boolean. Default value of True matches your search_string on proc.name(). -# If you want to match on a substring within proc.cmdline(), set this to False -# https://help.datadoghq.com/hc/en-us/articles/204116909-I-have-issues-with-my-process-check-it-doesn-t-find-my-processes- +# exact_match: (optional) Boolean. Default value of True matches your search_string on proc.name(). +# If you want to match on a substring within proc.cmdline(), set this to False +# https://help.datadoghq.com/hc/en-us/articles/204116909-I-have-issues-with-my-process-check-it-doesn-t-find-my-processes- # ignore_denied_access: (optional) Boolean. Default to True, when getting the number of files descriptors, dd-agent user might # get a denied access. Set this to true to not issue a warning if that happens. # thresholds: (optional) Two ranges: critical and warning @@ -30,7 +30,7 @@ instances: # above the second one, the process check will return CRITICAL. # In this example, process check will return OK for 3 to 5 process. WARNING for 1, 2, 6, 7 processes and Critical below 1 or above 7. # CRITICAL is always dominant in case of overlapping. -# collect_children: BOOLEAN. If true, the check will also collect metrics from all child processes of a matched process. Default to false. +# collect_children: BOOLEAN. If true, the check will also collect metrics from all child processes of a matched process. Default to false. # Please be aware that the collection is recursive, and might take some time depending on the use case. # # Examples: