main · play · me
philesight Add ϲomment
Info
name Philesight
author Ico Doornekamp
email philesight@zevv.nl

Please note:

Development and bugfixing on Philesight has ceased, all efforts are now put in Duc a faster and better replacement for Philesight.

Instead of Ruby, Duc is written in plain C, which is probably as fast as it will get. Duc is about ten times faster then Philesight when indexing, with a database size which is about eight times smaller.

Summary

Philesight is a tool to browse your filesystem and see where the diskspace is being used at a glance. Philesight is implemented as a simple command line program that generates PNG files; a wrapper CGI script is supplied to allow navigating through the filesystem. Click the image on top for an online demo.

Philesight is actually a clone of the filelight program. Wheres filelight is ment as an interactive, user friendly application for the X-windows desktop, philesight is designed to run on a remote server without graphical user interface.

Download

philesight-20120427.tgz

Demo

Click on the image for online demo.

License

This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Support

Mail the author

README


Summary 
=======

Philesight is a tool to browse your filesystem and see where the diskspace is
being used at a glance. Philesight is implemented as a simple command line
program that generates PNG files; a wrapper CGI script is supplied to allow
navigating through the filesystem. 

Philesight is actually a clone of the filelight program. Wheres filelight is
ment as an interactive, user friendly application for the X-windows desktop,
philesight is designed to run on a remote server without graphical user
interface. 


Usage 
=====

Philesight can be run in different modes: first, the filesystem is indexed
and the results are stored in a database. When the database is generated, the
tool can used to generate PNG files with the graphs. The database should be
updated every once in a while of course.

 * Index bulding: 
 
 	./philesight --db {db} --index {path}

   {db} is the name of the database file that will be generated. It is a good
   idea to throw away existing database files before indexing to avoid removed
   files showing in your graph.

   {path} is the top-level directory to start indexing. Usually, '/' is a 
   good choice.

   This process might take some time, since it traverses the whole tree
   from path-to-index downward and stores the data into the db. Make
   sure to remove previous database files before indexing.

   You can save on index time and size by using the option '--only-dirs'. This
   will not store all individual files into the index, only the directory
   totals. You might want to use this for indexing multi-TB disks.

 * PNG generating: In this mode, philesight generates a graph of the
   filesystem from path and 4 levels downward. i
   
   	./philesight --db {db} --path {path} --draw {png}

   {db} is the filename of the index file that was generated earlier,
   {path} is the directory which should be drawn, and {png} is the filename
   of the to-be-generated PNG image file


 * CGI: Philesight comes with a CGI module that can be run from within a 
   web server. Edit the configurable parameters in the top of this file
   to point to the database. Make sure the database file is readable by
   the webserver and the philesight.rb module can be found by the CGI.

   Available options:

   * $path_db: Path to database file.

   * $path_cache: Optional path to a directory used for caching generated
     images. Note that this directory should be writable by the httpd user.
     All images older then $cache_maxage seconds are automatically deleted
     every time the CGI is invoked.

   * $img_size: graph size. 800 pixels is a good choice.

   * $img_rings: number of rings = depth of graph. 3 or 4 should be ok
   
   * $img_gradients: use gradient colors in graph (set to 'false' to generate
     smaller PNG files)

   * $show_list: render list of directories and their sizes blow graph.




Dependencies
============

Philesight is written in ruby1.8, and requires the berkely-db4 and cairo
ruby libraries.

On debian, the following should be sufficient:

  # apt-get install libdb4.2-ruby1.8 libcairo-ruby1.8 

On Fedora 10, use

  # yum -y update                                                                                  
  # yum -y install ruby ruby-cairo ruby-bdb      

I've been told the following should work on RedHat/Centos

  # yum -y update                                                                      
  # cd /etc/yum.repos.d/                                                               
  # wget http://centos.karan.org/kbsingh-CentOS-Extras.repo                            
  # wget http://ruby.gfd-dennou.org/products/rpm/RPMS/CentOS/CentOS-DennouRuby.repo         
  # yum -y --enablerepo=kbs-CentOS-Testing install ruby bitmap-fonts ruby-bdb ruby-cairo                                                                         


License
=======

This package is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; version 2 dated June, 1991. This package is distributed in the hope
that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

Changelog
=========

2012-04-27	Fixed require of 'set' class, seems to be needed on some
		ruby distributions.

2012-03-22	Added support for proper counting of hard links (thanks 
		Kyle Bygott)

2011-10-15	Fixed typo in help text. Fixed escaping in HTML output.

2011-05-17	Added an option for not storing all files in the index, only
		directory totals (--only-dirs), this saves considerable on
		index size. (Thanks Hans Lambermont). Changed size to use 
		IEC 60027-2 format (TiB, GiB, MiB, Kib)

2010-11-10	Now possible to specify --skip  more then once (thanks
		Lars Gustäbel)

2010-11-05	Flush bugfix

2010-10-04	Flush fd when writing PNG to prevent corrupted PNG output

2009-12-14	Added --one-file-system option (thanks Simon Bland)

2009-02-18	Removed recently added internationalisation support because
		required libraries are not available in major linux distro's

2009-02-12	Fixed code for ruby 1.9.1 compatibility, added support for
		non-latin1 filenames. (thanks Stanislav Sedov)

2009-01-05	Added --skip option for skipping files while indexing
		Updated documentation for RedHat/Centos dependencies

2008-11-20	Updated documentation; added caching support

2008-11-19	Better escaping of CGI parameters, fixed breaking on '+' in 
		pathnames

2008-11-18	Updated documentation for installation on RedHat/Centos

2008-05-29	Added option (use_gradients) to enable/disable gradients
		in circular graph. Added option to set graph size.

2008-04-16	Added optional table with file list to cgi, some bugfixes,
		increased default graph size to 800. (thanks Guillaume Sachot)

2008-03-17	Fixed bug where no image was shown with CGI's running
		on apache-mpm-worker.

2007-03-12	Fixed crash when indexing file named 'rest'

2006-12-09	Workaround for segmentaion fault with ruby 1.8.5


Bugs
====

    * Philesight is a ruby program, and thus is not particulary fast.
    * Indexing could probably be more efficient.
    * Proper error handling is mostly missing. 
    * Caching is very untested

 
