Info() function returns detailed information about the host system including hostname, OS, platform, kernel version, virtualization details, and more.
Function Signature
Return Value
Returns a pointer toInfoStat struct containing:
System hostname
System uptime in seconds
System boot time in seconds since Unix epoch
Number of currently running processes
Operating system (e.g., “linux”, “freebsd”, “darwin”, “windows”)
Platform distribution (e.g., “ubuntu”, “centos”, “debian”)
Platform family (e.g., “debian”, “rhel”, “arch”)
Version of the complete operating system
Kernel version string
Native CPU architecture (equivalent to
uname -m)Virtualization system if running in a VM (e.g., “kvm”, “xen”, “vmware”)
Either “guest” or “host” indicating virtualization role
Unique host identifier (usually UUID)
Usage Examples
Basic Usage
With Context and Timeout
Checking Virtualization
JSON Output
Error Handling
The function may return errors when:- Unable to access system information files (permission issues)
- Platform-specific system calls fail
- Context deadline is exceeded (when using
InfoWithContext)
Some fields may be empty on certain platforms if the information is not available or not implemented for that OS.
Platform Notes
- Linux
- macOS
- Windows
- BSD
Reads from
/proc/sys/kernel, /etc/os-release, and other system files. Requires read access to these locations.Related Functions
BootTime()
Get only the boot time
Users()
Get logged-in users