-----Original Message-----
From: Winchester, Derek S (Derek) [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 12, 2002 12:22 PM
To: [EMAIL PROTECTED]
Subject: logging data to text file


I have composed this perl script and I would like the results from each
command to append a log file. Is there a way I can do this? I have seen
several examples but none of them  looks as if it would achieve what I am
trying to do here. Any help would be appreciated.



#!/usr/bin/perl -w
# file: ionex test
use Net::Telnet;
use constant HOST => '152.148.228.14';
use constant USER => 'admin';
use constant PASS => 'admin';
# loads the text file to be loaded via cli. populating the array w/text
config file
$telnet = Net::Telnet->new(HOST);
$telnet->open(HOST);
$telnet->waitfor('/[^Welcome]/');
$telnet->print ("\007");
$telnet->login(Name => USER,Password => PASS,Prompt => '/#/',Timeout => 30);
$file = select (/usr/test.txt);
$telnet->cmd ("set page disable\n");
$telnet->cmd ("router verio_gate_1\n");
$telnet->cmd ("show ip route\n");
$telnet->cmd ("show ip ospf database external\n");
$telnet->cmd ("show ip ospf database \n");
$telnet->cmd ("show ip ospf database nssa\n");
$telnet->cmd ("show ip ospf border-routers\n");
$telnet->cmd ("show ip ospf interfaces\n");
$telnet->cmd ("show ip ospf routers\n");
$telnet->cmd ("up\n");
$telnet->cmd ("show clock\n");
$telnet->cmd ("restart router verio_gate_1\n");

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to