Unix::S...st_info(3)
π Unix::S...st_info π
okay bestie, gather round, because this is the Unix::Statgrab::sg_host_info page from User Contributed Perl Documentation, section 3 (the library-calls girly section, iykyk) β¨
πΈ NAME πΈ
Unix::Statgrab::sg_host_info β it's a lil container holding all your libstatgrab host information, no cap π«Ά
π¦ DESCRIPTION π¦
Unix::Statgrab::sg_host_info is a Perl package name, and what it does is hand you accessors to the bundled libstatgrab sg_host_info host info β which lives over at http://www.i-scream.org/libstatgrab/docs/sg_get_host_info.3.html if you wanna go read the source-of-truth docs π
it's giving "wrapped C library but make it cute" and honestly? obsessed.
β¨ METHODS β¨
π nentries
Returns the number of entries in the container. that's it. that's the method. iconic behaviour honestly π
π systime
Returns the seconds since Epoch β aka 0:00:00 on January, 1st 1970, the classic β of the time measure the host information. so like, when this info was measured, in epoch seconds πΈ
π as_list
Deprecated alias of fetchall_hash. it's giving legacy code that refuses to retire π still works, but like... use the new one bestie.
π fetchall_hash
Returns all records from the sg_host_info container (docs at http://www.i-scream.org/libstatgrab/docs/sg_get_host_info.3.html) as a list of hashes, where each datum name is the key and the datum is the value. chef's kiss data structure fr fr π
π fetchall_array
Returns all records from the sg_host_info container (yep, same docs: http://www.i-scream.org/libstatgrab/docs/sg_get_host_info.3.html) as a list of arrays, with the values in this exact order:
(os_name os_release os_version platform hostname bitwidth host_state ncpus maxcpus uptime systime)
in that order, and without a leading headline. no header, just vibes β¨
π fetchall_table
Returns all records from the sg_host_info container (http://www.i-scream.org/libstatgrab/docs/sg_get_host_info.3.html, you know the one π«Ά) as a list of arrays, values in this exact order:
(os_name os_release os_version platform hostname bitwidth host_state ncpus maxcpus uptime systime)
in that order, but this time including the leading headline. so it's fetchall_array's more extra sibling π
π fetchrow_arrayref($row = 0)
Returns one row as an array, containing values as above. defaults to row 0 because we all start somewhere π₯Ί
π fetchall_arrayref
Returns all records from the sg_host_info container (http://www.i-scream.org/libstatgrab/docs/sg_get_host_info.3.html) as an array of arrays, without a header. no header era π
π fetchrow_hashref($row = 0)
Returns one row as a hash containing:
{ os_name => $self.os_name($row), os_release => ... }
and so on down the line. default row is 0. key-value girlies rise π
π fetchall_hashref
Returns all records from the sg_host_info container (http://www.i-scream.org/libstatgrab/docs/sg_get_host_info.3.html) as an array of hashes. every row, hashed up, living its best life π₯
π colnames
Returns the list of column names:
(os_name os_release os_version platform hostname bitwidth host_state ncpus maxcpus uptime systime)
it's the guest list bestie πβ¨
π os_name
Name of operating system π§
π os_release
Release number as a string.
π os_version
Complete version string for the operating system.
π platform
Name of the platform.
π hostname
Hostname. yeah. it's the hostname. the name of the host. we love a self-explanatory moment π
π bitwidth
Host/Machine bitwidth.
π host_state
One of:
sg_unknown_configuration
sg_physical_host
sg_virtual_machine
sg_paravirtual_machine
sg_hardware_virtualized
pick your fighter π (are you bare metal or are you cloud-core? only host_state knows)
π ncpus
Number of currently configured cpu's.
π maxcpus
Number of maximum configurable cpu's.
π uptime
System is up since uptime seconds. so like, the machine has been awake for that many seconds and honestly same π₯±β¨
π AUTHOR π
Jens Rehsack, <rehsack AT cpan.org> β thank you for your service king π«‘
π COPYRIGHT AND LICENSE π
Copyright (C) 2012-2018 by Jens Rehsack
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
okay so real talk bestie: it's the LGPL, version 2.1 or later, your choice. read the license, it's giving legally binding and we respect that π
and that's the whole page, babe β¨ this one shipped as perl v5.42.0, dated 2025-07-25 β stay hydrated, stay hashed, and don't use as_list unless you absolutely have to π
ππ¦
π¦ where this page comes from
- fedora 43: perl-Unix-Statgrab 0.112-27.fc43 Β· (LGPL-2.1-or-later AND (GPL-1.0-or-later OR Artistic-1.0-Perl))
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms