How To Monitor Hard Drive Usage In Ubuntu Server Using The Visual Philesight CGI Script
How To Monitor Hard Drive Usage In Ubuntu Server Using The Visual Philesight CGI ScriptThis process will add a nice visual representation of the hardrive usage on your Ubuntu server which you can acces over your local network. It's based on "philesight" which is a nice clone of philelight. Philesight is available at http://zevv.nl/play/code/philesight/. Assuming you already have an Ubuntu LAMP (linux apache mysql php) server with the web root at /var/www and have accesss to the ubuntu terminal carry, out the following. Install dependancies: sudo apt-get install libdb4.2-ruby1.8 libcairo-ruby1.8 libapache2-mod-perl2 libapache2-mod-php5 ruby Enable cgi scripting if not already: sudo mkdir /usr/lib/cgi-bin Edit your apache2 site file: sudo nano /etc/apache2/sites-available/default Make sure there is a section that reads as follows: ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ Close and save (ctrl-x then y). Get philesight: mkdir ~/downloads Unzip philesight and move it into the desired directory. tar -xvf philesight-20120427.tgz Move the ruby functions into place and make them executable: sudo mv philesight /usr/bin/philesight Edit the philesight file to correctly locate itself when called from a cron job: sudo nano /usr/bin/philesight Edit the line which currently reads: require 'philesight' to read instead: require '/usr/bin/philesight' Close and save. Prepare directory database: cd /usr/bin/ This may take some time to run depending on the amount of data on your harddrive. Prepare your web files: cd ~/downloads/philesight Edit the following parameters to read as follows: $path_db = "/usr/lib/philesightdb" Exit and save. Copy the cgi script into place and make it executable: sudo mv philesight.cgi /usr/lib/cgi-bin/philesight.cgi Make the ruby scripts available to the cgi file: sudo ln -s /usr/bin/philesight.rb /usr/lib/cgi-bin/philesight.rb Reload the webserver: sudo apache2ctl restart The hard drive usage of your server will now be available at: http://your_server_name/cgi-bin/philesight.cgi When you first load it you may see a graph indicating that 100% of your Hard disk is useed up by "proc". Ignore this and scrole down and you will see a list of folders located in the root directory. Clicking on each of these will give a visual representation of the material containined with in each. Now we're going to add a cron job so the images update at least daily. sudo nano /etc/cron.daily/philesight Copy in the following lines then close and save: #!/bin/sh Now make that cron job executable: sudo chmod a+x /etc/cron.daily/philesight
|



Recent comments
2 days 5 hours ago
2 days 14 hours ago
2 days 17 hours ago
2 days 18 hours ago
2 days 19 hours ago
2 days 21 hours ago
2 days 22 hours ago
3 days 1 min ago
3 days 15 hours ago
3 days 16 hours ago