LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Check Disk Name, Size and FreeSpace of remote Linux Machine (https://www.linuxquestions.org/questions/linux-newbie-8/check-disk-name-size-and-freespace-of-remote-linux-machine-4175544888/)

dhilenjogi 06-09-2015 04:46 AM

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

ButterflyMelissa 06-09-2015 04:55 AM

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

dhilenjogi 06-09-2015 05:56 AM

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

ButterflyMelissa 06-09-2015 10:45 AM

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

smallpond 06-09-2015 10:51 AM

You could set up something like nagios for monitoring your systems.

schneidz 06-09-2015 11:22 AM

Quote:

Originally Posted by dhilenjogi (Post 5374514)
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.

Sefyir 06-09-2015 12:07 PM

Quote:

Originally Posted by dhilenjogi (Post 5374514)
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.

dhilenjogi 06-15-2015 08:36 AM

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


All times are GMT -5. The time now is 12:29 AM.