1 |
|
/* |
2 |
< |
* i-scream central monitoring system |
2 |
> |
* i-scream libstatgrab |
3 |
|
* http://www.i-scream.org |
4 |
|
* Copyright (C) 2000-2004 i-scream |
5 |
|
* |
32 |
|
int sg_init(void); |
33 |
|
int sg_drop_privileges(void); |
34 |
|
|
35 |
+ |
typedef enum { |
36 |
+ |
SG_ERROR_NONE = 0, |
37 |
+ |
SG_ERROR_MALLOC, |
38 |
+ |
SG_ERROR_KSTAT_OPEN, |
39 |
+ |
SG_ERROR_OPEN, |
40 |
+ |
SG_ERROR_SYSCTLBYNAME, |
41 |
+ |
SG_ERROR_PARSE |
42 |
+ |
} sg_error; |
43 |
+ |
|
44 |
+ |
void sg_set_error(sg_error code, const char *arg); |
45 |
+ |
sg_error sg_get_error(); |
46 |
+ |
const char *sg_str_error(sg_error code); |
47 |
+ |
|
48 |
|
typedef struct { |
49 |
|
char *os_name; |
50 |
|
char *os_release; |
57 |
|
sg_host_info *sg_get_host_info(); |
58 |
|
|
59 |
|
typedef struct { |
60 |
< |
long long user; |
61 |
< |
long long kernel; |
62 |
< |
long long idle; |
63 |
< |
long long iowait; |
64 |
< |
long long swap; |
65 |
< |
long long nice; |
66 |
< |
long long total; |
67 |
< |
time_t systime; |
60 |
> |
long long user; |
61 |
> |
long long kernel; |
62 |
> |
long long idle; |
63 |
> |
long long iowait; |
64 |
> |
long long swap; |
65 |
> |
long long nice; |
66 |
> |
long long total; |
67 |
> |
time_t systime; |
68 |
|
} sg_cpu_stats; |
69 |
|
|
70 |
|
sg_cpu_stats *sg_get_cpu_stats(); |
71 |
|
sg_cpu_stats *sg_get_cpu_stats_diff(); |
72 |
|
|
73 |
|
typedef struct { |
74 |
< |
float user; |
75 |
< |
float kernel; |
76 |
< |
float idle; |
77 |
< |
float iowait; |
78 |
< |
float swap; |
79 |
< |
float nice; |
74 |
> |
float user; |
75 |
> |
float kernel; |
76 |
> |
float idle; |
77 |
> |
float iowait; |
78 |
> |
float swap; |
79 |
> |
float nice; |
80 |
|
time_t time_taken; |
81 |
|
} sg_cpu_percents; |
82 |
|
|
115 |
|
sg_swap_stats *sg_get_swap_stats(); |
116 |
|
|
117 |
|
typedef struct { |
118 |
< |
char *device_name; |
118 |
> |
char *device_name; |
119 |
|
char *fs_type; |
120 |
< |
char *mnt_point; |
121 |
< |
long long size; |
122 |
< |
long long used; |
123 |
< |
long long avail; |
124 |
< |
long long total_inodes; |
120 |
> |
char *mnt_point; |
121 |
> |
long long size; |
122 |
> |
long long used; |
123 |
> |
long long avail; |
124 |
> |
long long total_inodes; |
125 |
|
long long used_inodes; |
126 |
< |
long long free_inodes; |
126 |
> |
long long free_inodes; |
127 |
|
} sg_fs_stats; |
128 |
|
|
129 |
|
sg_fs_stats *sg_get_fs_stats(int *entries); |
217 |
|
} sg_process_count; |
218 |
|
|
219 |
|
sg_process_count *sg_get_process_count(); |
220 |
+ |
|
221 |
+ |
#ifdef SG_ENABLE_DEPRECATED |
222 |
+ |
#include <statgrab_deprecated.h> |
223 |
+ |
#endif |
224 |
|
|