The information you need is reported through the pseudo-file you mentioned. Thus, you will need a remote shell access to query it (or, remote filesystem access of sort, but that's basically the same thing).
The situation is roughly identical on Windows, btw: while Windows has all kinds of fancy data reporting network APIs you still need to provide (local/domain) user credentials to access those.
As to how to establish a remote shell connection programmatically, you've got multiple options, libssh being a handy one: http://api.libssh.org/master/libssh_tutor_command.html
There's also an SNMP route, but unless you've got an existing working SNMP setup on your machines it's hardly worth the trouble (and secure SNMP connections require comprehensive authentication and TLS context, so ssh is definitely a much simpler approach).