8

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?

1
  • 2
    Have 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 Radevic Sep 29 '12 at 11:43
19

You can use df -h to see the free space, used space, and total space of all partitions on the system.

1

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.

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.