1 |
|
/* |
2 |
|
* i-scream central monitoring system |
3 |
< |
* http://www.i-scream.org.uk |
4 |
< |
* Copyright (C) 2000-2002 i-scream |
3 |
> |
* http://www.i-scream.org |
4 |
> |
* Copyright (C) 2000-2003 i-scream |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or |
7 |
|
* modify it under the terms of the GNU General Public License |
21 |
|
#include <sys/types.h> |
22 |
|
|
23 |
|
typedef struct{ |
24 |
< |
uint_t user; |
25 |
< |
uint_t kernel; |
26 |
< |
uint_t idle; |
27 |
< |
uint_t iowait; |
28 |
< |
uint_t swap; |
29 |
< |
uint_t nice; |
30 |
< |
uint_t total; |
24 |
> |
long long user; |
25 |
> |
long long kernel; |
26 |
> |
long long idle; |
27 |
> |
long long iowait; |
28 |
> |
long long swap; |
29 |
> |
long long nice; |
30 |
> |
long long total; |
31 |
|
time_t systime; |
32 |
|
}cpu_states_t; |
33 |
|
|
54 |
|
double min15; |
55 |
|
}load_stat_t; |
56 |
|
|
57 |
– |
#ifdef SOLARIS |
58 |
– |
#define MAX_LOGIN_NAME_SIZE 8 |
59 |
– |
#endif |
60 |
– |
|
61 |
– |
typedef char name[MAX_LOGIN_NAME_SIZE+1]; |
62 |
– |
|
57 |
|
typedef struct{ |
58 |
< |
name *name_list; |
58 |
> |
char *name_list; |
59 |
|
int num_entries; |
60 |
|
}user_stat_t; |
61 |
|
|
87 |
|
}disk_stat_t; |
88 |
|
|
89 |
|
typedef struct{ |
90 |
+ |
char *disk_name; |
91 |
+ |
long long read_bytes; |
92 |
+ |
long long write_bytes; |
93 |
+ |
time_t systime; |
94 |
+ |
}diskio_stat_t; |
95 |
+ |
|
96 |
+ |
typedef struct{ |
97 |
|
int total; |
98 |
|
int running; |
99 |
|
int sleeping; |
109 |
|
}network_stat_t; |
110 |
|
|
111 |
|
typedef struct{ |
111 |
– |
long long num_pagein; |
112 |
– |
long long num_pageout; |
112 |
|
long long pages_pagein; |
113 |
|
long long pages_pageout; |
114 |
|
time_t systime; |
129 |
|
general_stat_t *get_general_stats(); |
130 |
|
|
131 |
|
disk_stat_t *get_disk_stats(int *entries); |
132 |
+ |
diskio_stat_t *get_diskio_stats(int *entries); |
133 |
+ |
diskio_stat_t *get_diskio_stats_diff(int *entries); |
134 |
|
|
135 |
|
process_stat_t *get_process_stats(); |
136 |
|
|
137 |
|
network_stat_t *get_network_stats(int *entries); |
138 |
+ |
network_stat_t *get_network_stats_diff(int *entries); |
139 |
|
|
140 |
|
page_stat_t *get_page_stats(); |
141 |
+ |
page_stat_t *get_page_stats_diff(); |
142 |
+ |
|
143 |
+ |
int statgrab_init(void); |
144 |
+ |
int statgrab_drop_privileges(void); |
145 |
+ |
|