From: hadi motamedi motamed...@gmail.com
Actually I need to telnet to it and issue some commands and capture the output
of the commands in a file and then wait for a prescribed time interval and
then redo from the start (but I need to append all of the logs in just one
file).
Maybe have a look
Maybe have a look at nc (man nc)...
Thank you . It can connect to remote node port 23. But how can I send
command to remote node and capture its log?
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
On Mon, May 03, 2010 at 12:02:43PM +0100, hadi motamedi wrote:
Thank you . It can connect to remote node port 23. But how can I send
command to remote node and capture its log?
Do you do a single iota of research on your own or do you
expect the members of this list to do
Do you do a single iota of research on your own or do you
expect the members of this list to do *everything* for you?
Sorry for wrong question. I just need to know if you see implementing it
via 'expect' or 'nc' is feasible or not? I you see it feasible, I will
extract the
hadi motamedi wrote:
Do you do a single iota of research on your own or do you
expect the members of this list to do *everything* for you?
Sorry for wrong question. I just need to know if you see implementing it
via 'expect' or 'nc' is feasible or not? I you
On Sat, May 01, 2010 at 07:12:54AM -0400, Jim Perrin (jper...@gmail.com) wrote:
On Sat, May 1, 2010 at 5:52 AM, hadi motamedi motamed...@gmail.com wrote:
[snip]
Several things are wrong with this:
1. DO NOT EVER USE TELNET.
just to be picky ;-)
While I 100% agree with this you need to
On Sat, May 1, 2010 at 10:10 AM, hadi motamedi motamed...@gmail.com wrote:
Dear All
I need to schedule for a repeated task on my CentOS server, as the
followings:
-) Telnet to a remote node
-) Issue a command
-) Capture the output in a log
-) Logout from Telnet
-) Wait for a prescribed
if you need to automate an interactive command you can use expect [1][2]
Thank you for your reply. I am trying like the followings:
#expect
set name 172.16.17.160
set user id
set password pwd
set cmd1 cd /tmp
set cmd2 cp log.cap /export/home
set cmd3 logout
spawn telnet $name
expect login:
send
On Sat, May 1, 2010 at 5:52 AM, hadi motamedi motamed...@gmail.com wrote:
Thank you for your reply. I am trying like the followings:
#expect
set name 172.16.17.160
set user id
set password pwd
set cmd1 cd /tmp
set cmd2 cp log.cap /export/home
set cmd3 logout
spawn telnet $name
expect login:
1. DO NOT EVER USE TELNET.
2. Use ssh keys instead of setting a password in the script.
3. You don't need to use expect to set the PWD to /tmp. You can do
this with basic scripting. Pick up a bash scripting guide and read
through it. I see almost nothing in your example that requires
hadi motamedi wrote:
Dear All
I need to schedule for a repeated task on my CentOS server, as the
followings:
-) Telnet to a remote node
-) Issue a command
-) Capture the output in a log
-) Logout from Telnet
-) Wait for a prescribed time interval
-) Then redo , but append the subsequent
Several things are wrong with this:
1. DO NOT EVER USE TELNET.
Seriously. Don't do this. It sends your user/pass in plain text. It's
a horrendous security risk. I don't care what excuse you have to try
to defend it. DO NOT DO IT. Use ssh keys instead.
I agree but some devices doesn't
On Sat, May 1, 2010 at 2:52 AM, hadi motamedi motamed...@gmail.com wrote:
if you need to automate an interactive command you can use expect [1][2]
Thank you for your reply. I am trying like the followings:
#expect
set name 172.16.17.160
set user id
set password pwd
set cmd1 cd /tmp
set cmd2
hadi motamedi wrote:
if you need to automate an interactive command you can use expect
[1][2]
Thank you for your reply. I am trying like the followings:
#expect
set name 172.16.17.160
set user id
set password pwd
set cmd1 cd /tmp
set cmd2 cp log.cap /export/home
set cmd3
On Sat, May 1, 2010 at 10:52 AM, Les Mikesell lesmikes...@gmail.com wrote:
hadi motamedi wrote:
Dear All
I need to schedule for a repeated task on my CentOS server, as the
followings:
-) Telnet to a remote node
-) Issue a command
-) Capture the output in a log
-) Logout from Telnet
-)
On Sat, May 01, 2010 at 10:10:49AM +0100, hadi motamedi wrote:
Study up on 'vron' and 'crontab'.
jerry
Dear All
I need to schedule for a repeated task on my CentOS server, as the
followings:
-) Telnet to a remote node
-) Issue a command
-) Capture the output in a log
-) Logout from
As others have already pointed out, this can be done with a simple
bash script, even if you do use telnet. I'd suggest getting a good
bash reference and learning it, or perl for a more robust interface.
Thank you for your reply. From your first message regarding using expect to
do the job , I
that cp command is executed on the remote system, so it will copy your
log.cap file to /export/home on the remote system. is that what you
want to do?
No, actually I wanted to copy remote node /tmp/log.cap to its /export/home.
Please correct me.
Thank you
18 matches
Mail list logo