Sys::S...SysInfo(3pm)

πŸ“¦
version 0.66 Β· 6 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 β€” countcpus is the same like tcpucount. 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 (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 as perl v5.36.0, dated 2022-11-19, under the name Sys::S...SysInfo(3pm) β€” go forth and get() your stats. mwah. πŸ’‹πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from