how to run top or glance non-interactively using ssh


 
Thread Tools Search this Thread
Operating Systems HP-UX how to run top or glance non-interactively using ssh
# 1  
Old 10-07-2011
how to run top or glance non-interactively using ssh

Hello

Am trying to run top /glance non-interactively using ssh
from redhat to hp-ux hosts
but getting following errors..

=======================
Code:
 ssh msi 'top -n 1'
Sorry, I need to know a more specific terminal type than "unknown".

ssh msi top -d1 -n20 > /tmp/top.out
Sorry, I need to know a more specific terminal type than "unknown".

===================
Any idea on how to resolve the issue ?

Thank you

Last edited by vbe; 10-07-2011 at 10:23 AM..
# 2  
Old 10-07-2011
Have you tried the other way round, or accessing another RedHat?
I dont believe it has anything to do with ssh but more the way top or glance work...
# 3  
Old 10-07-2011
-t -t to force ssh to use a tty on the remote host will help. You can also force TERMINAL to something valid.

Code:
ssh -t -t msi 'TERMINAL="vt100" top -n 1'

Of course, your output could be full of escape sequences since top thinks its talking to a terminal...
# 4  
Old 10-07-2011
Quote:
Originally Posted by Corona688
-t -t to force ssh to use a tty on the remote host will help. You can also force TERMINAL to something valid.

Code:
ssh -t -t msi 'TERMINAL="vt100" top -n 1'

Of course, your output could be full of escape sequences since top thinks its talking to a terminal...
Wonderfull, worked perfectly !!

Thnx very much
This User Gave Thanks to delphys For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Traverse through list of servers using ssh non-interactively.

I have 300 servers listed in servers.txt I motto is to check if my id "user1" has sudo privileges on the 3000 servers. I m using sudo -l to check if I have privileges or not. If wish to check this either non-interactively; if not; interactively. Below is the script I wrote: ... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. Shell Programming and Scripting

Run multiple commands in ssh

Hi All, I have the below requirement. I want to copy the local file to remote after that i need to run the local script on a remote machine.When i use two ssh commnds i can achieve this. But i want to achieve this using one ssh command. Below command to copy the local file to remote ssh -q... (2 Replies)
Discussion started by: mohanalakshmi
2 Replies

3. UNIX Desktop Questions & Answers

How to run addtional Shells on top of the default shell

Hi What is the command to run additional available shells on top of default shell. I am using bash also how can i tell that the additional shells are actually running? Also what is the advantage of running additional shells on top of your default login shell of bash? Lastly... (1 Reply)
Discussion started by: Bill Thompson
1 Replies

4. Shell Programming and Scripting

run command with ssh[solved]

Hi all, Is it possible to make this possible ? $ echo $SKY_HOME /var/sink/SKY $ echo $SKY_HOME /home/smily/SKY $ ssh root@xyz "echo $SKY_HOME" root@xyz 's password: ****** /home/smily/SKY wrong output I was expecting the output as /var/sink/SKY (3 Replies)
Discussion started by: linuxadmin
3 Replies

5. HP-UX

how to run glance over ssh in batch mode

Hello; Is it possible to run glance over ssh in batch mode ?? Similar to running " top -f " command over ssh.. Need to get glance output for specific pids Thnx very much (5 Replies)
Discussion started by: delphys
5 Replies

6. Shell Programming and Scripting

how to format ssh top output

Hello; Am trying to generate runaway proc report using ssh thusly: =================== ssh -t -t $BOX 'TERMINAL="vt100" top -d1 -h -n 10' >> $FILE . . cat $FILE | mail -s "Latest Top `date`" $MAIL_TO ==================== But the output to e-mail comes out rather garbled .. Any ideas... (1 Reply)
Discussion started by: delphys
1 Replies

7. Shell Programming and Scripting

ssh to run bash script

I want to use ssh to start a bash script that I have uploaded to a webhost. How do I do that from linux? (2 Replies)
Discussion started by: locoroco
2 Replies

8. Solaris

Run command on sc via ssh

when i run a command on ALOM via ssh i get following error ssh root@10.23.12.51 showhosts Password: Waiting for daemons to initialize... Daemons ready shell: Invalid credentials how can i run commands without actually loging to the sc (3 Replies)
Discussion started by: fugitive
3 Replies

9. Shell Programming and Scripting

Error while executing glance using ssh

Hi, I'm running glance ussing ssh from a "HP-UX" machine for a Sun machine. Here is a sample code:- x:- HP-UX y:- Sun Extracting a value from glance outuput. ssh x@y "/opt/perf/bin/glance -f -adviser_only -iterations 2 -maxpages 1 > glance.op ; echo `head -1 glance.op | a wk '{print... (0 Replies)
Discussion started by: bishweshwar
0 Replies

10. Windows & DOS: Issues & Discussions

How do you run Unix on top of Windows?

Okay, so here's my dealio. I have a (rather old) system that runs Windows 98 Second Edition. What i wanna do is be able to run Unix from it. My question is, how do you do that? A friend told me that when you boot up, the computer will ask you which OS you want to run. I'm really not quite clear on... (3 Replies)
Discussion started by: DarkAngel
3 Replies
Login or Register to Ask a Question