LWP problems

M

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/download.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/download.html';

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

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top