I am running MetricBeat on about 30 Windows servers, and on one of them it's having trouble. Running it manually seems to work fine, although I get a whole bunch of "Skip process pid" messages due to missing pids, but I think that's fine.
If I start it as a service however, it appears to start correctly, start to read pids, and then just silently terminates. In the Service Manager, it seems to take ages to start, at which point the SM gives up with a timeout error.
I found a recent post similar to this, but it didn't have much info and seems to have been abandoned.
This server is one of our busier ones, with CPU averaging between 70% and 80%, but I don't see why that would cause the service to not start.
This is the debug log output. The "error getting process details" ones repeat about 60 times.
2016-11-16T11:24:13Z DBG Disable stderr logging
2016-11-16T11:24:13Z INFO Home path: [C:\Beats\metricbeat] Config path: [C:\Beats\metricbeat] Data path: [C:\ProgramData\metricbeat] Logs path: [C:\Beats\metricbeat\logs]
2016-11-16T11:24:13Z INFO Setup Beat: metricbeat; Version: 5.0.0-rc1
2016-11-16T11:24:13Z DBG Processors:
2016-11-16T11:24:13Z DBG Initializing output plugins
2016-11-16T11:24:13Z INFO Elasticsearch url: http://logstash:9200
2016-11-16T11:24:13Z INFO Elasticsearch url: http://elastic1:9200
2016-11-16T11:24:13Z DBG configure maxattempts: 4
2016-11-16T11:24:13Z INFO Metrics logging every 30s
2016-11-16T11:24:13Z DBG load balancer: start client loop
2016-11-16T11:24:13Z DBG ES Ping(url=http://logstash:9200, timeout=1m30s)
2016-11-16T11:24:13Z DBG load balancer: start client loop
2016-11-16T11:24:13Z DBG ES Ping(url=http://elastic1:9200, timeout=1m30s)
2016-11-16T11:24:13Z INFO Activated elasticsearch as output plugin.
2016-11-16T11:24:13Z DBG Create output worker
2016-11-16T11:24:13Z DBG No output is defined to store the topology. The server fields might not be filled.
2016-11-16T11:24:13Z INFO Publisher name: ca-app-rc01
2016-11-16T11:24:14Z INFO Flush Interval set to: 1s
2016-11-16T11:24:14Z INFO Max Bulk Size set to: 50
2016-11-16T11:24:14Z DBG create bulk processing worker (interval=1s, bulk size=50)
2016-11-16T11:24:14Z INFO Register [ModuleFactory:[system], MetricSetFactory:[apache/status, haproxy/info, haproxy/stat, mongodb/status, mysql/status, nginx/stubstatus, postgresql/activity, postgresql/bgwriter, postgresql/database, redis/info, redis/keyspace, system/cpu, system/diskio, system/filesystem, system/fsstat, system/memory, system/network, system/process, zookeeper/mntr]]
2016-11-16T11:24:14Z DBG Skip process pid=0: error getting process state for pid=0: OpenProcess fails with The parameter is incorrect.
2016-11-16T11:24:14Z DBG Skip process pid=4: error getting process state for pid=4: OpenProcess fails with Access is denied.
2016-11-16T11:24:14Z DBG Skip process pid=560: error getting process state for pid=560: OpenProcess fails with Access is denied.
2016-11-16T11:24:14Z DBG Ping status code: 200
2016-11-16T11:24:14Z INFO Connected to Elasticsearch version 2.4.1
2016-11-16T11:24:14Z DBG Ping status code: 200
2016-11-16T11:24:14Z INFO Connected to Elasticsearch version 2.4.1
2016-11-16T11:24:15Z DBG Skip process pid=656: error getting process state for pid=656: OpenProcess fails with Access is denied.
2016-11-16T11:24:29Z DBG Skip process pid=4292: error getting process state for pid=4292: OpenProcess fails with Access is denied.
2016-11-16T11:24:33Z ERR Error getting process details pid=4880: error getting process arguments for pid=4880: could not get CommandLine: could not get Win32_Process WHERE ProcessId = 4880: Process not found
2016-11-16T11:24:34Z ERR Error getting process details pid=1392: error getting process arguments for pid=1392: could not get CommandLine: could not get Win32_Process WHERE ProcessId = 1392: Process not found
2016-11-16T11:24:34Z ERR Error getting process details pid=1948: error getting process arguments for pid=1948: could not get CommandLine: could not get Win32_Process WHERE ProcessId = 1948: Process not found