]> git.vpit.fr Git - perl/modules/Linux-SysInfo.git/blob - README
Importing Linux-SysInfo-0.09.tar.gz
[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.09
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         Seconds elapsed since the system booted.
32
33     "load1", "load5", "load15"
34         1, 5 and 15 minutes load average.
35
36     "totalram"
37         Total usable main memory size.
38
39     "freeram"
40         Available memory size.
41
42     "sharedram"
43         Amount of shared memory.
44
45     "bufferram"
46         Memory used by buffers.
47
48     "totalswap"
49         Total swap space size.
50
51     "freeswap"
52         Swap space stil available.
53
54     "procs"
55         Number of current processes.
56
57     Prior to Linux 2.3.23 on i386 and 2.3.48 on all other architectures, the
58     memory sizes were given in bytes. Since then, the following members are
59     also available and all the memory sizes are given as multiples of
60     mem_unit bytes :
61
62     "totalhigh"
63         Total high memory size.
64
65     "freehigh"
66         Available high memory size.
67
68     "mem_unit"
69         Memory unit size in bytes.
70
71 EXPORT
72     The only function of this module, "sysinfo", and the constant
73     "LS_HAS_EXTENDED" are only exported on request. Functions are also
74     exported by the ":funcs" tag, and constants by ":consts".
75
76 BINARY COMPATIBILITY
77     If you upgrade your kernel to a greater version than 2.3.23 on i386 or
78     2.3.48 on any other platform, you will need to rebuild the module to
79     access the extended fields.
80
81     Moreover, since the perl hash function has changed after the 5.6
82     version, you will also need to recompile the module if you upgrade your
83     perl from a version earlier than 5.6.
84
85 SEE ALSO
86     The sysinfo(2) man page.
87
88     Sys::Info : Gather information about your system.
89
90     Sys::CpuLoad : Try several different methods to retrieve the load
91     average.
92
93     BSD::getloadavg : Wrapper to the getloadavg(3) BSD system call.
94
95 AUTHOR
96     Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
97
98     You can contact me by mail or on #perl @ FreeNode (vincent or
99     Prof_Vince).
100
101 BUGS
102     Please report any bugs or feature requests to "bug-linux-sysinfo at
103     rt.cpan.org", or through the web interface at
104     <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Linux-SysInfo>. I will
105     be notified, and then you'll automatically be notified of progress on
106     your bug as I make changes.
107
108 SUPPORT
109     You can find documentation for this module with the perldoc command.
110
111         perldoc Linux::SysInfo
112
113 COPYRIGHT & LICENSE
114     Copyright 2007-2008 Vincent Pit, all rights reserved.
115
116     This program is free software; you can redistribute it and/or modify it
117     under the same terms as Perl itself.
118