3

I have a headless server running Centos 5.9. I can only SSH into it, is it possible to use KdirStat or a similar tool to get a graphical view of disk usage?

blarg
  • 1,595

6 Answers6

5

Use the qdirstat-cache-writer or kdirstat-cache-writer Perl script on your server, copy the file to your desktop machine and view it there with QDirStat / KDirStat.

See also:

https://github.com/shundhammer/qdirstat
https://github.com/shundhammer/qdirstat/tree/master/scripts

Update 2017-02-23: Detailed instructions available at

https://github.com/shundhammer/qdirstat/blob/master/doc/QDirStat-for-Servers.md

-- HuHa (QDirStat / KDirStat author)

HuHa
  • 151
  • This! :) Please also note that for cache import of "/"-directory to work properly you need to use the latest dev version (build yourself) - currently available ppa of last release for ubuntu contains a bug. Building works like a charm though. Perfect solution though! – icyerasor Aug 24 '16 at 12:16
3

You can use sshfs to mount / on your desktop to /mnt/server/ on your pc. Then you start Kdirstat on this directory.

2

If you're running an X server on the system you're running ssh on you should need to do nothing more than this:

$ ssh -X remoteserver KdirStat

Here for example I'm ssh'ing into a CentOS 5.9 system running Babaob, another disk utilization app that comes with GNOME.

    babaob

Incidentally there are a lot of applications for analyzing disk usage. I wrote them up here on my blog in a post titled: Command Line Tools for Analyzing Disk Usage on Fedora/CentOS/RHEL.

slm
  • 369,824
1

You can log into the server and use du, redirecting that output to a file (-a = include files, not just directories; -x = one filesystem only):

$ du -ax / > ~/root-du

then you can scp that file back, and browse it graphically with xdiskusage

$ scp server:root-du ~/root-du
$ xdiskusage ~/root-du

Of course, you can run du remotely over ssh, and pipe it to xdiskusage as well:

$ ssh server 'du -ax /' | xdiskusage

but I prefer to use files, so I can re-open it, compare before & after, etc.

derobert
  • 109,670
0

You probably don't have all the X environment (libraries, programs etc), but ssh can do X forwarding Trusted with -Y untrusted -X options.

try

xhost +
ssh -X user@remote_server
xclock
exit
xhost -
X Tian
  • 10,463
0

Having X installed/running on a server is considered to be a really bad practice, mostly because of security and stability issues.

Simply use KDE's KIOs which make it really easy to use a lot of different protocols in KDE applications.

Use a URL like sftp://user@host/some/directory to access the remote filesystem via SSH/SFTP:

KDE Filelight

Elias Probst
  • 1,053