Script Telnet Sessions

Script Telnet Sessions

Post by Hal Burgi » Thu, 27 Apr 2000 04:00:00




>I am wondering if there is a way to script the following or if someone
>has a better idea for automating this process.

>Essentially I telnet into 5 LINUX boxes, RH 6.1 to check the disk space
>on the drives.

>I am wondering how I can automate the process into 1 script file to
>telnet to the server specifing a username and password then issue the
>command df -k and redirect it to a file then close the connection and
>continue on to the next server and do the same thing and append the
>results of df -k.

Why not have a cron job mail you with this? I use this in cron.hourly to
watch for FS >= 90% full.

 if [ -n "`df | grep 9[0-9]%`" ]; then

 fi

--
Hal B

--

 
 
 

Script Telnet Sessions

Post by Peter Allie » Fri, 28 Apr 2000 04:00:00


I am wondering if there is a way to script the following or if someone
has a better idea for automating this process.

Essentially I telnet into 5 LINUX boxes, RH 6.1 to check the disk
space on the drives.

I am wondering how I can automate the process into 1 script file to
telnet to the server specifing a username and password then issue the
command df -k and redirect it to a file then close the connection and
continue on to the next server and do the same thing and append the
results of df -k.

Thanks,

Peter Alliett


 
 
 

Script Telnet Sessions

Post by Jeff Workma » Sat, 29 Apr 2000 04:00:00



> I am wondering if there is a way to script the following or if someone
> has a better idea for automating this process.

> Essentially I telnet into 5 LINUX boxes, RH 6.1 to check the disk
> space on the drives.

> I am wondering how I can automate the process into 1 script file to
> telnet to the server specifing a username and password then issue the
> command df -k and redirect it to a file then close the connection and
> continue on to the next server and do the same thing and append the
> results of df -k.

Sounds like a job for expect (http://expect.nist.gov) or, if you do perl,
the Net::Telnet module (ftp://ftp.cpan.org).

                Jeff

--
Jeff Workman                    | [End of diatribe.  We now return you to your
UNIX System Administrator       | regularly scheduled programming...]
Gibralter Publishing            |  
(910) 455-6446 ext. 3034        | -- Larry Wall, in "Configure" from the
http://www.gibralter.com        |    perl distribution.

 
 
 

Script Telnet Sessions

Post by Koos P » Tue, 02 May 2000 04:00:00




|
| > I am wondering if there is a way to script the following or if someone
| > has a better idea for automating this process.
| >
| > Essentially I telnet into 5 LINUX boxes, RH 6.1 to check the disk
| > space on the drives.
| >
| > I am wondering how I can automate the process into 1 script file to
| > telnet to the server specifing a username and password then issue the
| > command df -k and redirect it to a file then close the connection and
| > continue on to the next server and do the same thing and append the
| > results of df -k.
|
| Sounds like a job for expect (http://expect.nist.gov) or, if you do perl,
| the Net::Telnet module (ftp://ftp.cpan.org).

???
This is a job for rsh and nothing else:
rsh somemachine df -k /usr/local

Koos Pol
----------------------------------------------------------------------
S.C. Pol - Systems Administrator - Compuware Europe B.V. - Amsterdam

Check my email address when you hit "Reply".

 
 
 

1. Getting started on scripting telnet sessions from a Linux client

I'm trolling for some tips on scripting telnet sessions; at this point,
knowing very little about possibilities under Linux, I'm still in the "don't
know the right questions or even how to phrase them" stage.

I want to log into a Linux system (Red Hat 7.1 or Mandrake 8.0) remotely via
telnet, then telnet on out to (no shudders, please) Windows 2000 systems,
issue a series of commands, react to the output, and terminate the
connection automatically; I will be logging the entire session also.

I currently have a couple of Mandrake 8 systems available for test purposes;
I am already aware of the annoyances with the Windows 2000 telnet server
(N.B. - for those of you who aren't, you need to turn off NTLM
authentication, do a bunch of shimming if you want SSH, and any shell
commands in Win2K that produced formatted output will echo tons of ASCII
control chars to your log).

I'm finding man telnet a bit overwhelming - I know I will eventually
appreciate that, but for now-

+are there any good references for *nix-based telnet scripting on the
Internet?

+This should probably have been the first question.  I see no refs in the
telnet man page for scripting or logging. It seems to me that the Linuxish
reason for this would be that telnet is just telnet, and logging, etc and
scripting it is done via standard I/O scripting in your favorite shell.  Is
this true?

+finally, any points on telnet clients/servers between Linux and Windows
environments? I've resolved most of my problems in the past by just using
Teraterm configured as I wish, but I'd like to get a better understanding of
the actual underlying issues I could see if I do much with this.

Thanks in advance -

Alex
--
==============================
Nyrk Natrybcbhybf

ZPFR, ZPC+V, AGPVC
(Try are-oh-tee thirteen)
==============================

2. Linux with RM rom network cards?

3. Script Telnet Sessions

4. My ugly Solaris 2.6 x86 experience(s)

5. Script telnet sessions--Expect

6. Got Cannot open /dev/console with startx.

7. Scripting Telnet sessions....

8. KMail spell-checking

9. Script Telnet Sessions

10. Scripting a telnet session

11. Noninteractive telnet session with sh script?

12. difference in telnet session and init script

13. script to send and receive to and from a telnet session