| 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 |
+ |
#ifdef CYGWIN |
| 26 |
+ |
#include <sys/unistd.h> |
| 27 |
+ |
#endif |
| 28 |
|
|
| 29 |
|
typedef struct{ |
| 30 |
< |
uint_t user; |
| 31 |
< |
uint_t kernel; |
| 32 |
< |
uint_t idle; |
| 33 |
< |
uint_t iowait; |
| 34 |
< |
uint_t swap; |
| 35 |
< |
uint_t nice; |
| 36 |
< |
uint_t total; |
| 30 |
> |
long long user; |
| 31 |
> |
long long kernel; |
| 32 |
> |
long long idle; |
| 33 |
> |
long long iowait; |
| 34 |
> |
long long swap; |
| 35 |
> |
long long nice; |
| 36 |
> |
long long total; |
| 37 |
|
time_t systime; |
| 38 |
|
}cpu_states_t; |
| 39 |
|
|
| 60 |
|
double min15; |
| 61 |
|
}load_stat_t; |
| 62 |
|
|
| 57 |
– |
#ifdef SOLARIS |
| 58 |
– |
#define MAX_LOGIN_NAME_SIZE 8 |
| 59 |
– |
#endif |
| 60 |
– |
|
| 61 |
– |
typedef char name[MAX_LOGIN_NAME_SIZE+1]; |
| 62 |
– |
|
| 63 |
|
typedef struct{ |
| 64 |
< |
name *name_list; |
| 64 |
> |
char *name_list; |
| 65 |
|
int num_entries; |
| 66 |
|
}user_stat_t; |
| 67 |
|
|
| 93 |
|
}disk_stat_t; |
| 94 |
|
|
| 95 |
|
typedef struct{ |
| 96 |
+ |
char *disk_name; |
| 97 |
+ |
long long read_bytes; |
| 98 |
+ |
long long write_bytes; |
| 99 |
+ |
time_t systime; |
| 100 |
+ |
}diskio_stat_t; |
| 101 |
+ |
|
| 102 |
+ |
typedef struct{ |
| 103 |
|
int total; |
| 104 |
|
int running; |
| 105 |
|
int sleeping; |
| 115 |
|
}network_stat_t; |
| 116 |
|
|
| 117 |
|
typedef struct{ |
| 118 |
< |
long pgin; |
| 119 |
< |
long pgout; |
| 118 |
> |
long long pages_pagein; |
| 119 |
> |
long long pages_pageout; |
| 120 |
|
time_t systime; |
| 121 |
|
}page_stat_t; |
| 122 |
|
|
| 135 |
|
general_stat_t *get_general_stats(); |
| 136 |
|
|
| 137 |
|
disk_stat_t *get_disk_stats(int *entries); |
| 138 |
+ |
diskio_stat_t *get_diskio_stats(int *entries); |
| 139 |
+ |
diskio_stat_t *get_diskio_stats_diff(int *entries); |
| 140 |
|
|
| 141 |
|
process_stat_t *get_process_stats(); |
| 142 |
|
|
| 143 |
|
network_stat_t *get_network_stats(int *entries); |
| 144 |
+ |
network_stat_t *get_network_stats_diff(int *entries); |
| 145 |
+ |
|
| 146 |
+ |
page_stat_t *get_page_stats(); |
| 147 |
+ |
page_stat_t *get_page_stats_diff(); |
| 148 |
+ |
|
| 149 |
+ |
int statgrab_init(void); |
| 150 |
+ |
int statgrab_drop_privileges(void); |
| 151 |
+ |
|