]> git.vpit.fr Git - perl/modules/Linux-SysInfo.git/blob - README
This is 0.15
[perl/modules/Linux-SysInfo.git] / README
1 NAME
2     Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call.
3
4 VERSION
5     Version 0.15
6
7 SYNOPSIS
8         use Linux::SysInfo qw<sysinfo>;
9
10         my $si = sysinfo;
11         print "$_: $si->{$_}\n" for keys %$si;
12
13 DESCRIPTION
14     This module is a wrapper around the sysinfo(2) Linux system call. It
15     gives information about the current uptime, load average, memory usage
16     and processes running. Other systems have also this system call (e.g.
17     Solaris), but in most cases the returned information is different.
18
19 CONSTANTS
20   "LS_HAS_EXTENDED"
21     This constant is set to 1 if your kernel supports the three extended
22     fields "totalhigh", "freehigh" and "mem_unit" ; and to 0 otherwise.
23
24 FUNCTIONS
25   "sysinfo"
26     This function takes no argument. It returns "undef" on failure or a hash
27     reference whose keys are the members name of the "struct sysinfo" on
28     success :
29
30     *   "uptime"
31
32         Seconds elapsed since the system booted.
33
34     *   "load1", "load5", "load15"
35
36         1, 5 and 15 minutes load average.
37
38     *   "totalram"
39
40         Total usable main memory size.
41
42     *   "freeram"
43
44         Available memory size.
45
46     *   "sharedram"
47
48         Amount of shared memory.
49
50     *   "bufferram"
51
52         Memory used by buffers.
53
54     *   "totalswap"
55
56         Total swap space size.
57
58     *   "freeswap"
59
60         Swap space still available.
61
62     *   "procs"
63
64         Number of current processes.
65
66     Prior to Linux 2.3.23 on i386 and 2.3.48 on all other architectures, the
67     memory sizes were given in bytes. Since then, the following members are
68     also available and all the memory sizes are given as multiples of
69     "mem_unit" bytes :
70
71     *   "totalhigh"
72
73         Total high memory size.
74
75     *   "freehigh"
76
77         Available high memory size.
78
79     *   "mem_unit"
80
81         Memory unit size in bytes.
82
83 EXPORT
84     The only function of this module, "sysinfo", and the constant
85     "LS_HAS_EXTENDED" are only exported on request. Functions are also
86     exported by the ":funcs" tag, and constants by ":consts".
87
88 BINARY COMPATIBILITY
89     If you upgrade your kernel to a greater version than 2.3.23 on i386 or
90     2.3.48 on any other platform, you will need to rebuild the module to
91     access the extended fields.
92
93     Moreover, since the perl hash function has changed after the 5.6
94     version, you will also need to recompile the module if you upgrade your
95     perl from a version earlier than 5.6.
96
97 DEPENDENCIES
98     perl 5.6.
99
100     A C compiler. This module may happen to build with a C++ compiler as
101     well, but don't rely on it, as no guarantee is made in this regard.
102
103 SEE ALSO
104     The sysinfo(2) man page.
105
106     Sys::Info : Gather information about your system.
107
108     Sys::CpuLoad : Try several different methods to retrieve the load
109     average.
110
111     BSD::getloadavg : Wrapper to the getloadavg(3) BSD system call.
112
113 AUTHOR
114     Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
115
116     You can contact me by mail or on "irc.perl.org" (vincent).
117
118 BUGS
119     Please report any bugs or feature requests to "bug-linux-sysinfo at
120     rt.cpan.org", or through the web interface at
121     <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Linux-SysInfo>. I will
122     be notified, and then you'll automatically be notified of progress on
123     your bug as I make changes.
124
125 SUPPORT
126     You can find documentation for this module with the perldoc command.
127
128         perldoc Linux::SysInfo
129
130 COPYRIGHT & LICENSE
131     Copyright 2007,2008,2009,2010,2013,2017 Vincent Pit, all rights
132     reserved.
133
134     This program is free software; you can redistribute it and/or modify it
135     under the same terms as Perl itself.
136