~ubuntu-dev/ubuntu/lucid/zabbix/lucid-201002110857

« back to all changes in this revision

Viewing changes to src/zabbix_agent/perfstat.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Ablassmeier
  • Date: 2007-07-02 09:06:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070702090651-8l6fl3fjw9rh6l2u
Tags: 1:1.4.1-2
Add patch from SVN in order to fix Incorrect processing of character '%'
in user parameters and remote commands.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
** ZABBIX
 
3
** Copyright (C) 2000-2005 SIA Zabbix
 
4
**
 
5
** This program is free software; you can redistribute it and/or modify
 
6
** it under the terms of the GNU General Public License as published by
 
7
** the Free Software Foundation; either version 2 of the License, or
 
8
** (at your option) any later version.
 
9
**
 
10
** This program is distributed in the hope that it will be useful,
 
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
** GNU General Public License for more details.
 
14
**
 
15
** You should have received a copy of the GNU General Public License
 
16
** along with this program; if not, write to the Free Software
 
17
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
18
**/
 
19
 
 
20
#ifndef ZABBIX_PERFSTAT_H
 
21
#define ZABBIX_PERFSTAT_H
 
22
 
 
23
#if defined (_WINDOWS)
 
24
 
 
25
#       include "perfmon.h"
 
26
 
 
27
#else /* not _WINDOWS */
 
28
 
 
29
#       define PDH_RAW_COUNTER  void*
 
30
#       define HCOUNTER         void*
 
31
#       define HQUERY           void*
 
32
 
 
33
#endif /* _WINDOWS */
 
34
 
 
35
struct zbx_perfs
 
36
{
 
37
   struct zbx_perfs     *next;
 
38
   char                 *name;
 
39
   char                 *counterPath;
 
40
   int                  interval;
 
41
   PDH_RAW_COUNTER      *rawValueArray;
 
42
   HCOUNTER             handle;
 
43
   double               lastValue;
 
44
   int                  CurrentCounter;
 
45
   int                  CurrentNum;
 
46
};
 
47
 
 
48
typedef struct zbx_perfs PERF_COUNTERS;
 
49
 
 
50
typedef struct s_perfs_stat_data
 
51
{
 
52
        PERF_COUNTERS   *pPerfCounterList;
 
53
        HQUERY          pdh_query;
 
54
} ZBX_PERF_STAT_DATA;
 
55
 
 
56
int     add_perfs_from_config(char *line);
 
57
void    perfs_list_free(void);
 
58
 
 
59
int     init_perf_collector(ZBX_PERF_STAT_DATA *pperf);
 
60
void    collect_perfstat(ZBX_PERF_STAT_DATA *pcpus);
 
61
void    close_perf_collector(ZBX_PERF_STAT_DATA *pcpus);
 
62
 
 
63
#endif /* ZABBIX_PERFSTAT_H */