I'm trying to get the hardware information of my server and save it to database, How can I do that?
Asked
Active
Viewed 1,371 times
2
-
Why do you want do that? What do you try to achieve? – spickermann Apr 22 '15 at 02:51
-
FWIW: this answer has some linux-specific suggestions: http://stackoverflow.com/questions/7882664/how-do-i-get-linux-system-information-in-ruby – orde Apr 22 '15 at 03:05
-
@endyey-es if those answers bellow work for you please consider accept one. This will help others to see the best answer to this question, and will pay for responder's time and efforts. – Misha Slyusarev Apr 22 '15 at 16:18
2 Answers
3
I believe it depends on your system, but looks like there is a gem called hardware_information. Maybe it's what you're looking for.

Misha Slyusarev
- 1,353
- 2
- 18
- 45
0
If your server is running Linux, your code can just read files in /proc to get hardware information. For example:
- File /proc/meminfo contains the ram information.
- File /proc/cpuinfo contains the cpu information.
- There are many other files.

crazyjin
- 56
- 7