Seeing output of command over ssh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Seeing output of command over ssh
# 1  
Old 08-23-2013
Seeing output of command over ssh

Hey Guys,

i have a script that generates logs at our isilon storage.

The part of the script is to geneate logs and grep its name:
Code:
VAR=`ssh -o UserKnownHostsFile=/dev/null root@XXX isi_gather_info | grep -i "Package:" | awk '{ print $2 }'`

Now , while this is run, i do not see the status of the logs creatation:

Code:
[XX@XX ~]$ sudo ./isilogs.sh 
Welcome root
Running isi_gather_info on the remote server
The authenticity of host 'XX)' can't be established.
DSA key fingerprint is 5e:2b:f6:80:b6:62:33:78:f5:6f:00:32:a4:f7:d0:f7.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'XX' (DSA) to the list of known hosts.
Password:

The generation works fine , but there is no way to know if the script is actually running or if its hung.

However , when i run this locally on the isilion i can see logs being generated:
Code:
Code:
XX-1# isi_gather_info
Unlocking gather-status
Gather-status unlocked
Error running "isi firmware status"
This may take several minutes. Please do not interrupt the script. .....................

Anyone has a clue how can i make this output appear when i run the script on a remove linux server?

Thanks for help in advance

Last edited by anshulsahdev; 08-23-2013 at 09:36 PM..
# 2  
Old 08-24-2013
Not sure I understand the entire post, but as your command's stdout finally ends up in VAR after piping it several times, what be the contents of VAR?
# 3  
Old 08-24-2013
Giving you the idea, I am assuming you are using IBM storage.

Code:
ssh admin@yourstorageip isi_gather_info

Through above command you will able to see something on your linux server. If not working please more detail.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read several variables from command output via SSH

Hi Folks, I'm currently trying to read several values into different variables. Actually, what I'm doing works, but I get an error message. My attempts are: read strCPROC strIPROC strAPROC <<<$(ssh -n -T hscroot@$HMC "lshwres -r proc -m $strIDENT --level sys -F \"configurable_sys_proc_units... (11 Replies)
Discussion started by: NKaede
11 Replies

2. Shell Programming and Scripting

Ssh output

Hi, I need to get the output of ssh for multiple servers using for loop which is returning how many users are logged in, one below the other. But i'm getting output in single line for one of the servers. XXXX pts/0 Oct 18 08:45 abcd pts/3 Oct 18 06:46 abcde pts/4 Oct 18 06:46 xyzqw pts/5 Oct 18... (14 Replies)
Discussion started by: sam_bd
14 Replies

3. Shell Programming and Scripting

Error in SSH output.

Hi All, I am using below command in a shell script. ssh -q RemoteUser@RemoteServer "/export/sctipt/test.ksh" It is executing succesfully but the below is the output getting displayed. tset: standard error: Invalid argument Can you please help me in understanding below. ... (8 Replies)
Discussion started by: Girish19
8 Replies

4. Shell Programming and Scripting

Insert title as output of command to appended file if no output from command

I am using UNIX to create a script on our system. I have setup my commands to append their output to an outage file. However, some of the commands return no output and so I would like something to take their place. What I need The following command is placed at the prompt: TICLI... (4 Replies)
Discussion started by: jbrass
4 Replies

5. UNIX for Dummies Questions & Answers

Output of ssh command from localhost - direct to local file.

Hi, i'm trying to gather details from remote hosts and want them to be written to my local linux machine from where i'm using SSH. My command looks some thing like this ssh -q remotehost 'bash -s' <command.txt where command.txt is a file in my local machine containing ps -ef |grep httpd |... (1 Reply)
Discussion started by: poga
1 Replies

6. Red Hat

Command understanding the output file destination in case of standard output!!!!!

I ran the following command. cat abc.c > abc.c I got message the following message from command cat: cat: abc.c : input file is same as the output file How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies

7. Shell Programming and Scripting

Logging Remote SSH command (cannot log a java output)

Hi all I'm creating a script that runs a few commands on some boxes and everything can be logged EXCEPT the java -version command, there doesn't seem to be any output... Can anyone help explain why this does not work? Do I need to do something extra to append the output from the java... (3 Replies)
Discussion started by: Keepcase
3 Replies

8. Shell Programming and Scripting

Net::SSH::Perl->Execute any unix command & display the output in a proper form

Net::SSH::Perl ...... how to print the output in a proper format my $cmd = "ls -l"; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd("$cmd"); print $stdout; the script works fine, but i am unable to see the output... (2 Replies)
Discussion started by: gsprasanna
2 Replies

9. UNIX for Dummies Questions & Answers

Command display output on console and simultaneously save the command and its output

Hi folks, Please advise which command/command line shall I run; 1) to display the command and its output on console 2) simultaneous to save the command and its output on a file I tried tee command as follows; $ ps aux | grep mysql | tee /path/to/output.txt It displayed the... (7 Replies)
Discussion started by: satimis
7 Replies

10. BSD

DF output via SSH

I'm trying to understand what is happening. The "setup". System running OpenBSD 3.3 Connect to the system using PuTTy or with the SSH.COM SSH client, issue a DF command. First line that comes back is: Filesystem 1K-blocks Used Avail Capacity Mounted on When I connect the the... (13 Replies)
Discussion started by: woodstone
13 Replies
Login or Register to Ask a Question