# Elastic Agent on windows Unhealthy : 1 error: initialization of reader failed: failed to expand counter (query='\\Process(\*)\\% Processor Time'): The specified object was not found on the computer

**URL:** <https://discuss.elastic.co/t/elastic-agent-on-windows-unhealthy-1-error-initialization-of-reader-failed-failed-to-expand-counter-query-process-processor-time-the-specified-object-was-not-found-on-the-computer/350770>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Tags:** elastic-stack-monitoring\
**Created:** [January 10, 2024, 3:33pm UTC](https://discuss.elastic.co/t/elastic-agent-on-windows-unhealthy-1-error-initialization-of-reader-failed-failed-to-expand-counter-query-process-processor-time-the-specified-object-was-not-found-on-the-computer/350770 "2024-01-10T15:33:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![HansPeterSloot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanspetersloot/32/51132_2.png) [@HansPeterSloot](https://discuss.elastic.co/u/HansPeterSloot)\
**Post date:** [January 10, 2024, 3:33pm UTC](https://discuss.elastic.co/t/elastic-agent-on-windows-unhealthy-1-error-initialization-of-reader-failed-failed-to-expand-counter-query-process-processor-time-the-specified-object-was-not-found-on-the-computer/350770/1 "2024-01-10T15:33:35Z")

</div>

Hello all,

Just for the record.  
One of my Agents (Windows Server) was unhealthy showing this message:  
1 error: initialization of reader failed: failed to expand counter (query='\Process(\*)% Processor Time'): The specified object was not found on the computer.

I found this [performance counter](https://leansentry.zendesk.com/hc/en-us/articles/360038645792-How-to-Fix-performance-counter-issues)

I compared the Unhealthy server with a healthy one

The command: lodctr /q showed a difference

[PerfProc] Performance Counters (Disabled)  
instead of  
[PerfProc] Performance Counters (Enabled)

This registry HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance  
had an entry

```auto
Close REG_SZ CloseSysProcessObject
Collect REG_SZ CollectSysProcessObjectData
Collect Supports Metadata REG_DWORD 0x1
Collect Timeout REG_DWORD 0x1f40
Library REG_EXPAND_SZ %SystemRoot%\System32\perfproc.dll
Object List REG_SZ 230 232 786 740 816 1408 1500 1548 1760
Open REG_SZ OpenSysProcessObject
Open Timeout REG_DWORD 0x2710
1014 REG_QWORD 0x1da1f6b3afea45f
**Disable Performance Counters REG_DWORD 0x1**

```

The other server did not have the last entry.  
I set it to 0x0 instead of 0x1  
That settled the issue.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [January 10, 2024, 4:50pm UTC](https://discuss.elastic.co/t/elastic-agent-on-windows-unhealthy-1-error-initialization-of-reader-failed-failed-to-expand-counter-query-process-processor-time-the-specified-object-was-not-found-on-the-computer/350770/2 "2024-01-10T16:50:34Z")

</div>

Hi @HansPeterSloot

Thank you so much for posting this! I ran into this myself.

I will give it a try!

Funny I can not mark you as solution... if you add a quick post I can and show this as solved 🙂

---

<div class="post-metadata">

**Author:** ![HansPeterSloot](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hanspetersloot/32/51132_2.png) [@HansPeterSloot](https://discuss.elastic.co/u/HansPeterSloot)\
**Post date:** [January 10, 2024, 6:18pm UTC](https://discuss.elastic.co/t/elastic-agent-on-windows-unhealthy-1-error-initialization-of-reader-failed-failed-to-expand-counter-query-process-processor-time-the-specified-object-was-not-found-on-the-computer/350770/3 "2024-01-10T18:18:56Z")

</div>

Super!  
I just found it too important not to share.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 7, 2024, 6:19pm UTC](https://discuss.elastic.co/t/elastic-agent-on-windows-unhealthy-1-error-initialization-of-reader-failed-failed-to-expand-counter-query-process-processor-time-the-specified-object-was-not-found-on-the-computer/350770/4 "2024-02-07T18:19:05Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
