RE: [Linux-programlama] Re: Perl - Net::Telnet::Cisco deger girilmesi

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Orhan Sumer (sumero@sumero.com)
Date: Tue 27 Jun 2006 - 07:27:13 GMT


Cift tirnakta deger dogru geliyor, fakat yine islem yapmiyor
my $HOST = "$ARGV[0]";

#./Otest.pl 10.10.10.150

host->10.10.10.150
argc->10.10.10.150

programin calisan seklinde yani

my $HOST = '10.10.10.150';
yapip calistiridigimda

#./Otest.pl 1 <----herhangi bir arguman girilmesi gerektigi icin girdim
hic bir degeri yok

host->212.50.44.43
argc->1
Cisco IOS Software, Software (C1700-JS-M), Version 12.3(11)T8, RELEASE
SOFTWARE (fc3)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2005 by Cisco Systems, Inc.
Compiled Thu 06-Oct-05 08:17 by kehsiao

ROM: System Bootstrap, Version 12.2(2r)XB, RELEASE SOFTWARE (fc1)
BOOTLDR: 1700 Software (C1700-BOOT-M), Version 12.2(2)XB, EARLY DEPLOYMENT
RELEASE SOFTWARE (fc2)

Router uptime is 3 weeks, 3 days, 2 hours, 18 minutes
System returned to ROM by reload at 07:57:23 EEST Sat Jun 3 2006
System restarted at 07:58:11 EEST Sat Jun 3 2006

Cisco AS1700HPX (R7K) processor (revision T) with 524287K/131072K bytes of
memory.
Processor board ID JAE084812WN
R7000 CPU at 110MHz, Implementation 39, Rev 3.3, 256KB L2, 8192KB L3 Cache
Last reset from IOS reload
Manufacture Cookie Info:
 EEPROM Type 0x0001, EEPROM Version 0x01, Board ID 0x31,
 Board Hardware Version 16.7, Item Number ,
 Board Revision C0, Serial Number,
 PLD/ISP Version 2.2, Manufacture Date 24-Nov-2002.
Processor 0x14, MAC Address 0
Backplane HW Revision 1.0, Flash Type 3.3V
2 FastEthernet interfaces
2 Serial interfaces
512K bytes of NVRAM.
65536K bytes of processor board System flash (Read/Write)
16384K bytes of processor board Boot flash (Read/Write)

Configuration register is 0x2102

#

  -----Original Message-----
  From: linux-programlama-bounces@liste.linux.org.tr
[mailto:linux-programlama-bounces@liste.linux.org.tr]On Behalf Of Serkan
Coban
  Sent: Tuesday, June 27, 2006 9:58 AM
  To: linux-programlama@liste.linux.org.tr
  Subject: Re: [Linux-programlama] Re: Perl - Net::Telnet::Cisco deger
girilmesi

  Pardon bi onceki mailimde tek tirnak demistim yanlislik olmus cift tirnak
olacak "ARGV[0]".

  On 5/2/06, Atif CEYLAN < atifceylan@gmail.com> wrote:
    Orhan Sumer wrote:

>Selamlar,
>
>Asagidaki gibi bir script ile Cisco yonlendiriciler uzerinden bazi
bilgiler
>alacagim, bunu agimizdaki birkac yonlendiriciden almak istiyorum o
yuzden
>yazdigim scriptin disardan arguman alacak sekilde yazdim ve problem
burda
>basladi.
>Goruceginiz gibi eger $HOST'a ip adresini script icinde girersem hicbir
>problem cikartmiyor ve calisiyor, fakat $ARGV[0] degerini $HOST'a
atadigimda
>yonlendiriciye telnet cekmiyor, hicbir islem yapmiyor.
>
>Yardimlarini bekliyorum
>
>
>use Net::Telnet::Cisco;
>
>#my $HOST = '10.10.10.150';
>my $HOST = $ARGV[0];
>use constant USER => 'XXXXXXX';
>use constant PSWD => 'YYYYYYY';
>use constant ENPD => 'ZZZZZZZZ';
>use constant CMND => 'sh ver';
>use constant IDLE => 0;
>use constant SEEN_ORIGINATE => 1;
>
>$| = 1;
>my $debug = 0;
>my $session;
>if (scalar(@ARGV) ne 1)
> {
> print("Usage: $0 <router_ip_address> \n");
> exit(-1);
> }
>
>$session = Net::Telnet::Cisco->new
> (
> Host => $HOST,
> Errmode => "return",
> ) or do{ print_format( 0, 0 ); exit(
0 );
>};
>$session->login( USER, PSWD) or do{ print_format( 0, 0 ); exit(
0 );
>};
>my @output = $session->cmd( CMND );
>$session->close;
>print @output;
>
>Orhan
>
>
>
>

>------------------------------------------------------------------------
>
>_______________________________________________
>Linux-programlama mailing list
>Linux-programlama@liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama
>
>

    $ARGV[0] ile içeri değer girip girmediğini veya giriyorsa doğru girip
girmediğini eğer doğru giriyorsa $HOST değişkenine doğru atandığını kontrol
ettinizmi?
    print($ARGV[0]); yazdığınzda değer geliyormu?
    print($HOST); yazdığınzda değer geliyormu?

    _______________________________________________
    Linux-programlama mailing list
    Linux-programlama@liste.linux.org.tr
    http://liste.linux.org.tr/mailman/listinfo/linux-programlama

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.