Just last week I implemented a perl script called by a cfexecute tag. Perl
has a module Net::Telnet that makes the connection relatively easy to set up
and manage.
 
Here's the script
 
#!/usr/bin/perl
 
use strict;
use Net::Telnet;
 
my ($arg1, $arg2, $arg3, $arg4, $arg5) = @ARGV;
my $telnet = Net::Telnet->new(Host => 'IP Address or server name', Timeout
=> 60);
$telnet->login('userid','password');
# print line for debugging and logging
print 'nohup mainexcelrlp -r '.$regionID.' -m '.$marketID.' -s '.$session.'
-u '.$contact.' -f '.$filename.'&';
# execute the telnet cmd by using the print stmt and ref. $telnet
# within the parens is the unix commands that I wanted to execute in the
telnet session
print $telnet->cmd("nohup UnixScriptName -r $arg1 -m $arg2 -s $arg3 -u $arg4
-f $arg5 >> logfile 2>&1 &");
#print @lines;
 
Within the cfexecute tag I target perl.exe as the file to execute and list
the arguments as 
"sample.pl arg1 arg2 arg3 arg4 arg5 arg...."
 
 
 

-----Original Message-----
From: cfhelp [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 23, 2001 6:58 PM
To: [EMAIL PROTECTED]
Subject: [KCFusion] CFtelnet



I need to launch a telnet session and pass it commands through a webserver.
Like CFFTP I do not want the user to see the telnet window so it must run on
the server. 

 

It will telnet into a Solaris server and send Printing commands. I can stor
all the commands in a SQL database and have the user select what needs to
run. Then I want them to click a button and be done with it. The server
takes care of the connect, Login, Pass, and commands.

 

Any help please

 

Rick

 
 
______________________________________________________________________
The KCFusion.org list and website is hosted by Humankind Systems, Inc.
List Archives........ http://www.mail-archive.com/cf-list@kcfusion.org
Questions, Comments or Glowing Praise.. mailto:[EMAIL PROTECTED]
To Subscribe.................... mailto:[EMAIL PROTECTED]
To Unsubscribe................ mailto:[EMAIL PROTECTED]
 

Reply via email to