make distclean
rm -f config.sh Policy.sh
sh Configure -des -Dcc=gcc
make
make test
make install
perl -V
cd /usr/local/bin
ln -s /usr/local/src/perl-5.8.4/perl perl
ln -s /usr/local/src/perl-5.8.4/utils/perldoc perldoc
ln -s /usr/local/src/perl-5.8.4/utils/perlbug perlbug
ln -s /usr/local/src/perl-5.8.4/utils/perlcc perlcc
ln -s /usr/local/src/perl-5.8.4/utils/pl2pm pl2pm
####
Summary of my perl5 (revision 5 version 8 subversion 4)
configuration:
Platform:
osname=solaris, osvers=2.7, archname=sun4-solaris
uname='sunos nada 5.7 generic_106541-27 sun4u sparc
sunw,ultra-enterprise'
config_args='-des -Dcc=gcc'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define
usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-O',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.2 19991024 (release)',
gccosandvers='solaris2.7'
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define,
longdblsize=16
ivtype='long', ivsize=4, nvtype='double', nvsize=8,
Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib '
libpth=/usr/local/lib /usr/lib /usr/ccs/lib
libs=-lsocket -lnsl -ldl -lm -lc
perllibs=-lsocket -lnsl -ldl -lm -lc
libc=/lib/libc.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' '
cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under solaris
Compiled at Sep 8 2004 09:01:01
@INC:
/usr/local/lib/perl5/5.8.4/sun4-solaris
/usr/local/lib/perl5/5.8.4
/usr/local/lib/perl5/site_perl/5.8.4/sun4-solaris
/usr/local/lib/perl5/site_perl/5.8.4
/usr/local/lib/perl5/site_perl
.
####
/usr/local/src/HTML-Tagset-3.03
/usr/local/src/HTML-Parser-3.36
/usr/local/src/URI-1.18
/usr/local/src/libwww-perl-5.800
/usr/local/src/libwww-perl-5.800
/usr/local/src/MailTools-1.64
/usr/local/src/LWP-Protocol-http-SocketUnix
/usr/local/src/Net-SSH-Perl-1.25
/usr/local/src/Net-SSH-0.08
####
Can't locate object method "new" via package
"LWP::Protocol::https::Socket"
####
#----------------------------------------------------------------#
# Use for-loop to allow two tries on red alerts. #
#----------------------------------------------------------------#
for (my $n=1; $n<=$retry; $n++)
{
@http_err = ""; # Reinitialize every time through.
$ua = ""; # ''
$response = ""; # ''
$request = ""; # ''
$headers = ""; # ''
$body = ""; # ''
$code = ""; # ''
$desc = ""; # ''
#----------------------------------------------------------#
# If serialization of the URL requested, append hostname #
# and seconds (from time() function) patameters. #
#----------------------------------------------------------#
if ($opt_s or $serialize)
{
sleep(2);
$url = "$http_cmd";
$url_suffix = "hostname=$host&seqnumber=" . time();
$url .= ($url =~ /\?/) ? "\&${url_suffix}" : "\?${url_suffix}";
}
$ua = LWP::UserAgent->new();
$ua->env_proxy(); # Check proxy settings.
echo("$n. Checking connection to $uiPID\n");
echo("\$ua->agent('DMC $0/%I%')\n");
$ua->agent("DMC $0/%I%");
echo("\$response = \$ua->timeout($timeout)\n");
$response = $ua->timeout($timeout);
($opt_v or $URL_opt_v) && print "${sp}\$response=|$response|\n";
#----------------------------------------------------------------#
# Wrap this in alarm trap to (hopefully) kill hanging #
# requests. #
# #
$http_OK = 1; # Hope for the best. #
$msg = "Alarm Timeout! ($url)"; #
local $SIG{ALRM} = sub { #
echo("$msg [\$@=|$@|]\n"); #
$http_OK = 0; #
}; #
$timeout_alarm = $timeout + 5; #
($opt_v or $URL_opt_v) && echo("alarm($timeout_alarm)\n"); #
alarm($timeout_alarm); #
#
echo("\$request = new HTTP::Request('GET', '$url')\n"); #
$request = new HTTP::Request("GET", "$url"); #
($opt_v or $URL_opt_v) && print "${sp}\$request=|$request|\n"; #
#
echo("\$response = \$ua->request($request)\n"); #
$response = $ua->request($request); #
#
($opt_v or $URL_opt_v) && echo("alarm(0)\n"); #
alarm(0); # Halt alarm. #
#
if ($@) # Propagate any errors (if any). #
{ #
@http_err = "$@"; #
foreach (@http_err) # Propagate any errors (if any).
{ print "${sp}\$@=|$_|\n"; } #
$@ = ""; #
} # if ($@) #
# #
#----------------------------------------------------------------#
$null_n = $response =~ s/\x00//g; # Strip nulls
$null_n ||= 0;
if ($null_n)
{
$msg = "${sp}Removed $null_n nulls from \$response\n";
$len = length($response);
$msg .= "${sp}\$response now $len bytes\n";
$subject = "$surname: NOTICE Nulls In HTTP Response";
email("$subject", "$msg", $support);
if ($opt_v)
{
print "${sp}Removed $null_n nulls from \$response\n";
$len = length($response);
print "${sp}\$response now at $len bytes\n";
}
}
($opt_v or $URL_opt_v) && print "${sp}\$response=|$response|\n";
#----------------------------------------------------------#
# In case of Alarm Timeout, $http_OK will be zero. We'll #
# still try to capture the following info, but we'll also #
# be testing both $http_OK and $response_OK before giving #
# our blessing for the connectivity test. #
#----------------------------------------------------------#
$response_OK = ($response->is_success);
echo("\$code = \$response->code\n");
$code = $response->code;
($opt_v or $URL_opt_v) && print "${sp}\$code = |$code|\n";
echo("\$desc = HTTP::Status::status_message($code)\n");
$desc = HTTP::Status::status_message($code);
($opt_v or $URL_opt_v) && print "${sp}\$desc = |$desc|\n";
#----------------------------------------------------------#
# Get headers #
#----------------------------------------------------------#
echo("\$headers = \$response->headers_as_string\n");
$headers = $response->headers_as_string;
if ($opt_v or $URL_opt_v)
{
@headers = split(/\n/,$headers); # Split on newlines
foreach (@headers)
{
print "${sp}headers=$_\n";
}
}
#--------------------------------------------------------------#
# $http_OK means we didn't alarm() out. $response_OK is from #
# "$response_OK = ($response->is_success);" above. If both #
# of these look good, then we check next for any HTTP output #
# we're supposed to find. #
#--------------------------------------------------------------#
if ($http_OK and $response_OK)
{
#----------------------------------------------------------#
# If we have expected or alternate responses, then check #
# them before sounding the "All clear." #
#----------------------------------------------------------#
if (
(defined($expd_response) and $expd_response ne "")
or
(defined($alt_response ) and $alt_response ne "")
)
{
#----------------------------------------------------#
# Get body -- print as needed. #
#----------------------------------------------------#
echo("\$body = \$response->content\n");
$body = $response->content;
@body = split(/\n/,$body); # Split body on newlines
if ($opt_v or $URL_opt_v)
{
foreach (@body)
{
print "${sp}content=$_\n"
}
} # if ($opt_v or $URL_opt_v)
@grep_response = grep(/$expd_response/, @body);
$response_n = @grep_response;
#----------------------------------------------------#
# If 1st response found, look for any optional/add'l.#
#----------------------------------------------------#
if (
$response_n > 0
&&
defined($addl_response)
&&
$addl_response ne ""
)
{
@grep_response = grep(/$addl_response/, @body);
$response_n = @grep_response;
}
#----------------------------------------------------#
# Response not found, any alternate response? #
#----------------------------------------------------#
if ($response_n == 0)
{
if (defined($alt_response) and $alt_response ne "")
{
@grep_response = grep(/$alt_response/, @body);
$response_n = @grep_response;
}
}
#----------------------------------------------------#
# Neither expected nor alternate response found. #
#----------------------------------------------------#
if ($response_n == 0)
{
if ($n > 1) # for (my $n=1; $n<=$retry; $n++)
{
$epage_msg = "$host: Web connection to $uiPID "
. "failed (expected response not found)";
notify_support(); # Modifies $epage_msg
$msg = "$host|$uiPID|$url|$alert|$epage_msg";
no strict 'refs';
${$alert}++;
use strict 'refs';
ELS_Agent("$msg");
}
next; # Iterate "for (my $n=1; $n<=$retry; $n++)"
}
} # if (defined($expd_response) and ..
#------------------------------------------------------#
# Else, $http_OK is sufficient for "All clear." #
#------------------------------------------------------#
$shortdesc = "Successful web connection to $uiPID";
$n++; # Incr $n--no need to try again; it was successful.
$msg = "$host|$uiPID|$url|green|$shortdesc|";
$green++;
ELS_Agent("$msg");
echo("$0: $shortdesc\n");
last; # for (my $n=0; $n<=1; $n++)
} # if ($http_OK)
elsif ($n > ($retry - 1)) # Something's amuck.
{
$epage_msg = "$host: Web connection to $uiPID failed";
if (@http_err)
{
$epage_msg .= " [";
foreach (@http_err) { $epage_msg .= "$_ "; }
$epage_msg =~ s/\s+$/\]/;
}
notify_support(); # Modifies $epage_msg (appends to it).
$msg = "$host|$uiPID|$url|$alert|$epage_msg";
no strict 'refs';
${$alert}++;
use strict 'refs';
ELS_Agent("$msg");
} # if ($http_OK); elsif ($n > 1)
else
{
sleep(2);
} # if ($http_OK); elsif ($n > 1); else
} # for (my $n=0; $n<=1; $n++)