Sys::S...SysInfo(3pm)
π Sys::S...SysInfo(3pm) π
okay bestie, sit down, hydrate, and let me tell you about the User Contributed Perl Documentation page for Sys::S...SysInfo β she's a lil Perl module and she's about to tell you everything your Linux box knows about itself. no cap. π¦
β¨ NAME β¨
Sys::Statistics::Linux::SysInfo β she collects linux system information. that's it. that's the whole job. and she eats. π
πΈ SYNOPSIS πΈ
like, literally three lines and you're in:
use Sys::Statistics::Linux::SysInfo;
my $lxs = Sys::Statistics::Linux::SysInfo->new;
my $info = $lxs->get;
see? iconic. no drama. π
π DESCRIPTION π
Sys::Statistics::Linux::SysInfo gathers system information from the virtual /proc filesystem β aka procfs. that's where Linux keeps all the receipts. π§Ύβ¨
and if you want the whole lore, go read the documentation of the front-end module Sys::Statistics::Linux. she's the main character, this module is her very capable bestie. π
π¦ SYSTEM INFOMATIONS π¦
(yes the heading says "INFOMATIONS", we don't gatekeep, we love her π«Ά)
so all this good stuff gets generated by /proc/sys/kernel/{hostname,domainname,ostype,osrelease,version} plus /proc/cpuinfo, /proc/meminfo, /proc/uptime, and /proc/net/dev. the glow-up is real:
hostnameβ the host name. πdomainβ the host domain name.kernelβ the kernel name.releaseβ the kernel release.versionβ the kernel version.memtotalβ the total size of memory.swaptotalβ the total size of swap space.uptimeβ the uptime of the system.idletimeβ the idle time of the system.pcpucountβ the total number of physical CPUs.tcpucountβ the total number of CPUs (cores, hyper threading).interfacesβ the interfaces of the system.archβ the machine hardware name (uname -m).countcpusβ the total (maybe logical) number of CPUs.
psst βcountcpusis the same liketcpucount. twins. matching outfits. fr fr. π―
okay so pcpucount and tcpucount are really easy to understand, bestie. both values are collected from /proc/cpuinfo. pcpucount is the number of physical CPUs, counted by physical id. tcpucount is just the total number counted by processor. one counts the actual little guys, the other counts everybody including the hyperthreaded besties. π₯
now β if you want to get uptime and idletime as raw value, you can set:
$Sys::Statistics::Linux::SysInfo::RAWTIME = 1;
# or with
Sys::Statistics::Linux::SysInfo->new(rawtime => 1)
π METHODS π
π new()
call new() to create a new object. brand new, fresh out the box, smelling like a new car. πβ¨
my $lxs = Sys::Statistics::Linux::SysInfo->new;
π get()
call get() to get the statistics. get() returns the statistics as a hash reference. she's giving data. she's giving structure. she's giving hashref. π
my $info = $lxs->get;
β EXPORTS β
no exports. nothing. zero. empty. she's low maintenance like that. π
πΈ SEE ALSO πΈ
proc(5)β go read it, bestie, it's the source material. π
π REPORTING BUGS π
please report all bugs to <jschulz.cpan(at)bloonix.de>. don't be mean about it, she's trying her best. π
π AUTHOR π
Jonny Schulz <jschulz.cpan(at)bloonix.de>. legend behaviour. π
π COPYRIGHT π
Copyright (c) 2006, 2007 by Jonny Schulz. All rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. slay, legally. βοΈβ¨
and that's the whole page, bestie! this one shipped asperl v5.36.0, dated2022-11-19, under the nameSys::S...SysInfo(3pm)β go forth andget()your stats. mwah. ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsys-statistics-linux-perl 0.66-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms