summaryrefslogtreecommitdiffstats
path: root/src/zabbix_agent
diff options
context:
space:
mode:
authorsasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-12 12:22:20 +0000
committersasha <sasha@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-12-12 12:22:20 +0000
commitd516377603cc9e3fd43b3e09f37c367dd5c1878b (patch)
tree45906712b44e30506ae4ff94368b500aef936e89 /src/zabbix_agent
parentc0529a72a421c43e903376c9c2661cf9b2e221d8 (diff)
downloadzabbix-d516377603cc9e3fd43b3e09f37c367dd5c1878b.tar.gz
zabbix-d516377603cc9e3fd43b3e09f37c367dd5c1878b.tar.xz
zabbix-d516377603cc9e3fd43b3e09f37c367dd5c1878b.zip
- [ZBX-218] fixed problem "Unable to add performance counter" on start of win agent
[svn merge -r5159:5165 svn://svn.zabbix.com/branches/1.4] git-svn-id: svn://svn.zabbix.com/trunk@5166 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/zabbix_agent')
-rw-r--r--src/zabbix_agent/cpustat.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/zabbix_agent/cpustat.c b/src/zabbix_agent/cpustat.c
index 70d78c2a..e6e3b0d6 100644
--- a/src/zabbix_agent/cpustat.c
+++ b/src/zabbix_agent/cpustat.c
@@ -127,14 +127,13 @@ int init_cpu_collector(ZBX_CPUS_STAT_DATA *pcpus)
#ifdef _WINDOWS
PDH_STATUS status;
- int i;
+ int i;
+ char counter_path[MAX_COUNTER_PATH];
- char counter_path[MAX_COUNTER_PATH];
+ memset(pcpus, 0, sizeof(ZBX_CPUS_STAT_DATA));
pcpus->count = zbx_get_cpu_num();
- memset(pcpus, 0, sizeof(ZBX_CPUS_STAT_DATA));
-
if (PdhOpenQuery(NULL,0,&pcpus->pdh_query)!=ERROR_SUCCESS)
{
zabbix_log( LOG_LEVEL_ERR, "Call to PdhOpenQuery() failed: %s", strerror_from_system(GetLastError()));
@@ -177,7 +176,6 @@ int init_cpu_collector(ZBX_CPUS_STAT_DATA *pcpus)
PdhGetRawCounterValue(pcpus->cpu[i].usage_couter, NULL, &pcpus->cpu[i].usage_old);
}
-
zbx_snprintf(counter_path, sizeof(counter_path), "\\%s\\%s", GetCounterName(PCI_SYSTEM), GetCounterName(PCI_PROCESSOR_QUEUE_LENGTH));
/* Prepare for CPU execution queue usage collection */