script to report disk usuage from all storage devices

I need a script to report disk usage of network storage and local filesysystem
huzzakAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
arnoldConnect With a Mentor Commented:
Don't know AIX, but this could be a start. You will have an extra column on the end but can be handled if needed.
do you have a host table?
Do you have an user with ssh-keygen authorized to login into the other systems?  The user does not need to be root.


#!/bin/sh

(
echo " To: <youremailaddress>
From: <senderinformation.
Subject: Disk Usage Report
" 
cat host_table_file | while read a; do
echo "Checking Server: $a"
/usr/bin/ssh limiteduser@$a /bin/df -k | /usr/bin/perl -e 'while (<STDIN>) { chomp(); @array=split(/\s+/,$_); foreach $key (@array) { print "$key,";} }'
echo
echo "Finished checking Server: $a"
done )| /usr/bin/sendmail -t -oi

Open in new window

0
 
SuperdaveCommented:
What kind of report?  Something beyond just"df"?
0
 
huzzakAuthor Commented:
yeah space usage..."df" would work...but I have 31 aix servers and want to get report from all the servers...
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
huzzakAuthor Commented:
also if the output can be generated to be viewed in Excel (csv format)
it's HP SAN storage filesystem...and need the disk usage report of all the LUNs
0
 
huzzakAuthor Commented:
yes I have the list of servers....thank you, I'll give this a try
0
 
drewrockshardCommented:
Have you heard of pssh?  You could write a script, and have pssh run the command on all servers at the same time.  There's more to it than just "set it up", but this sounds like something that you could benefit from.
0
 
abolinhasCommented:
primeiro tens que instalar o ssh no ubuntu
# sudo apt-get install openssh-server openssh-client

depois tens de criar um NAT no teu router a porta 22 para o ip do teu servidor.
0
 
abolinhasCommented:
please, ignore my last comment.
0
 
huzzakAuthor Commented:
none
0
All Courses

From novice to tech pro — start learning today.