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 |
19 |
|
*/ |
20 |
|
|
21 |
|
#include <sys/types.h> |
22 |
+ |
#ifdef NETBSD |
23 |
+ |
#include <limits.h> |
24 |
+ |
#endif |
25 |
|
|
26 |
|
typedef struct{ |
27 |
< |
uint_t user; |
28 |
< |
uint_t kernel; |
29 |
< |
uint_t idle; |
30 |
< |
uint_t iowait; |
31 |
< |
uint_t swap; |
32 |
< |
uint_t nice; |
33 |
< |
uint_t total; |
27 |
> |
long long user; |
28 |
> |
long long kernel; |
29 |
> |
long long idle; |
30 |
> |
long long iowait; |
31 |
> |
long long swap; |
32 |
> |
long long nice; |
33 |
> |
long long total; |
34 |
|
time_t systime; |
35 |
|
}cpu_states_t; |
36 |
|
|
60 |
|
#ifdef SOLARIS |
61 |
|
#define MAX_LOGIN_NAME_SIZE 8 |
62 |
|
#endif |
63 |
+ |
#if defined(LINUX) || defined(FREEBSD) |
64 |
+ |
#define MAX_LOGIN_NAME_SIZE UT_NAMESIZE |
65 |
+ |
#endif |
66 |
+ |
#ifdef NETBSD |
67 |
+ |
#define MAX_LOGIN_NAME_SIZE _POSIX_LOGIN_NAME_MAX |
68 |
+ |
#endif |
69 |
|
|
61 |
– |
typedef char name[MAX_LOGIN_NAME_SIZE+1]; |
62 |
– |
|
70 |
|
typedef struct{ |
71 |
< |
name *name_list; |
71 |
> |
char *name_list; |
72 |
|
int num_entries; |
73 |
|
}user_stat_t; |
74 |
|
|
122 |
|
}network_stat_t; |
123 |
|
|
124 |
|
typedef struct{ |
118 |
– |
long long num_pagein; |
119 |
– |
long long num_pageout; |
125 |
|
long long pages_pagein; |
126 |
|
long long pages_pageout; |
127 |
|
time_t systime; |
143 |
|
|
144 |
|
disk_stat_t *get_disk_stats(int *entries); |
145 |
|
diskio_stat_t *get_diskio_stats(int *entries); |
146 |
< |
diskio_stat_t *get_diskio_stat_diff(int *entries); |
146 |
> |
diskio_stat_t *get_diskio_stats_diff(int *entries); |
147 |
|
|
148 |
|
process_stat_t *get_process_stats(); |
149 |
|
|
152 |
|
|
153 |
|
page_stat_t *get_page_stats(); |
154 |
|
page_stat_t *get_page_stats_diff(); |
155 |
+ |
|
156 |
+ |
int statgrab_init(void); |