We are moving!

 
We are currently migrating the old library to a new one. Please, do not UPLOAD or modify any of your plugins/modules. Please wait until 1st January 2018. New library site will be at https://pandorafms.com/library with a better interface. We're working hard to move all the modules/plugins from this site to the new one.
 
----------------------------------------------------------------
 
This is a library with modules, documentation and tools for Pandora FMS users, both public Open Source and Enterprise. Please use your support credentials (same as used to enter support/ticketing system) in the menu to your right. You will be granted access to a resourceful module library, such as Oracle, VMware, JBoss and others, ready to be used in production enviroments, with official professional support from Artica. If you do not own an enterprise account, you still can browse and download lots of modules, you can even register a free account and contribute with your own modules/tools for other public users.

Home > Operating Systems > Linux

Disk Space

Author: daniels Create in: 03/02/2010 Update in: 01/01/1970
Rating:
Module type : Local module


Show amount of disk space free or used.

Module data

module_begin
module_name dsk_home_free
module_type generic_data
module_exec df -kh /home | tail -1 | awk '{NF--; print 100-$NF }'
module_max 100
module_min 0
module_description Free disk (%) of home partition
module_end

module_begin
module_name dsk_root_free
module_type generic_data
module_exec df -kh / | tail -1 | awk '{NF--; print 100-$NF }'
module_max 100
module_min 0
module_description Free disk (%) of root partition
module_end

-----------------------------------------------------------------------------
If you want the % of disk usage, remove the 100 and add a tr -d to remove the % sign:

ex:
module_exec df -kh / | tail -1 | awk '{NF--; print $NF }' | tr -d "%"