sysinfo_rs

Crates.iosysinfo_rs
lib.rssysinfo_rs
version0.1.8
sourcesrc
created_at2024-09-14 09:03:33.104779
updated_at2024-10-08 06:25:31.129648
descriptionA library for retrieving system information.
homepage
repositoryhttps://github.com/chenzongyao200127/sysinfo_rs
max_upload_size
id1374589
size44,772
Solar1s. (chenzongyao200127)

documentation

README

sysinfo_rs

A library for retrieving system information.

Usage

use sysinfo_rs::get_machine_info;

fn main() -> anyhow::Result<()> {
    let machine_info = get_machine_info()?;
    println!("{:?}", machine_info);
    Ok(())
}

Prerequisites

Before using this library, ensure that you have libudev-devel installed on your system. This is required for the libudev-sys crate, which is a dependency of sysinfo_rs.

You can install libudev-devel using your package manager. For example:

  • On Debian-based systems (like Ubuntu):

    sudo apt-get install libudev-dev
    
  • On Red Hat-based systems (like CentOS or Fedora):

    sudo yum install libudev-devel
    

Structure

Hardware Information

  • hardware: Contains information about the hardware.
    • cpu_is_virtual: Analyzes the results of the cpuid command execution to determine if the system is running in a virtual machine (key field).
    • disk_serial_number: The serial number of the hard disk.
    • mac_addresses: A list of MAC addresses for all network interfaces in the system.
    • bios_info: Contains BIOS information, including manufacturer, version, release date, and whether it's a virtual machine.
    • system_info: System manufacturer, product name, serial number, and UUID.
    • enclosure_info: Chassis information, including manufacturer, type, version, serial number, and asset tag number.

Software Information

  • software: Contains information about the software.
    • os_release: Operating system version information.
    • uname: System uname information, including machine, nodename, release, sysname, and version fields.
Commit count: 6

cargo fmt