Telnet batch

M

Martin Simmons

Lectori Salutum,


I have a batchfile running that checks my internet
connectivity 4 times a day. If there is no connectivity,
it checks the DNS-servers, etc. The FINAL command is to
teboot the server. But I want the command before the last
to be a reboot of my (A)DSL modem (router).

This can be done be telnetting to the device and give it
the commands: SYSTEM and then REBOOT. But this has to be
done automated (via a batch-file).

With FTP you can give commands batch-orientated by
typing: FTP HOSTNAME -S:FILE.EXT
The same I want to do with telnet, only telnet does not
know a parameter like that.

Does anyone know how to do this???


RGRDS,
Martin Simmons
 
M

Michael Bednarek

Lectori Salutum,


I have a batchfile running that checks my internet
connectivity 4 times a day. If there is no connectivity,
it checks the DNS-servers, etc. The FINAL command is to
teboot the server. But I want the command before the last
to be a reboot of my (A)DSL modem (router).

This can be done be telnetting to the device and give it
the commands: SYSTEM and then REBOOT. But this has to be
done automated (via a batch-file).

With FTP you can give commands batch-orientated by
typing: FTP HOSTNAME -S:FILE.EXT
The same I want to do with telnet, only telnet does not
know a parameter like that.

Does anyone know how to do this???

Here's what I wrote earlier on the subject:
(Quoted from
<http://groups.google.com/groups?hl=en&[email protected]>

I don't think there is a way of scripting the standard Microsoft
telnet client (although some people in the past have come up with some
VB scripts which issued SendKeys commands - ugly).

I suggest you use a comms program, and among those I would use Kermit.
See : http://www.columbia.edu/kermit/ckermit.html and
http://www.columbia.edu/kermit/ckscripts.html
Unfortunately, the Win32 version (Kermit95) is not free; you'll
probably find others which are, but I can't comment on those.
 
D

Don

Martin,

This is not an advertisement, but I use a product called
ZOC. This is a great telnet utility and allows you to
write scripts (including Rexx-like commands) to do
whatever you'd like in a batch file.

I use ZOC to telnet to our load balancers when an error is
detected to change their settings. I have found it
powerful and useful.

-- Don
 
N

nut cracker

Hrmmm, Interesting. I might look into that myself.

I prefer PERL for such things, though.

NuTs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top