On Wed Dec 12 19:08:43 CET 2007, bill r wrote:
Do you also provide debian packages ?
On Fri Feb 27 17:13:33 CET 2009, Syteks wrote:
Awesome tool for my Centos server, thanks Ico!
On Mon Mar 23 19:09:10 CET 2009, Smar wrote:
Any repository?
On Mon May 11 15:53:56 CEST 2009, doc wrote:
hmmm root@*:/opt/lampp/htdocs/jason/philesight# ./philesight --db spaces --index / --draw drives.png ./philesight.rb:7:in `require': no such file to load -- bdb (LoadError) from ./philesight.rb:7 from ./philesight:5 root@*:/opt/lampp/htdocs/jason/philesight# ./philesight --db spaces.db --index / --draw drives.png ./philesight.rb:7:in `require': no such file to load -- bdb (LoadError) from ./philesight.rb:7 from ./philesight:5 yeah, i installed the the packages and still cant get it to run on a current commandline ubuntu system. :(
On Wed May 27 01:33:11 CEST 2009, neyz wrote:
Beautiful tool, thanks ALOT you just made my day :)
On Tue Jun 2 03:52:13 CEST 2009, /KRM wrote:
I'm also getting the: "`require': no such file to load -- bdb" error. I've got cairo, rcairo and the Berkley dbs installed, but it seems that philesight cannot load the Berkley stuff. Not knowing squat about ruby, i've no idea how to tell it where to find it.
On Mon Oct 5 15:55:54 CEST 2009, gmork123@gmail.com wrote:
nice tool! is use it on my openvz host, which has a lot of (bind) mounts. So I added rio (rio.rubyforge.org) and changed some code to skip mounted dirs ( rio(f_full).mountpoint?() ) Wessel Louwris
On Tue Oct 6 00:46:00 CEST 2009, Essid wrote:
Good Job,a must have tool for any data server Thanks :D
On Thu Oct 8 10:27:25 CEST 2009, yuhl wrote:
to make it work under ubuntu: - read /usr/share/doc/libdb4.6-ruby1.8/README.Debian - invoke update-alternatives --config bdb-1.8.rb - then you will be able to do a: require 'bdb' - so philesight will work
On Tue Nov 24 15:00:59 CET 2009, remke wrote:
Nice tool. Would be nice if I can exclude dir's (like nfs directories, proc, ...) With kind regard, r[dot]schuurmans[at]gmail[dot]com
On Mon Feb 1 12:06:34 CET 2010, krepver wrote:
Thx for the tool! Works great in ubuntu server 8.04. Had to make a ln -s /usr/bin/ruby1.8 /usr/bin/ruby and it worked.
On Thu Feb 11 14:21:01 CET 2010, Tony wrote:
Absolutely awesome thankyou. I installed on a CentOS 5.3 system by following the instructions in your README. I did however had to install the following as well: db4-utils db4 db4-devel ruby-cairo ruby-cairo-devel ruby-cairo-debuginfo (probably didn't need the development packages but I like to have them on my system) The above also installed several other dependencies. Thanks again, Tony.
On Wed Feb 24 17:09:36 CET 2010, Jodokus wrote:
Brilliant tool, thanks! Keep up the good work. Works for my Gentoo boxes.
On Wed Apr 7 01:01:53 CEST 2010, Dragonn wrote:
Is there any way how to exclude more than one folder (--skip)? Second thing what I am missing is to index eg. /usr but show it as / (in url of cgi script) ... Do you understand me? Thank you for this beatiful tool!
On Tue Aug 24 19:07:36 CEST 2010, JAB wrote:
This is great, thanks! I just ran this on a 30 TB filesystem with 25 million files. It took 13.5 hours and produced a 3.6 GB db file. Very reasonable, especially since this is a legacy filesystem that doesn't perform very well. Sometimes it takes on the order of a minute or so for the CGI script to generate a png, but with your caching feature enabled that's not a problem at all. And, unlike filelight, it's handling multi-TB sizes correctly (filelight claimed this 29.5 TB filesystem was only 1,550 GB). The only thing I changed was to add an additional "T" format in filesize_readable on line 485 of philesight.rb. Thanks again for such a wonderful tool!
On Tue Aug 31 17:57:47 CEST 2010, Fil wrote:
This is great, thanks a lot. And you allowed me to save 40Gb on my server :-)
On Mon Oct 4 15:02:54 CEST 2010, James wrote:
Hi - nice tool - minor patch ! def write(data) if @fd then @fd.write(data) else print(data) end # Make sure we flush the cache to disk before we try to read it back...else the first time an image is served it's truncated @fd.flush return data.length end jamesDOTspoonerATgmailDOTcom
On Mon Oct 4 15:12:45 CEST 2010, James wrote:
Erk ... that should have been inside the if clause!
On Mon Oct 4 15:14:52 CEST 2010, zevv wrote:
James, Patch applied - inside the if clause :)
On Thu Nov 4 05:40:26 CET 2010, Troy wrote:
Cause its a web cgi thingy, it might be better to do this as SVG? might render alot faster too.
On Thu Nov 4 22:32:15 CET 2010, Joe E wrote:
Awesome tool! Just what I needed. Works great on Centos 5.5!!
On Fri Nov 5 03:24:01 CET 2010, cgi error wrote:
Getting this error on Ubuntu 10.04.1LTS Server from apache logs (refer info exclude): : undefined method `flush' for nil:NilClass (NoMethodError), \tfrom ./philesight.rb:351:in `write_to_png', \tfrom ./philesight.rb:351:in `draw', \tfrom /var/www/philesight/philesight.cgi:142:in `do_img', \tfrom /var/www/philesight/philesight.cgi:69:in `initialize', \tfrom /var/www/philesight/philesight.cgi:243:in `new', \tfrom /var/www/philesight/philesight.cgi:243, No image gets generated. Works perfectly from cli.
On Fri Nov 5 05:41:39 CET 2010, cgi error wrote:
bug related to the flush patch.. previous version works beautifully.
On Thu Nov 18 20:34:32 CET 2010, Joe E wrote:
Thanks for this most excellent tool!
On Mon Apr 11 07:25:26 CEST 2011, RaceMouse wrote:
Great tool! Keep it up!
On Sun May 15 06:23:36 CEST 2011, jaksco wrote:
Thanks for this! REALLY LOVE IT. Almost exactly what I was looking for.
On Tue May 24 22:20:06 CEST 2011, wrote:
Very nice - works on Oracle Enterprise Linux 5.6 as well.
On Fri Feb 17 21:47:32 CET 2012, wrote:
Thanks, love this. However, is it possible that philesight not display .directories?
On Wed May 23 11:14:24 CEST 2012, Slash wrote:
Great tool. Using it on ~50 servers and it is very useful to quickly see where the disk space is used. Thank you for your time! Slash
On Mon Jul 16 14:55:23 CEST 2012, Space wrote:
Did anybody make it work on Centos 6.3 minimum install + cPanel ? I installed from cpanel ruby + cairo + bdb modules, but I got this error: # philesight --db /index --index / /usr/bin/philesight:5:in `require': no such file to load -- philesight (LoadError) from /usr/bin/philesight:5
On Thu Jan 3 02:13:20 CET 2013, jbiasjr@gmail.com wrote:
When I try it in index mode and I try to view it using philesight.cgi it I just get "Path '/' not find in database" I tried using --only-dirs as well. When I dump the database from the --only-dirs run I get this at the end. /var/www [28309, []] ./philesight.rb:68:in `load': marshal data too short (ArgumentError) from ./philesight.rb:68:in `dump' from ./philesight.rb:67:in `each' from ./philesight.rb:67:in `dump' from ./philesight:115
On Sun Jun 2 08:29:36 CEST 2013, Jon wrote:
To get this working on ruby 1.9 I had to change: require 'philesight' to require_relative 'philesight' in files philesight and philesight.cgi and change the line: draw_section(cr, ang_from, ang_to, r_to, r_to+5, 0.5) if(cr && child_f.nitems > 0) to: draw_section(cr, ang_from, ang_to, r_to, r_to+5, 0.5) if(cr && child_f.count > 0) for file philesight.rb hope this helps others having problems
On Wed Oct 16 13:03:19 CEST 2013, neko wrote:
Some notes on this: If this is not running out of the box check if ruby is 1.8. (ruby --version) -> on Debian I had to use ruby1.8. Just change the #!/usr/bin/ruby to #!/usr/bin/ruby1.8 Also make sure to add --skip /proc when indexing.
On Sat Oct 19 20:19:20 CEST 2013, Tobias wrote:
Hi Zevv, got some good servers indexed with philesight. Now I'm trying get it running on FreeBSD. I took the current version from your site and still have some bugs: - I think sparse files are not handled correctly there. They are counted with there reserved size, not with the actually used size. - Overall the sizes are too high. Maybe the sparse issue. - Images are not drawn(apache24) at the top level folders. Only occasionally when i get to the deeper folders images are there.
On Wed Mar 5 21:11:26 CET 2014, Tassilo wrote:
This is awesome, thank you. One thing, though - it crashes with some UTF-8 filenames on FreeBSD if the locale is set to an UTF-8 one. Workaround is to run env LC_ALL=C philesight ...