Results 1 to 7 of 7
hi i was trying to ssh on c remote server through command line
however, top command is not running in it. Im using Sun OS
ssh IP " top -d1 ...
- 10-21-2007 #1Just Joined!
- Join Date
- May 2007
- Posts
- 14
top command not found while using ssh
hi i was trying to ssh on c remote server through command line
however, top command is not running in it. Im using Sun OS
ssh IP " top -d1 " > output;
any clue,
however ssh IP "df -k" > output works fine
im getting this error.
sh: top: not found
- 10-23-2007 #2Just Joined!
- Join Date
- Oct 2007
- Posts
- 22
are you root?
- 10-23-2007 #3Just Joined!
- Join Date
- May 2007
- Posts
- 14
- 10-23-2007 #4Linux User
- Join Date
- Jun 2007
- Posts
- 318
When I tried it I get:
# ssh IP "top -d1"
root@IP's password:
TERM environment variable not set.
I added the -b option for batch mode and it works.
# ssh IP "top -b -d1"
Vic
- 10-23-2007 #5Just Joined!
- Join Date
- May 2007
- Posts
- 14
- 10-23-2007 #6Linux User
- Join Date
- Jun 2007
- Posts
- 318
The top utility usually runs in a graphics mode so it has to know the type of terminal, or more accurately, terminal emulator you're using. That's defined by the variable TERM. Under normal login it gets set to something like 'vt330' so top knows what escape sequences to use to move the cursor around on the screen.
I tried and got:
'# ssh IP "set" | grep TERM'
root@IP's password:
TERM=dumb
So it appears top doesn't know how to handle things when TERM is set to dumb. The '-b' option tells top to forget graphics and print output in straight text. Well, that's my somewhat educated guess.
Vic
- 10-23-2007 #7Just Joined!
- Join Date
- May 2007
- Posts
- 14


Reply With Quote
