Sponsored Content
Full Discussion: telnet client and logs
Operating Systems Linux telnet client and logs Post 302540081 by Elyas_cr on Tuesday 19th of July 2011 01:40:12 PM
Old 07-19-2011
Question telnet client and logs

Hello everyone. I have a script that telnets into a linux workstation and restarts a service, while logging the session to a file. I'm kind of new to linux so when I was using windows I would capture something like

windows cli: telnet xxx.xxx.xxx.xxx -f c:/capture.log
...
[me@remote]# /sbin/service dhcpd restart
Shutting down dhcpd: OK]
Starting dhcpd: OK]

Now when using the linux telnet client I capture something like

[me@local]# telnet xxx.xxx.xxx.xxx | tee -a /users/me/capture.log
...
[me@remote]# /sbin/service dhcpd restart
Shutting down dhcpd: [60G[ [0;32mOK[0;39m ]
Starting dhcpd: [60G[ [0;32mOK[0;39m ]

It looks like the telnet session is passing control characters or something like that to the log file, which messes up some scripts that check whether the service was succesfully restarted.
I've already tried playing around with the telnet mode (line vrs char) with no effect. Any ideas on how to get the log with just plain text?

Thanks for any advice and sorry if I posted in the wrong place.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Using telnet client from MacOSX's command line terminal

I'm completely new to Unix, but familiar with Mac OSX. I've just discovered the command line terminal feature of this new OS and I'm trying to learn how to telnet into my host's server to change permissions to allow executable cgi scripts for my website. Is there anyone who might be able to... (2 Replies)
Discussion started by: tylerl
2 Replies

2. Programming

Telnet client IP determination

I have configured my firewall to allow only five remote IP's to connect to my server. Upon connection...i would like to automate the Xsession functions for authorized IP's. Mainly, $DISPLAY of the environment to the client. I understand that the "gethostbyaddr" function is capable of this.... (0 Replies)
Discussion started by: thomas.jones
0 Replies

3. Programming

Does Telnet client library exist ?

Hello, I'm new user in this forum, and i'm french ... so excuse me for my english :) In fact, I've to manage several network equipments which can be only configured with the telnet protocol. But using the standalone telnet tool, it's too long and hard. So I'd like to known if a Telnet... (0 Replies)
Discussion started by: aho
0 Replies

4. UNIX for Dummies Questions & Answers

IP address of telnet client

Hi, I am using the telnet client on windowsNT to access the Unix system. I want to find out the IP address of the telnet client from the server side. The reason is I want to set the DISPLAY environment variable when the user is logged on. Is there anyway that the the Unix server can... (1 Reply)
Discussion started by: vtran4270
1 Replies

5. UNIX for Dummies Questions & Answers

SSH logs off and Client pptp goes off as well

Hi , I am a newbie to unix,linux i have a fedora core 4 linux. I had set it up as a pptp vpn client to a windows pptp server. Everything was working fine. Recently i saw that there were many attempts to hack into the root login using ssh. so i changed the ssh port,the ssh portocol to 2. And... (0 Replies)
Discussion started by: qais
0 Replies

6. Linux

viewing ftp client logs

Hi All Is there any linux log file that captures invalid ftp login attempts in client side? I'm trying to come up with a script that will send an email to owners stating the number of invalid password login attempt when logging in to the ftp server. its like, 1. i'm in client side...then... (2 Replies)
Discussion started by: 3rr0r_3rr0r
2 Replies

7. UNIX and Linux Applications

Secure FTP Client that Logs well

Folks I am on a quest.... I am looking for a lightweight FTP client capable of FTPS and or SFTP that has good audit and logging capabilities without requiring a central server component. My platforms are Linux, Solaris, AIX, and Windows Server. The kicker is I have found things that meet the... (3 Replies)
Discussion started by: ArtF
3 Replies

8. Programming

How to program a telnet client?

Hi, Experts: I have programmed a simple telnet client in sco unix 5.0.5, the client has passed throught the initial option negotiation, but I can't receive login prompt from the server. please help me. (8 Replies)
Discussion started by: thinker130
8 Replies

9. UNIX for Advanced & Expert Users

difference between logging into unix through f-secure ssh client and telnet

hi, what is the difference between logging into unix through f-secure ssh client and telnet is there any more security check is involved can any one explain thanks in advance (1 Reply)
Discussion started by: trichyselva
1 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
SCRIPT(1)							   User Commands							 SCRIPT(1)

NAME
script -- make typescript of terminal session SYNOPSIS
script [-a] [-c command] [-e] [-f] [-q] [-t[=file]] [-V] [-h] [file] DESCRIPTION
script makes a typescript of everything printed on your terminal. It is useful for students who need a hardcopy record of an interactive session as proof of an assignment, as the typescript file can be printed out later with lpr(1). If the argument file is given, script saves all dialogue in file. If no file name is given, the typescript is saved in the file typescript. Options: -a, --append Append the output to file or typescript, retaining the prior contents. -c, --command command Run the command rather than an interactive shell. This makes it easy for a script to capture the output of a program that behaves differently when its stdout is not a tty. -e, --return Return the exit code of the child process. Uses the same format as bash termination on signal termination exit code is 128+n. -f, --flush Flush output after each write. This is nice for telecooperation: one person does `mkfifo foo; script -f foo', and another can super- vise real-time what is being done using `cat foo'. --force Allow the default output destination, i.e. the typescript file, to be a hard or symbolic link. The command will follow a symbolic link. -q, --quiet Be quiet. -t, --timing[=file] Output timing data to standard error, or to file when given. This data contains two fields, separated by a space. The first field indicates how much time elapsed since the previous output. The second field indicates how many characters were output this time. This information can be used to replay typescripts with realistic typing and output delays. -V, --version Output version information and exit. -h, --help Output help and exit. The script ends when the forked shell exits (a control-D to exit the Bourne shell (sh(1)), and exit, logout or control-d (if ignoreeof is not set) for the C-shell, csh(1)). Certain interactive commands, such as vi(1), create garbage in the typescript file. Script works best with commands that do not manipulate the screen, the results are meant to emulate a hardcopy terminal. ENVIRONMENT
The following environment variable is utilized by script: SHELL If the variable SHELL exists, the shell forked by script will be that shell. If SHELL is not set, the Bourne shell is assumed. (Most shells set this variable automatically). SEE ALSO
csh(1) (for the history mechanism), scriptreplay(1). HISTORY
The script command appeared in 3.0BSD. BUGS
Script places everything in the log file, including linefeeds and backspaces. This is not what the naive user expects. AVAILABILITY
The script command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. util-linux February 2011 util-linux
All times are GMT -4. The time now is 01:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy