| 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 |
|
|
| 63 |
|
#ifdef SOLARIS |
| 64 |
|
#define MAX_LOGIN_NAME_SIZE 8 |
| 65 |
|
#endif |
| 66 |
+ |
#if defined(LINUX) || defined(FREEBSD) |
| 67 |
+ |
#define MAX_LOGIN_NAME_SIZE UT_NAMESIZE |
| 68 |
+ |
#endif |
| 69 |
+ |
#ifdef NETBSD |
| 70 |
+ |
#define MAX_LOGIN_NAME_SIZE _POSIX_LOGIN_NAME_MAX |
| 71 |
+ |
#endif |
| 72 |
+ |
#if defined(CYGWIN) |
| 73 |
+ |
#define MAX_LOGIN_NAME_SIZE _SC_LOGIN_NAME_MAX |
| 74 |
+ |
#endif |
| 75 |
|
|
| 61 |
– |
typedef char name[MAX_LOGIN_NAME_SIZE+1]; |
| 62 |
– |
|
| 76 |
|
typedef struct{ |
| 77 |
< |
name *name_list; |
| 77 |
> |
char *name_list; |
| 78 |
|
int num_entries; |
| 79 |
|
}user_stat_t; |
| 80 |
|
|
| 128 |
|
}network_stat_t; |
| 129 |
|
|
| 130 |
|
typedef struct{ |
| 118 |
– |
long long num_pagein; |
| 119 |
– |
long long num_pageout; |
| 131 |
|
long long pages_pagein; |
| 132 |
|
long long pages_pageout; |
| 133 |
|
time_t systime; |
| 148 |
|
general_stat_t *get_general_stats(); |
| 149 |
|
|
| 150 |
|
disk_stat_t *get_disk_stats(int *entries); |
| 151 |
+ |
diskio_stat_t *get_diskio_stats(int *entries); |
| 152 |
+ |
diskio_stat_t *get_diskio_stats_diff(int *entries); |
| 153 |
|
|
| 154 |
|
process_stat_t *get_process_stats(); |
| 155 |
|
|
| 158 |
|
|
| 159 |
|
page_stat_t *get_page_stats(); |
| 160 |
|
page_stat_t *get_page_stats_diff(); |
| 161 |
+ |
|
| 162 |
+ |
int statgrab_init(void); |