Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-21-2013, 02:08 AM   #1
LQ Newbie
Registered: Dec 2011
Posts: 3

Rep: Reputation: Disabled
check disk space of multiple computers in a network

Can I get the output of df -h of multiple systems in the network by a command or a script rather than checking each system.
For eg: Specifying the range of ip addresses viz..192.168.1.x to 192.168.1.x ...something like that.

Old 01-21-2013, 03:54 AM   #2
Registered: Dec 2011
Distribution: Gentoo
Posts: 47

Rep: Reputation: 2
to get remote df you can do : ssh $REMOTE_IP $COMMAND, for example ssh df -h
Old 01-21-2013, 06:01 AM   #3
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
For just one time checking and if you can enter password each time with ssh command, you can:
IPLIST=/tmp/listofips # Contains a list of ip addresses, each per line
while read -r ip
echo "$ip" >> $RESULTFILE
echo "-------------------" >> $RESULTFILE
ssh username@$ip "df -h" >> $RESULTFILE # It will ask for username's password everytime it executes
echo "-------------------" >> $RESULTFILE
done < $IPLIST
On the other hand, if you want to do it daily or periodically (like automation or cronjob), you better go with concept of password less login on those system and then execute this script.

Last edited by shivaa; 01-21-2013 at 06:04 AM. Reason: Code modified
2 members found this post helpful.
Old 01-22-2013, 06:51 AM   #4
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Wheel reinvention-wise there's tools dealing with ^whatever.on.*multiple hosts like ClusterSSH, Dsh, Fanout / Fanterm, Tentakel, Shocto, SwitchTower, MUC, Parallel SSH and RGANG. Going a whole different route getting stats without even requiring SSH or password-less logins is possible too with a simple (X)inetd-based script or using SNMP.
Old 01-22-2013, 01:15 PM   #5
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Additionally, one can simply set up a network monitoring program such as Nagios or Zenoss to check the status and health of multiple computers, send alerts, etc. Ultimately, this is the most scalable solution, but it requires a bit more work up front to get going.
Old 01-22-2013, 01:45 PM   #6
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 891

Rep: Reputation: 119Reputation: 119
+1 nagios. I'm running a few servers (backup server, DNS servers, web Servers, Monitor servers) and I have 1 simple login to nagios which gives me the load, diskspace, login users, etc on a charge through nrpe plugin.

its simple to install but may be a little tough to configure at first but once you understand it becomes easy and highly configurable. It will all email notifications such as low diskspace. nagios doesn't use much resources at all either.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check the whole disk space? thomas2004ch Linux - Newbie 7 08-06-2012 06:41 AM
[SOLVED] how to check disk space mario.almeida Linux - Server 8 09-26-2010 07:16 AM
ran df to check space and multiple /etc? spooge Slackware 7 11-22-2009 03:54 AM
How do you check disk space? verlaine Linux - Software 4 11-12-2006 02:57 PM
How do you check disk space? tim1348 Linux - Newbie 10 10-31-2006 10:39 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:43 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration