diskover - File system crawler, disk space usage, file search engine and storage analytics powered by Elasticsearch

License Release Sponsor Patreon Donate PayPal

diskover

diskover is an open source file system crawler and disk space usage software that uses Elasticsearch to index and manage data across heterogeneous storage systems. Using diskover, you are able to more effectively search and organize files and system administrators are able to manage storage infrastructure, efficiently provision storage, monitor and report on storage use, and effectively make decisions about new infrastructure purchases.

As the amount of file data generated by businesses continues to expand, the stress on expensive storage infrastructure, users and system administrators, and IT budgets continues to grow.

Using diskover, users can identify old and unused files and give better insights into data change, file duplication and wasted space. diskover supports crawling local file-systems, crawling NFS/SMB, through TCP sockets using the Tree Walk Client or using http with the Storage Agent. Importing Amazon S3 inventory files is also supported. Plugins can be used for adding additional meta data.

diskover is written and maintained by Shirosaidev and runs on Linux, OS X/macOS and Windows 10 (using windows subsystem for linux) using Python 2 or 3.

diskover requires an auth token to run, learn more on the wiki. Sign up to receive your auth token at https://diskoverspace.com/diskover/.


This is the first tool I've found that can index 7m files/2m directories in under 20 min

-- linuxserver.io community member


diskover diagram

Architecture diagram ## Screenshots diskover crawler and workerbots running in terminal
diskover crawler diskover worker bot
[diskover-web](https://github.com/shirosaidev/diskover-web) (diskover's web file manager, analytics app, file system search engine, rest-api)
diskover-web dashboard diskover-web file tree diskover-web advanced search diskover-web tags
Kibana dashboards/saved searches/visualizations and support for Gource
kibana-screenshot diskover-gource ### diskover Gource videos gource video gource video ## Become a Patron & support shedding light on data darkness If you are a fan of the project or you are using diskover and it's helping you save storage space, please consider supporting the project on [Patreon](https://www.patreon.com/shirosaidev) or [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=CLF223XAS4W72). Thank you so much to all the fans and supporters! ## Enterprise vs community versions If you are a business and would like to inquire about diskover enterprise, please visit https://diskoverspace.com to learn more and to contact us. ## Installation Guide **For a detailed install guide for linux, please see the [Install Guide wiki page](https://github.com/shirosaidev/diskover/wiki/Installation-Guide)** ### Requirements * `Linux or OS X/macOS` (tested on OS X 10.11.6, Ubuntu 16.04/18.04), `Windows 10` (using Windows Subsystem for Linux) * `Python 2.7. or Python 3.5./3.6.` (tested on Python 2.7.15, 3.6.5) **Python 3 recommended** * `Python elasticsearch client module` * `Python requests module` * `Python scandir module` * `Python progressbar2 module` * `Python redis module` * `Python rq module` * `Elasticsearch 5.6.x` (local or [AWS ES Service](https://aws.amazon.com/elasticsearch-service/), tested on Elasticsearch 5.6.9) **Elasticsearch 6 not supported, ES 7 supported in Enterprise version** * `Redis 4.x` (tested on 4.0.9) **See requirements.txt for specific python module version numbers since newer versions may not work with diskover.** ### Optional Installs * [diskover-web](https://github.com/shirosaidev/diskover-web) (diskover's web file manager and analytics app) * [storage agent](https://github.com/shirosaidev/diskover-storage-agent) (diskover's storage agent for running on remote storage) * [tree walk client](https://github.com/shirosaidev/diskover-treewalk-client/) (diskover's tree walk client for running on remote storage) * [saisoku](https://github.com/shirosaidev/saisoku) (data sync/mover between on-prem to cloud, etc) * [sharesniffer](https://github.com/shirosaidev/sharesniffer) (for scanning your network for file shares and auto-mounting for crawls) * [Redis RQ Dashboard](https://python-rq.org/docs/monitoring/) (for monitoring redis queue) * [Kibana](https://www.elastic.co/products/kibana) (for visualizing Elasticsearch data, tested on Kibana 5.6.9) * [X-Pack](https://www.elastic.co/downloads/x-pack) (Kibana plugin for graphs, reports, monitoring and http auth) * [netdata](https://my-netdata.io/) (for realtime monitoring cpu/disk/mem/network/elasticsearch/redis/etc metrics, plugin for rq-dashboard in netdata directory) * [Grafana ES dashboard](https://grafana.com/dashboards/878) (Grafana dashboard for Elasticsearch) * [crontab-ui](https://github.com/alseambusher/crontab-ui) (web ui for managing cron jobs - for scheduling crawls) * [cronkeep](https://github.com/cronkeep/cronkeep) (alternative web ui for managing cron jobs) * [Gource](http://gource.io) (for Gource visualizations of diskover Elasticsearch data, see videos above) ### Download ```sh $ git clone https://github.com/shirosaidev/diskover.git $ cd diskover ``` [Download latest version](https://github.com/shirosaidev/diskover/releases/latest) ## Getting Started In order to run diskover, you first need to create an account and get your auth code at https://diskoverspace.com/diskover/ Once you have created an account and verified, login to receive your auth token. You can learn more about where to [set your auth token](https://github.com/shirosaidev/diskover/wiki/Auth-token) on the wiki. Check Elasticsearch and Redis are running and are the required versions (see requirements above). ```sh $ curl -X GET http://localhost:9200/ $ redis-cli info ``` Install Python dependencies using `pip`. ```sh $ pip install -r requirements.txt ``` Copy diskover config `diskover.cfg.sample` to `diskover.cfg` and edit for your environment. Start diskover worker bots (a good number might be cores x 2) with: ```sh $ cd /path/with/diskover $ python diskover_worker_bot.py ``` Worker bots can be added during a crawl to help with the queue. To run a worker bot in burst mode (quit after all jobs done), use the -b flag. If the queue is empty these bots will die, so use `rq info` or `rq-dashboard` to see if they are running. To start up multiple bots, run: ```sh $ cd /path/with/diskover $ ./diskover-bot-launcher.sh ``` By default, this will start up 8 bots. See -h for cli options including changing the number of bots to start. Bots can be run on the same host as the diskover.py crawler or multiple hosts in the network as long as they have the same nfs/cifs mountpoint as rootdir (-d path) and can connect to ES and Redis (see wiki for more info). **Edit this file and check the paths are set correct at the top of the file to the same version of Python that you will be running diskover.py with, they need to be the same or you could run into issues.** ### Usage examples See all [cli options](https://github.com/shirosaidev/diskover/wiki/CLI-options) in the wiki. Start diskover main job dispatcher and file tree crawler with (using adaptive batch size and optimize index cli flags): ```sh $ python /path/to/diskover.py -d /rootpath/you/want/to/crawl -i diskover-indexname -a -O ``` **Defaults for crawl with no flags is to index from . (current directory) and files >0 Bytes and 0 days modified time. Empty files and directores are skipped (unless you use -s 0 and -e flags). Symlinks are not followed and skipped. Use -h to see cli options.** Don't prompt user to overwrite existing index: ```sh $ python /path/to/diskover.py -d /rootpath/you/want/to/crawl -i diskover-indexname -a -O -F ``` Use 32 tree walk threads (default is cpu cores x 2): ```sh $ python /path/to/diskover.py -d /rootpath/you/want/to/crawl -i diskover-indexname -a -T 32 ``` Crawl down to maximum tree depth of 3: ```sh $ python diskover.py -i diskover-indexname -a -d /rootpath/to/crawl -M 3 ``` Only index files which are >90 days modified time and >1 KB filesize: ```sh $ python diskover.py -i diskover-indexname -a -d /rootpath/to/crawl -m +90 -s 1024 ``` Only index files which have been modified in the last 7 days including empty files and dirs: ```sh $ python diskover.py -i diskover-indexname -a -d /rootpath/to/crawl -m -7 -s 0 -e ``` Distribute file meta collecting amongst bots and split file lists for directories with many files (can help to keep all bots busy if your file tree has directories with many files): ```sh $ python diskover.py -i diskover-index -a -d /rootpath/to/crawl --splitfiles --splitfilesnum 5000 --chunkfiles --chunkfilesnum 500 ``` Find [duplicate files](https://github.com/shirosaidev/diskover/wiki/Duplicate-files-(dupes)) in an index (after crawl finishes): ```sh $ python diskover.py -i diskover-indexname -a --finddupes ``` Find ["hot dirs"](https://github.com/shirosaidev/diskover/wiki/Comparing-(diff)-files-between-two-indexes) and change % between two indices (after crawls are complete): ```sh $ python diskover.py -i diskover-latestindex -a -H diskover-previndex ``` Store [cost per gb](https://github.com/shirosaidev/diskover/wiki/Cost-per-GB) (Enterprise ver. only) in es index from diskover.cfg settings and use size on disk (disk usage) instead of file size: ```sh $ python diskover.py -i diskover-index -a -d /rootpath/to/crawl -G -S ``` Tree walk and enqueue all jobs into RQ with no bots running (don't wait for bots). This could allow you to tree walk during the day and build up a large queue of all the crawl jobs with no stat calls hitting the storage and then in the evening start up the bots to do the crawl jobs and the heavy stating on the storage: ```sh $ python diskover.py -i diskover-index -a -d /rootpath/to/crawl --nowait ``` Create index with just level 1 directories and files, then run background crawls in parallel for each directory in rootdir and merge the data into same index. After all crawls are finished, calculate rootdir doc's size/items counts. This could be used if you want to get a very high queue fill rate on a very large directory tree and a regular diskover crawl is not filling the queue fast enough and bots are starved for jobs: See [parallel crawl script](https://github.com/shirosaidev/diskover/blob/master/scripts/parallel_crawl.sh) for an example of scripting this. ```sh $ python diskover.py -i diskover-indexname -a -d /rootpath/to/crawl --maxdepth 1 $ python diskover.py -i diskover-indexname -a -d /rootpath/to/crawl/dir1 --reindexrecurs -q & $ python diskover.py -i diskover-indexname -a -d /rootpath/to/crawl/dir2 --reindexrecurs -q & ... $ python diskover.py -i diskover-indexname -a -d /rootpath/to/crawl --dircalcsonly --maxdcdepth 0 ``` ## OVA image file (for vmware, etc) Becoming a Patron gets you access to the OVA files running the latest version of diskover/diskover-web. Fastest way to get up and running diskover. Check out the [Patreon](https://www.patreon.com/shirosaidev) page to learn more about how to get access to the OVA downloads. ## Docker You can set up diskover and diskover-web in docker, there are a few choices for easily running diskover in docker using pre-built images/compose files. [linuxserver.io](https://linuxserver.io) Docker hub image: https://hub.docker.com/r/linuxserver/diskover/ https://blog.linuxserver.io/2019/06/28/getting-started-with-diskover-in-docker/ [diskover-web](https://github.com/shirosaidev/diskover-web) has Dockerfile with instructions for docker-compose. Detailed docker install guide for diskover https://engineerworkshop.com/2020/02/04/how-to-monitor-disk-usage-and-growth-with-diskover/ ## User Guide [Read the wiki](https://github.com/shirosaidev/diskover/wiki) for more documentation on how to use diskover. ## Discussions/Support For discussions or support for diskover join the [diskover Slack workspace](https://join.slack.com/t/diskoverworkspace/shared_invite/enQtNzQ0NjE1Njk5MjIyLWI4NWQ0MjFhYzQyMTRhMzk4NTQ3YjBlYjJiMDk1YWUzMTZmZjI1MTdhYTA3NzAzNTU0MDc5NDA2ZDI4OWRiMjM), my username is @shirosai. You can also post a comment/question on [Google Group](https://groups.google.com/forum/?hl=en#!forum/diskover). ## Bugs For bugs about diskover, please use the [issues page](https://github.com/shirosaidev/diskover/issues). ## License See the [license file](https://github.com/shirosaidev/diskover/blob/master/LICENSE).