Currently I'm using SSH2 and node.js to monitor disk space and partitions over remote server. And printing output to console. But the output is in string format so I couldn't store free space / total space value in any variable. Current I'm running df -k command using con.exec in node.js(ssh2) to run command over remote servers using credentials.
I've added the output format I'm receiving over console(both) below
Use df -h | grep sd
to select only the row of the HDD's main partition.
After that, in data content of result array (see your picture, first item of array "data":"RESULT") change the sequence of space to one space. For example after Filesystem
in your uploaded picture there are 4 spaces, replace them with one space.
In the final string you sill have a result like this: /dev/sda1 609G 202G 376G 35% /
Now, you should split this string whit space char. Resulting in the array:
item[0] is Filesystem
item[1] is total space
item[2] is used space
item[3] is available space
item[4] is used space in percent form
item[5] is mounted on path
Very very important note: I suggest you do not use this methodology, because it is NOT secure (look at your picture).
Anyone can find it by tracing with a firebug!