LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-07-2010, 06:09 AM   #1
jhunex909
LQ Newbie
 
Registered: Jan 2010
Posts: 2

Rep: Reputation: 0
Smile Checking the disk usage of different linux servers using df -h linux command


Anybody knows how to Check the disk usage of different linux servers using df -h linux command. My host server is 66.50.100.1, I can check its disk usage by using df -h command. I got my disk usage. Now using my host server Im going to check the server 66.50.100.3 disk usage. Is its possible to check the disk usage of 66.50.100.3 using my host server?. Please advice... Thanks..

Last edited by jhunex909; 01-07-2010 at 06:09 AM. Reason: no tags
 
Old 01-07-2010, 06:34 AM   #2
zQUEz
Member
 
Registered: Jun 2007
Distribution: Fedora, RHEL, Centos
Posts: 294

Rep: Reputation: 54
Create an ssh rsa key, with no passphrase, on the remote host(s).
Then from your server, ssh into that server using the private identity file and throw a single command:

`ssh accountname@66.50.100.3 "df -h"`
 
Old 01-07-2010, 06:39 AM   #3
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,274

Rep: Reputation: 148Reputation: 148
Do you want to check disk usage periodically for all of your remote servers? Don't you use any monitoring tools like nagios, openNMS, MRTG etc
 
Old 01-07-2010, 11:59 PM   #4
jhunex909
LQ Newbie
 
Registered: Jan 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks zQUEz and Kirukan.. I think ssh accountname@66.50.100.3 "df -h" is the one good answer to my problem. Create an ssh rsa key, with no passphrase, on the remote host(s) How can I do this one?.

Thanks for the advice..
 
Old 01-09-2010, 07:07 AM   #5
zQUEz
Member
 
Registered: Jun 2007
Distribution: Fedora, RHEL, Centos
Posts: 294

Rep: Reputation: 54
assume server=66.50.100.1, remotesvr=66.50.100.3
On remotesvr, run `ssh-keygen` and follow the prompts to create an rsa-id. When asked for a passphrase, just press enter as you don't want a passphrase. You should end up with 2 files. One will be "something.pub" and the other maybe id-rsa or whatever you told it to call it. The .pub file will be 1 long line (might break across rows) and is the public key.
Still on remotesvr, (and ssh-keygen may have done this for you, i can't remember),
`mkdir ~/.ssh~
`chmod 700 ~/.ssh`
copy the .pub file above, and rename it to "~/.ssh/authorized_keys2".
`chmod 600 ~/.ssh/authorized_keys2`.
Copy the rsa-id file to server and call whatever you like. You should keep this file secure.

On server, ssh into remotesvr using the command: `ssh -i rsa-id usera@remotesvr` - the first time you will have to confirm the remote ID. This is a one time thing.
 
  


Reply


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
command for disk usage ZAMO Solaris / OpenSolaris 1 05-08-2008 08:18 AM
Linux Application Disk and Memory Usage kushalag Linux - Software 4 08-03-2007 06:26 PM
Other than top command which cmd is used to find the cpu usage and disk space sathish80 Linux - Newbie 2 11-15-2006 12:43 AM
checking memory usage from command line wrepti Linux - General 2 06-16-2004 10:24 PM
command for checking system resource usage? yeahoo7 Linux - Networking 3 06-11-2003 11:31 PM


All times are GMT -5. The time now is 12:23 PM.

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