LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-08-2013, 07:39 PM   #1
ztdep
Member
 
Registered: Jul 2005
Posts: 220

Rep: Reputation: 31
problem run top with pssh


dear frineds:
i want to run top command in connected computers with opensuse 12.1.
pssh -h hostsfile -i top
but it gives me the following error:
dingpeng@ReNeng-01:~> pssh -h hostsfile -i top
[1] 08:29:09 [FAILURE] 192.168.1.1 Exited with error code 1
Stderr: TERM environment variable not set.
[2] 08:29:09 [FAILURE] 192.168.1.3 Exited with error code 1
Stderr: TERM environment variable not set.
[3] 08:29:09 [FAILURE] 192.168.1.4 Exited with error code 1
Stderr: TERM environment variable not set.
[4] 08:29:09 [FAILURE] 192.168.1.2 Exited with error code 1
Stderr: TERM environment variable not set.

could you please gives me some sugesstions about this error
 
Old 05-09-2013, 02:09 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
Either set the TERM variable or better: use top in batch mode with 'top -n1 -b' and receive output on stdout. *Note if you want to run top on several hosts continuously then you probably suffer from "using the wrong tool for the right job" syndrome in the sense of never having heard of Monit, Nagios, SNMP, etc, etc...
 
Old 05-10-2013, 05:20 AM   #3
ztdep
Member
 
Registered: Jul 2005
Posts: 220

Original Poster
Rep: Reputation: 31
Quote:
Originally Posted by unSpawn View Post
Either set the TERM variable or better: use top in batch mode with 'top -n1 -b' and receive output on stdout. *Note if you want to run top on several hosts continuously then you probably suffer from "using the wrong tool for the right job" syndrome in the sense of never having heard of Monit, Nagios, SNMP, etc, etc...
thank you very much
it works. but how to output the first 25 lines of top command in each nodes.
i run the following commad, but it seems that it does not work
pssh -h hostsfile -i top -n1 -b|head -n25
 
Old 05-13-2013, 01:25 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,417
Blog Entries: 55

Rep: Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622Reputation: 3622
In this case this should work:
Code:
ssh user@some.machine 'top -n1 -b|head -25'
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No output from top command run by crontab Gr1f1S Linux - Newbie 5 04-23-2013 05:47 AM
Shell Scripting and pssh ali2011 Programming 1 07-28-2012 10:09 AM
[SOLVED] Command pssh is not working! marsty5 Linux - General 4 04-10-2011 09:56 AM
it's -current time! (+pssh small bug) ponce Slackware 5 06-19-2010 04:52 PM
clear won´t run on top of w on ~/.bash_profile fauna Linux - General 2 09-21-2006 03:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:06 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration