Mar 12, 2011

Unix host disk usage HTML report

Below can provide the disk usage from multiple hosts in a HTML format report sorted with usage percentage.

Echo “From: Deva
To: someone@mail.com
MIME-Version: 1.0
Content-Type: text/html
Subject: Disk_usage" > te12
 
check_lvnodes 'df -g |sed "s/^/`hostname`_/g"' > teak;check_lvwebs 'df -g|sed "s/^/`hostname`_/g"' >> teak;
\(cat te12;echo "

";sort -nr -k4 teak |awk -F" " '$4 > 50'|head -300|sed '/Mounted/d;s/  */ /g;s/ /\&lt
\;\/td\>\/g;s/$/\<\/td\>\<\/tr\>/g;s/^/\\/')|sendmail –t    
DevtotalFreeUsedIfreeIUsedMount

No comments:

Post a Comment