Find the answer to your Linux question:
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 ...
  1. #1
    Just Joined!
    Join Date
    May 2007
    Posts
    14

    Question 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

  2. #2
    Just Joined!
    Join Date
    Oct 2007
    Posts
    22
    are you root?

  3. #3
    Just Joined!
    Join Date
    May 2007
    Posts
    14
    Quote Originally Posted by sixstringartist View Post
    are you root?
    yes i am logging in as root.

  4. #4
    Linux 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

  5. #5
    Just Joined!
    Join Date
    May 2007
    Posts
    14

    Smile

    Quote Originally Posted by vsemaska View Post
    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
    thanks a TON man, the error got rectified. I can use it now.
    But again,
    can anyone explain why this error popped out.

  6. #6
    Linux 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

  7. #7
    Just Joined!
    Join Date
    May 2007
    Posts
    14

    Smile

    Quote Originally Posted by vsemaska View Post
    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

    Thanks for the info vsemaska.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...