Baffled newbie SNMP script

Discussion in 'Perl Misc' started by Steve The Geek, Sep 24, 2003.

  1. I grabbed SNMP_Session-0.98 and well, wow. :)

    What I'm trying to do is read an iplist from file and set the time on
    the devices using the snmpset subroutine. The module compiles, but
    terminates with error **Undefined subroutine &main::snmpset called at
    Set-time-all.pl line 31, <IPLIST> line 139.**

    I'm reasonably sure the script is bombing due to the <IPLIST> file
    EOF, only because I can change the error line from 139 by adding (or
    removing) blank entries from the file $IPLIST.

    Any ideas, other than get the O'Reilly book and study?

    TIA
    Steve the (newbie to Perl) Geek

    <begin script paste>

    ######################################
    ## Initialize
    ######################################
    require 5.002;
    use strict;
    use SNMP_Session;
    use BER;

    my ($community, $oid, $IPLIST, @IPLIST_DATA, $host, $response);

    $community = 'public', $oid = '1.3.6.1.4.1.52.4.3.3.1.1.0', $IPLIST =
    'H:/CT_HW_IP.txt';
    ######################################
    ## Open file with IP list for all
    ## Cabletron/Enterasys devices
    ######################################

    my $IPLIST = 'H:/CT_HW_IP.txt';
    open ( IPLIST, $IPLIST) or die "Unable to open $IPLIST \n";

    @IPLIST_DATA = <IPLIST>;

    ##########################
    ###### NOTE: script bails at this point with
    ##Undefined subroutine &main::snmpset called at
    C:\DOCUME~1\TA3SXK~1.TAL\Desktop\SNMP_S~1.98\test\SET-TI~1.PL line 34,
    <IPLIST> line 139.
    ####################

    foreach $host (@IPLIST_DATA)
    {
    $response = &snmpset($host, $community, $oid, 'string', '084800');
    }

    close(IPLIST);
    exit;

    <end script paste>
    Steve The Geek, Sep 24, 2003
    #1
    1. Advertising

  2. (Steve The Geek) wrote in message news:<>...
    > I grabbed SNMP_Session-0.98 and well, wow. :)
    >
    > What I'm trying to do is read an iplist from file and set the time on
    > the devices using the snmpset subroutine. The module compiles, but
    > terminates with error **Undefined subroutine &main::snmpset called at
    > Set-time-all.pl line 31, <IPLIST> line 139.**

    <<much snippage>>

    Never mind. I'm an idiot.

    It woulda helped if I actually put the subroutines in.

    Steve the (embarrassed) Geek
    Steve The Geek, Sep 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lloyd Dupont

    baffled...

    Lloyd Dupont, Sep 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,228
    Lloyd Dupont
    Sep 2, 2004
  2. John English

    JNDI (LDAP): totally baffled!

    John English, Jun 9, 2005, in forum: Java
    Replies:
    4
    Views:
    770
    John English
    Jun 11, 2005
  3. Mark Thomas

    Baffled!

    Mark Thomas, Oct 24, 2003, in forum: C++
    Replies:
    4
    Views:
    476
    Jonathan Mcdougall
    Oct 25, 2003
  4. Jessica
    Replies:
    6
    Views:
    90
    Eric Bohlman
    Apr 16, 2005
  5. milaus

    SNMP module to query net-snmp

    milaus, Aug 31, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    410
    Dr.Ruud
    Aug 31, 2006
Loading...

Share This Page