如何在Ruby中获取Linux系统信息 [英] How do I get linux system information in Ruby
本文介绍了如何在Ruby中获取Linux系统信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何在Ruby中获取linux系统的软件/硬件信息(这必须适用于Fedora,Ubuntu等)?
How do I get the software/hardware information of a linux system (this has to work for Fedora, Ubuntu etc) in Ruby?
推荐答案
Chef背后的好人,有一个叫做Ohai的优秀宝石 https://github.com/opscode/ohai ,它以散列形式返回系统信息,例如OS,内核,规范,fqdn,磁盘,空间,内存,用户,接口,ssh密钥等.它非常完整,非常好.它还安装了命令行二进制文件(也称为ohai).
The wonderful people behind Chef, have an excellent gem called Ohai https://github.com/opscode/ohai that returns system info such as OS, kernel, specs, fqdn, disks, space, memory, users, interfaces, ssh keys etc. as a hash. It is quite complete and very good. It also installs a command line binary (also called ohai).
这篇关于如何在Ruby中获取Linux系统信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文