Hi,

I'm still quite new to perl, so my form is a bit off, but I'm trying to write a script that will talk to a Foundry ServerIron load balancer. I'm trying to do this with IO:Socket:INET, and I'm running into some issues. Here's the test script I'm using to see if I can get the script and the load balancer talking:

use IO::Socket; <P> my $userpass=password; my $enapass=drowssap; + my @list=("$userpass", "ena", "$enapass", "show server virtual", "exit +", "exit"); + my $foundry = new IO::Socket::INET ("loadbalancer:23") or die "Couldn't connect to loadbalancer!!!: $@"; + foreach $item (@list){ print $foundry "$item\n"; my $response = <$foundry>; print $response; } + exit 1;

Cheesey, but I'll do nicer stuff once I know I can get this going. Anyway, when I run the script, my output is a line of garbage characters, then "User Access Verification", which is what I expect to see, then it sits until I break out of the script.

For right now at least, I just want it to connect to the lb on the telnet port, give it the access password, enable, give the admin password, "show server virtual," then log off. Any ideas?

Thanks!


In reply to perl talking to a load balancer by cheddarbastard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.