ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/statgrab.h
Revision: 1.20
Committed: Fri Jan 9 16:31:55 2004 UTC (20 years, 4 months ago) by pajs
Content type: text/plain
Branch: MAIN
Changes since 1.19: +0 -8 lines
Log Message:
Removed #ifdef's as they should not be there.

File Contents

# Content
1 /*
2 * i-scream central monitoring system
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
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21 typedef struct{
22 long long user;
23 long long kernel;
24 long long idle;
25 long long iowait;
26 long long swap;
27 long long nice;
28 long long total;
29 time_t systime;
30 }cpu_states_t;
31
32 typedef struct{
33 float user;
34 float kernel;
35 float idle;
36 float iowait;
37 float swap;
38 float nice;
39 time_t time_taken;
40 }cpu_percent_t;
41
42 typedef struct{
43 long long total;
44 long long free;
45 long long used;
46 long long cache;
47 }mem_stat_t;
48
49 typedef struct{
50 double min1;
51 double min5;
52 double min15;
53 }load_stat_t;
54
55 typedef struct{
56 char *name_list;
57 int num_entries;
58 }user_stat_t;
59
60 typedef struct{
61 long long total;
62 long long used;
63 long long free;
64 }swap_stat_t;
65
66 typedef struct{
67 char *os_name;
68 char *os_release;
69 char *os_version;
70 char *platform;
71 char *hostname;
72 time_t uptime;
73 }general_stat_t;
74
75 typedef struct {
76 char *device_name;
77 char *fs_type;
78 char *mnt_point;
79 long long size;
80 long long used;
81 long long avail;
82 long long total_inodes;
83 long long used_inodes;
84 long long free_inodes;
85 }disk_stat_t;
86
87 typedef struct{
88 char *disk_name;
89 long long read_bytes;
90 long long write_bytes;
91 time_t systime;
92 }diskio_stat_t;
93
94 typedef struct{
95 int total;
96 int running;
97 int sleeping;
98 int stopped;
99 int zombie;
100 }process_stat_t;
101
102 typedef struct{
103 char *interface_name;
104 long long tx;
105 long long rx;
106 time_t systime;
107 }network_stat_t;
108
109 typedef struct{
110 long long pages_pagein;
111 long long pages_pageout;
112 time_t systime;
113 }page_stat_t;
114
115 cpu_states_t *get_cpu_totals();
116 cpu_states_t *get_cpu_diff();
117 cpu_percent_t *cpu_percent_usage();
118
119 mem_stat_t *get_memory_stats();
120
121 load_stat_t *get_load_stats();
122
123 user_stat_t *get_user_stats();
124
125 swap_stat_t *get_swap_stats();
126
127 general_stat_t *get_general_stats();
128
129 disk_stat_t *get_disk_stats(int *entries);
130 diskio_stat_t *get_diskio_stats(int *entries);
131 diskio_stat_t *get_diskio_stats_diff(int *entries);
132
133 process_stat_t *get_process_stats();
134
135 network_stat_t *get_network_stats(int *entries);
136 network_stat_t *get_network_stats_diff(int *entries);
137
138 page_stat_t *get_page_stats();
139 page_stat_t *get_page_stats_diff();
140
141 int statgrab_init(void);
142 int statgrab_drop_privileges(void);
143