LWP problems

LWP problems

am 11.07.2005 17:50:52 von Mike

I'm trying to touch IBM from inside a proxy. My LWP code touches the proxy,
but does not authenticate with the proxy so I can go on to IBM. Does anyone
see my mistake?

Thanks

Mike

Here is the code:


#!/usr/bin/perl

# $Id$
# $Log$

# grab the machine type from 'lsattr -El sys0'
# grab the current microcode version depending on the command for that machine
# grab the latest microcode version for this box from:
# http://techsupport.services.ibm.com/server/mdownload/downloa d.html
# complain if the microcode is not at the current version

use LWP::UserAgent;
use LWP::Debug qw(+);
use strict;

# globals
my $microcodeurl = 'http://techsupport.services.ibm.com/server/mdownload/downlo ad.html';

# get the machine type
my $cmd = 'lsattr -El sys0 | grep modelname';
open(IN, "$cmd |") or die "$0: cannot execute '$cmd': $!";
my $line = ;
close(IN);
chomp($line);

# pull the microcode version from IBM
# and the command to get the currently installed microcode version
my $ua = LWP::UserAgent->new();
$ua->proxy('http', 'http://txisa002.ttiinc.com:8080');
my $req = HTTP::Request->new(GET => $microcodeurl);
my $user = 'domain\user';
my $pass = 'password';
$req->proxy_authorization_basic($user, $pass);
my $page = $ua->request($req)->as_string;
1;