Hi
I'm currently into converting a perl linux app into a .Net windows service.
The application monitors our syslog log files to capture i.p adress changes
on some of our routers having dynamic i.p. In the syslog logfile i capture
the new IP adress of the router. I then need to telnet to that i.p adress
and fetch the hostname. A list of these routers will be presented on a
webpage.
I've created the application in vb.net and most parts of it is working fine
except for the telnet module. I've created a TCPClient class that takes care
of this. However with my limited .Net experience this is gonna take some
time to implement the Telnet protocol to handle all sorts of stuff :)
However time is limited and i need to get this app up and running. I have a
perlscript doing this for me returning the routerconfig to stdout (the dos
window). I've tried to do a:
Shell(Me.FileTo Execute, AppWinStyle.Hid e, True, 3000) where Me.FiletoExecut e
= C:\Perl\bin\Per l.exe C:\files\syslog \telnet.pl >
C:\files\syslog \SmallOffice93C onfig.txt
however the shell doesn't like piping to a file and outputs this to the
command window. Is there a way i can fetch the data from the command window,
or a way to pipe the data to a file ? Or is it possible to embed a
perlscript directly into .net ?
I use the Perl ppm module Net-Telnet-Cisco to send my telnet command.
Help is appreciated
Best Regards
Kai Thorsrud 2 7005
In article <#T************ **@TK2MSFTNGP11 .phx.gbl>, Kai Thorsrud wrote: Hi
I'm currently into converting a perl linux app into a .Net windows service. The application monitors our syslog log files to capture i.p adress changes on some of our routers having dynamic i.p. In the syslog logfile i capture the new IP adress of the router. I then need to telnet to that i.p adress and fetch the hostname. A list of these routers will be presented on a webpage.
I've created the application in vb.net and most parts of it is working fine except for the telnet module. I've created a TCPClient class that takes care of this. However with my limited .Net experience this is gonna take some time to implement the Telnet protocol to handle all sorts of stuff :)
However time is limited and i need to get this app up and running. I have a perlscript doing this for me returning the routerconfig to stdout (the dos window). I've tried to do a:
Shell(Me.FileTo Execute, AppWinStyle.Hid e, True, 3000) where Me.FiletoExecut e = C:\Perl\bin\Per l.exe C:\files\syslog \telnet.pl > C:\files\syslog \SmallOffice93C onfig.txt
however the shell doesn't like piping to a file and outputs this to the command window. Is there a way i can fetch the data from the command window, or a way to pipe the data to a file ? Or is it possible to embed a perlscript directly into .net ?
I use the Perl ppm module Net-Telnet-Cisco to send my telnet command.
Help is appreciated
Best Regards Kai Thorsrud
You might want to try calling the EzPerl API if your using ActiveState
Perl...
I played with this a bit a long time ago with VB5/6, so I don't remember
all of the details. But, it maybe worth a try. Also, you could buy a
telnet component...
--
Tom Shelton
MVP [Visual Basic]
In article <#T************ **@TK2MSFTNGP11 .phx.gbl>, Kai Thorsrud wrote: Hi
I'm currently into converting a perl linux app into a .Net windows service. The application monitors our syslog log files to capture i.p adress changes on some of our routers having dynamic i.p. In the syslog logfile i capture the new IP adress of the router. I then need to telnet to that i.p adress and fetch the hostname. A list of these routers will be presented on a webpage.
I've created the application in vb.net and most parts of it is working fine except for the telnet module. I've created a TCPClient class that takes care of this. However with my limited .Net experience this is gonna take some time to implement the Telnet protocol to handle all sorts of stuff :)
However time is limited and i need to get this app up and running. I have a perlscript doing this for me returning the routerconfig to stdout (the dos window). I've tried to do a:
Shell(Me.FileTo Execute, AppWinStyle.Hid e, True, 3000) where Me.FiletoExecut e = C:\Perl\bin\Per l.exe C:\files\syslog \telnet.pl > C:\files\syslog \SmallOffice93C onfig.txt
however the shell doesn't like piping to a file and outputs this to the command window. Is there a way i can fetch the data from the command window, or a way to pipe the data to a file ? Or is it possible to embed a perlscript directly into .net ?
I use the Perl ppm module Net-Telnet-Cisco to send my telnet command.
Help is appreciated
Best Regards Kai Thorsrud
Oh, yeah... I thought I better mention - ActiveState creates a .NET
version of Perl. Visual Perl. That would let you convert most of your
Perl code directly to .NET :)
--
Tom Shelton
MVP [Visual Basic] This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Keith |
last post by:
All:
What is the difference between Perl (CGI) and PHP (Apache module)? I thought both used servers to direct the
user to the appropiate Perl or PHP program in order to execute the program to interpret the user's Perl or PHP script
respectively.
Keith
|
by: dpackwood |
last post by:
Hello,
I have two different scripts that do pretty much the same thing. The main
perl script is on Windows. It runs and in the middle of it, it then calls
out another perl script that then should run on a Unix box I have. Both
scripts run ok, except for the part when Windows try's to call out the
Unix script. I have it set up where the Unix is mapped through a drive
letter and can drop stuff into the Unix box. It is going through another...
|
by: sm00thcrimnl13 |
last post by:
if i have windows 2000 and know how to write perl scripts, how to i
actuvate the script through perl?
|
by: PzYon |
last post by:
Hey 2gether!
I'm trying to execute a PERL script on the web server when the user presses
a button in an ASP.NET Web Application using Visual Basic. The most obvious
solution for me seemed to be to use the 'Shell()'-command .
This didn't work: Either I get an "File not found" error, or I get no error
at all, but the PERL script isn't executed anyway. The strange thing is that
I managed to execute a .bat file for example. Why the hell...
|
by: Wonderinguy |
last post by:
Hi everybody , I have been trying to execute a simple DB2 stored
Procedure from perl. But it doesn't work. Could anybody please help me
find out why this is happening :
here is my perl script that execute the SP :
<snip>
my $dbh = DBI->connect( "dbi:DB2:$database","user1","passwd1") || die
"cannot connect to db2";
my $callstmt = "CALL SPACESP('DB','TEXAS')";
my $sth = $dbh->prepare($callstmt) || die "can't do
| |
by: Nathan |
last post by:
This may be a basic task to some of you perl guru's, but I have a
problem getting a perl script i've written, when executed by httpd, to
send out an e-mail.
Basically, i have a few variables passed into this script, it writes
them to a a database, and then its supposed to read the "E-mail list"
attached to that database entry and shoot an e-mail off to everyone in
that list letting them know that there's been an update.
I have what...
|
by: billb |
last post by:
I installed a perl extension for PHP to use some perl inside my php
primarily because I have perl working with oracle and not php and
oracle. So I want to use my old perl scripts, and use the
functionality of php. The extension uses the '$perl->eval' function.
i am kind of stuck with the syntax or how to put the php variable into
the perl script. I have a form where the user puts in a grid
reference. Then a php script that gets the...
|
by: happyse27 |
last post by:
Hi All,
I modified the user registration script, but not sure how to make it check for each variable in terms of preventing junk registration and invalid characters?
Two codes below :
a) html
b) perl script (print and inserting into database)
Cheers...
Andrew
|
by: KevinADC |
last post by:
Note: You may skip to the end of the article if all you want is the perl code.
Introduction
Many websites have a form or a link you can use to download a file. You click a form button or click on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script.
What You Need
Any recent...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |