#linux #cpu-memory #system-information #probe #proc #block-device

mprober-lib

A library aims to quickly collect Linux system information including hostname, kernel version, uptime, RTC time, load average, CPU, memory, network interfaces, block devices and processes

14 releases

0.1.15 Nov 14, 2023
0.1.12 Sep 9, 2023
0.1.11 Apr 17, 2023
0.1.10 Nov 3, 2022
0.1.4 Jul 29, 2020

#257 in Unix APIs

Download history 14/week @ 2024-02-15 19/week @ 2024-02-22 10/week @ 2024-02-29 3/week @ 2024-03-07 2/week @ 2024-03-14 1/week @ 2024-03-21 48/week @ 2024-03-28 19/week @ 2024-04-04

68 downloads per month
Used in yaib

MIT license

66KB
1.5K SLoC

M Prober Lib

CI

This crate aims to quickly collect Linux system information including hostname, kernel version, uptime, RTC time, load average, CPU, memory, network interfaces, block devices and processes.

Examples

use mprober_lib::*;

println!("{}", hostname::get_hostname().unwrap());
println!("{}", kernel::get_kernel_version().unwrap());
println!("{}", btime::get_btime());
println!("{}", rtc_time::get_rtc_date_time().unwrap());
println!("{:#?}", uptime::get_uptime().unwrap());
println!("{:#?}", load_average::get_load_average().unwrap());
println!("{:#?}", cpu::get_cpus().unwrap());
println!("{:#?}", memory::free().unwrap());
println!("{:#?}", volume::get_volumes().unwrap());
println!("{:#?}", network::get_networks().unwrap());
println!("{:#?}", process::get_processes_with_stat(&process::ProcessFilter::default()).unwrap().into_iter().map(|(process, _)| process).collect::<Vec<process::Process>>());

Benchmark

cargo bench

Documentation

https://docs.rs/mprober-lib

Official CLI

https://crates.io/crates/mprober

License

MIT

Dependencies

~4–6MB
~101K SLoC