LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 06-09-2015, 05:46 AM   #1
dhilenjogi
LQ Newbie
 
Registered: Jun 2015
Posts: 3

Rep: Reputation: Disabled
Check Disk Name, Size and FreeSpace of remote Linux Machine


Hello,

I have linux centos on 3 different machine on which Oracle RAC is implemented.

Now I want to check Disk Name, Size and FreeSpace exist on all 3 remote machine from any of the RAC node.

How could I achieve it? Please help.

Thanks In Advance,
Dhilen

Last edited by dhilenjogi; 06-09-2015 at 05:48 AM.
 
Old 06-09-2015, 05:55 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
For starters, Linux drives really dont have a name, they are part of the "tree"...
Anyway, if you get to the command line, DF schould tell you what you need to know...
Thor

Last edited by ButterflyMelissa; 06-09-2015 at 05:56 AM.
 
Old 06-09-2015, 06:56 AM   #3
dhilenjogi
LQ Newbie
 
Registered: Jun 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for your prompt response, currently I am using below command from 10.37.55.34 machine to get expected results.

ssh 10.37.54.166 'df -h / | cat' 2>&1

But, while executing it, this expects same OS user should be available on remote as I have logged on current machine.

Second thing it is asking for password, which i want to input as command argument.

Thanks In Advance,
Dhilen

Last edited by dhilenjogi; 06-09-2015 at 07:08 AM.
 
Old 06-09-2015, 11:45 AM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,686
Blog Entries: 23

Rep: Reputation: 398Reputation: 398Reputation: 398Reputation: 398
I tried a connect with Putty, I have UFW on my server and did have to allow traffic o port 22 though...
A DF yelds info on the remote system...
As far as machines go: local - Manjaro, remote - Debian

Last edited by ButterflyMelissa; 06-09-2015 at 12:46 PM.
 
Old 06-09-2015, 11:51 AM   #5
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,665

Rep: Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710Reputation: 710
You could set up something like nagios for monitoring your systems.
 
1 members found this post helpful.
Old 06-09-2015, 12:22 PM   #6
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
Quote:
Originally Posted by dhilenjogi View Post
Thanks for your prompt response, currently I am using below command from 10.37.55.34 machine to get expected results.

ssh 10.37.54.166 'df -h / | cat' 2>&1

But, while executing it, this expects same OS user should be available on remote as I have logged on current machine.

Second thing it is asking for password, which i want to input as command argument.

Thanks In Advance,
Dhilen
ssh private-key-encryption:
http://linuxproblem.org/art_9.html

you can get disk labels from blkid.

Last edited by schneidz; 06-09-2015 at 12:24 PM.
 
Old 06-09-2015, 01:07 PM   #7
Sefyir
Member
 
Registered: Mar 2015
Distribution: Linux Mint
Posts: 429

Rep: Reputation: 184Reputation: 184
Quote:
Originally Posted by dhilenjogi View Post
ssh 10.37.54.166 'df -h / | cat' 2>&1
But, while executing it, this expects same OS user should be available on remote as I have logged on current machine.
Second thing it is asking for password, which i want to input as command argument.
Code:
df -h / | cat
You don't need the cat. It doesn't do anything in this situation.

Remember that when running the command ssh without a user set and a command, it will login into the ip address as your current user, then run the command. You must have shell access to run a shell command. You can change the user set by typing ssh username@host rather then just ssh host. You can also set the config in ~/.ssh/config to set hostnames that login with a preset user. A example config to login to Server1 as user admin to ip address 10.37.54.166:
Code:
Host Server1
	user admin
	HostName 10.37.54.166
While technically feasible to input a password into ssh when asking for a password, using public keys is significantly more safer and much better practice.
 
Old 06-15-2015, 09:36 AM   #8
dhilenjogi
LQ Newbie
 
Registered: Jun 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for your response, In my case sshpass worked as below.

sshpass -p 'password' ssh mfi_dev@10.37.54.166 'df -h'

Afterwords I tried to get status of oracle listener using command,

lsnrctl status

While executing it from command prmpt, able to get result but, while executing it using Java getting below error.

Error 1

"Close requested by remote"

Please help.

Thanks in advance

Dhilen
 
  


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
[SOLVED] Check for condition on remote machine before running command? soupmagnet Linux - Newbie 2 01-03-2013 11:31 AM
How to check the hard disk size in linux Xberry LinuxQuestions.org Member Intro 4 11-08-2011 01:54 PM
can I check HP CP-1215 toner levels from a remote machine? garydale Linux - Hardware 3 12-03-2010 10:52 AM
How to check the Listening url in the remote machine winxandlinx Linux - Security 5 07-11-2010 09:56 PM
check freespace and something like treesize ninmonkeys Linux - General 1 11-09-2004 02:22 AM


All times are GMT -5. The time now is 10:45 AM.

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