2 ms·
I'm writing a ruby script to gather statistics from a Raspberry Pi. All the projects I've seen so far rely on Perl/Python/PHP scripts which are executing shell
by atmosx 13y ago
I'm writing a ruby script to gather statistics from a Raspberry Pi. All the projects I've seen so far rely on Perl/Python/PHP scripts which are executing shell commands to extract informations every X minutes.
I wonder, isn't there some sort of API to access in Unix-based systems data like CPU usage, memory usage, etc in a more natural way?
- dsr_ 13y agoWhy, yes, there is. Go run strace on ps or top and see what they call. I'll save you some time: it turns out to be stat() and open() on things in /proc.