Unix::S...st_info(3)

πŸ“¦ version 0.112, in fedora 43

πŸ’– 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 (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