LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-12-2006, 10:04 PM   #1
wilkija
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Rep: Reputation: 0
Redirect Output to remote PC possible??


I have a TON of linux machines that are "thin clients". These machines are running a custom version of Pxes. I need to figure out how to run sysInfo and output that information to a windows PC on that same network. I am using telnet to log into these linux machines. I know how to do this from windows PC to windows PC but not sure how to do this within linux, or if this is even possible.
 
Old 09-13-2006, 03:59 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,138

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
I'd use ssh rather than telnet, for security. What you want is simple:
Code:
$ ssh machine.domain.com pwd
Enter passphrase for key '/home/haertig/.ssh/id_dsa':
/home/d/haertig
$
The above is from a Linux machine to a Solaris one, but it works just the same going into a Linux box. My ssh public keyring is passphrase protected, but you can make it passphrase-less if you don't want that prompt you see above.

Since you'll be coming from a Windows box rather than a Linux one, you'll need an ssh client that supports commandline. putty is such a beast. You will need to download the "plink" program from the putty website for commandline operation, since the "putty" program is a GUI thing.
 
Old 10-03-2006, 09:52 AM   #3
wilkija
LQ Newbie
 
Registered: Sep 2006
Posts: 2

Original Poster
Rep: Reputation: 0
That made no sense to me at all. I don't see where you are answering my question. I know the command say I have two windows machines and I can run ----

ping IPADDRESS >> \\machine\drive$\output.txt

but how do I telnet into a linux machine and run the same command.
 
Old 10-03-2006, 11:23 AM   #4
xinxin
LQ Newbie
 
Registered: Sep 2006
Posts: 5

Rep: Reputation: 0
maybe rcp (remote copy) command may help to solve it in different way by saving the result first or redirect the result and copy it to the remote client. Hope it can help.
 
Old 10-03-2006, 12:43 PM   #5
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,138

Rep: Reputation: 334Reputation: 334Reputation: 334Reputation: 334
Quote:
Originally Posted by wilkija
That made no sense to me at all.
That was probably because your question made no sense to me either! I therefore made a few assumptions. Since you were in a Linux forum and said "I have a ton of Linux machines", I thought that meant you were quite familiar with Linux. And not-so-familiar with Windows, since you were asking how to accomplish a task from within Windows. So I gave an example of how to remotely execute a command from Linux to *nix, thinking that would be familiar to you, and then I threw in some hints of how to do this from Windows (putty, plink, etc.) Again, thinking your Windows knowledge was what was lacking.

Now it looks like you are a Windows user who is unfamiliar with Linux. Just the opposite of what I originally assumed. No wonder you were confused by my answer!

BTW, there is no native "sysinfo" command in Linux that I am aware of. I believe that command might exist on Solaris, and could have been ported to Linux by someone, but I am not sure. Chances are you will have to run some homebrew script on Linux to gather the specific info you are looking for. I've attached a simple one below that might work for you.
Code:
HOSTNAME=`hostname`
IP_ADDR=`/sbin/ifconfig eth0 | grep 'inet addr' | sed -e 's/.*inet addr://' -e 's/ .*//'`
MEMORY=`cat /proc/meminfo | grep MemTotal: | sed -e's/.*: *//'`
CPU_MHZ=`cat /proc/cpuinfo | grep MHz | sed -e 's/.*: //'`
CPU_TYPE=`cat /proc/cpuinfo | grep "model name" | sed -e 's/.*: *//'`
CPU_ARCH=`uname -m`
OS_NAME=`uname -s`
OS_KERNEL=`uname -r`
LASTBOOT=`who -b | sed -e 's/.*system boot *//'`
echo "Hostname             : $HOSTNAME"
echo "IP Address           : $IP_ADDR"
echo "CPU Type             : $CPU_TYPE"
echo "CPU Speed            : $CPU_MHZ MHz"
echo "Machine Architecture : $CPU_ARCH"
echo "System Memory        : $MEMORY"
echo "OS Name              : $OS_NAME"
echo "Kernel Version       : $OS_KERNEL"
echo "System Boot          : $LASTBOOT"
I stored the above in a file named "cmds". And here is the output when I remotely execute that to another Linux box (my home computer):
Code:
$ cat cmds | ssh home
Pseudo-terminal will not be allocated because stdin is not a terminal.
Enter passphrase for key '/home/haertig/.ssh/id_dsa':
Hostname             : familyroom
IP Address           : 192.168.0.52
CPU Type             : AMD Athlon(tm) 64 Processor 3000+
CPU Speed            : 2009.571 MHz
Machine Architecture : i686
System Memory        : 1036516 kB
OS Name              : Linux
Kernel Version       : 2.6.14-1-686-dfh1
System Boot          : Sep 17 16:33
$
Now, since you are in Windows, that "...remotely execute that to another Linux box..." part changes. You won't be using "cat cmds | ssh home". You will need to use some Windows variant. putty/plink would be one way.
 
  


Reply

Tags
output, redirect


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
Redirect output jimwelc Linux - Newbie 3 05-11-2006 11:10 AM
How to redirect output to a file? mus1402 Linux - Newbie 2 02-05-2006 09:42 AM
how to redirect the output of a terminal? cpukiller Linux - Networking 5 11-10-2004 07:07 AM
Ambiguous output redirect XFox Linux - Newbie 5 10-17-2003 07:29 PM
using linux to redirect remote vpn traffic to another remote machine brb5548 Linux - Networking 0 06-28-2003 09:07 PM


All times are GMT -5. The time now is 07:10 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration