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

« back to all changes in this revision

Viewing changes to src/zabbix_agent/cpustat.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:
20
20
#ifndef ZABBIX_CPUSTAT_H
21
21
#define ZABBIX_CPUSTAT_H
22
22
 
23
 
#define CPUSTAT struct cpustat_type
24
 
CPUSTAT
25
 
{
26
 
        char    *device;
27
 
        int     major;
28
 
        int     diskno;
29
 
        int     clock[60*15];
30
 
        float   cpu_user[60*15];
31
 
        float   cpu_system[60*15];
32
 
        float   cpu_nice[60*15];
33
 
        float   cpu_idle[60*15];
34
 
};
35
 
 
36
 
void    collect_stats_cpustat(FILE *outfile);
 
23
#if defined (_WINDOWS)
 
24
 
 
25
        #define MAX_CPU 16
 
26
        #define MAX_CPU_HISTORY 900 /* 15 min in seconds */
 
27
 
 
28
        typedef struct s_single_cpu_stat_data
 
29
        {
 
30
                PDH_HCOUNTER    usage_couter;
 
31
                PDH_RAW_COUNTER usage;
 
32
                PDH_RAW_COUNTER usage_old;
 
33
 
 
34
                double util1;
 
35
                double util5;
 
36
                double util15;
 
37
 
 
38
                LONG    h_usage[MAX_CPU_HISTORY]; /* usage history */
 
39
                int     h_usage_index;
 
40
        } ZBX_SINGLE_CPU_STAT_DATA;
 
41
 
 
42
        typedef struct s_cpus_stat_data
 
43
        {
 
44
                ZBX_SINGLE_CPU_STAT_DATA cpu[MAX_CPU];
 
45
                int     count;
 
46
 
 
47
                double  load1;
 
48
                double  load5;
 
49
                double  load15;
 
50
 
 
51
                LONG    h_queue[MAX_CPU_HISTORY]; /* queue history */
 
52
                int     h_queue_index;
 
53
 
 
54
                HQUERY          pdh_query;
 
55
                PDH_RAW_COUNTER queue;
 
56
                PDH_HCOUNTER    queue_counter;
 
57
 
 
58
        } ZBX_CPUS_STAT_DATA;
 
59
 
 
60
#else /* not _WINDOWS */
 
61
 
 
62
        #define MAX_CPU_HISTORY 900 /* 15 min in seconds */
 
63
 
 
64
        typedef struct s_cpus_stat_data
 
65
        {
 
66
                /* private */
 
67
                int     clock[MAX_CPU_HISTORY];
 
68
                zbx_uint64_t    h_user[MAX_CPU_HISTORY];
 
69
                zbx_uint64_t    h_system[MAX_CPU_HISTORY];
 
70
                zbx_uint64_t    h_nice[MAX_CPU_HISTORY];
 
71
                zbx_uint64_t    h_idle[MAX_CPU_HISTORY];
 
72
 
 
73
                /* public */
 
74
                double  idle1;
 
75
                double  idle5;
 
76
                double  idle15;
 
77
                double  user1;
 
78
                double  user5;
 
79
                double  user15;
 
80
                double  system1;
 
81
                double  system5;
 
82
                double  system15;
 
83
                double  nice1;
 
84
                double  nice5;
 
85
                double  nice15;
 
86
 
 
87
        } ZBX_CPUS_STAT_DATA;
 
88
 
 
89
#endif /* _WINDOWS */
 
90
 
 
91
 
 
92
int     init_cpu_collector(ZBX_CPUS_STAT_DATA *pcpus);
 
93
void    collect_cpustat(ZBX_CPUS_STAT_DATA *pcpus);
 
94
void    close_cpu_collector(ZBX_CPUS_STAT_DATA *pcpus);
37
95
 
38
96
#endif