[rrd-users] FW: PERL Help Needed

Schroeder, Dennis Dennis.Schroeder at sanmina.com
Wed Sep 12 18:59:12 MEST 2001


Thank You Daniel, Tiago, Todd and Luis.  I got what I need!

-----------------------------------------------------------------
Dennis Schroeder                                ||        ||
Network Engineer                                ||        ||
SANMINA Global Network Services                ||||      ||||
Phone:  602-824-8431                       ..:||||||:..:||||||:..
Mobile: 602-432-3258                          Cisco  Certified
Email:  dennis.schroeder at sanmina.com         Network  Associate
-----------------------------------------------------------------
           A company is known by the people it keeps.
-----------------------------------------------------------------


-----Original Message-----
From: Todd Caine [mailto:todd_caine at eli.net]
Sent: Wednesday, September 12, 2001 9:59 AM
To: Schroeder, Dennis
Cc: rrd-users at list.ee.ethz.ch
Subject: Re: [rrd-users] PERL Help Needed


#  You could use a regular expression
#  Below is a case insensitive match for "cisco" within $val
if ($val =~ m/cisco/i) {
  print "Cisco was found in the string.\n";
} else {
  print "Cisco was not found in the string.\n";
}


"Schroeder, Dennis" wrote:

> I am working on a program that will check for Cisco devices on our network
> (using SNMP).  I can poll a device and get a result like:
>
>   Cisco Systems WS-C5505
>   Cisco Catalyst Operating System Software, Version 5.1(1)
>   Copyright (c) 1995-1999 by Cisco Systems
>
> using this small command set:
>
>   open (FD, "$prog $host public $oid1 |") || die;
>   my $val = <FD>;
>   close (FD);
>
> How do I then check $val for the existance of "Cisco" anywhere in the
> output?
>
> Thanks!
>
> -----------------------------------------------------------------
> Dennis Schroeder                                ||        ||
> Network Engineer                                ||        ||
> SANMINA Global Network Services                ||||      ||||
> Phone:  602-824-8431                       ..:||||||:..:||||||:..
> Mobile: 602-432-3258                          Cisco  Certified
> Email:  dennis.schroeder at sanmina.com         Network  Associate
> -----------------------------------------------------------------
>             To lead a symphony, you must occasionally
>                    turn your back on the crowd.
> -----------------------------------------------------------------
>
> --
> Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
> Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
> Archive     http://www.ee.ethz.ch/~slist/rrd-users
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi


--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list