We have an ssh server on Ubuntu and we want a disk usage report using ssh of whole network.Is there any utility, command, or script available to accomplish this?
-
2Have you considered network monitor services like nagios, zabbix, cacti etc? alternativeto.net/software/nagios/… -- On the other hand, you could set a cron script to email you the data per server (it's much safer, since it doesn't require password or key logins)– Savvas RadevicSep 29, 2012 at 11:43
3 Answers
You can use df -h
to see the free space, used space, and total space of all partitions on the system.
Are you wanting to see the disk usage on the SSH remotely? As in, "log in to SSH server and then show the disk usage"?
If so...
ssh user@host "df -h"
That's assuming you have key logins enabled so it doesn't prompt you for a password.
ssh to your host then:
to show all folder sizes for the current directory recursively, with their sizes:
du -h
If you run this from a high-level directory, it can take a while to complete.
Show a disk use summary for the current directory:
du -sh
Again, this can take a little while if you're running it in a high-level directory.