2 Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call.
8 use Linux::SysInfo qw/sysinfo/;
11 print "$_: $si->{$_}\n" for keys %$si;
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.
20 The only function of this module, "sysinfo", and the constant
21 "LS_HAS_EXTENDED" are only exported on request.
25 This function takes no argument. It returns undef on failure or a hash
26 reference whose keys are the members name of the struct sysinfo on
30 Seconds elapsed since the system booted.
32 "load1", "load5", "load15"
33 1, 5 and 15 minutes load average.
36 Total usable main memory size.
39 Available memory size.
42 Amount of shared memory.
45 Memory used by buffers.
48 Total swap space size.
51 Swap space stil available.
54 Number of current processes.
56 Prior to Linux 2.3.23 on i386 and 2.3.48 on all other architectures, the
57 memory sizes were given in bytes. Since then, the following members are
58 also available and all the memory sizes are given as multiples of
62 Total high memory size.
65 Available high memory size.
68 Memory unit size in bytes.
72 This constant is set to 1 if your kernel supports the three extended
73 fields "totalhigh", "freehigh" and "mem_unit" ; and to 0 otherwise.
76 The sysinfo(2) man page.
78 Sys::Info : Gather information about your system.
80 Sys::CpuLoad : Try several different methods to retrieve the load
83 BSD::getloadavg : Wrapper to the getloadavg(3) BSD system call.
86 Vincent Pit, "<perl at profvince.com>"
89 Please report any bugs or feature requests to "bug-linux-sysinfo at
90 rt.cpan.org", or through the web interface at
91 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Linux-SysInfo>. I will
92 be notified, and then you'll automatically be notified of progress on
93 your bug as I make changes.
96 You can find documentation for this module with the perldoc command.
98 perldoc Linux::SysInfo
101 Copyright 2007 Vincent Pit, all rights reserved.
103 This program is free software; you can redistribute it and/or modify it
104 under the same terms as Perl itself.