bungilo 0 Newbie Poster

I have munin installed and working but I would like it to report on my web server listening on 443. For any of the apache_ files (accesses, volume, etc) I have it configured as the following to try to get it to read https://<mysslpage>/server-status?auto: (this is just a section of the code I think my problem lies in - I have the full code if you need it)

my $URL = exists $ENV{'url'} ? $ENV{'url'} :
"https://<ipofsslserver>:%d/server-status?auto";
my @PORTS = exists $ENV{'ports'} ? split(' ', $ENV{'ports'}) : (443);

if ( exists $ARGV[0] and $ARGV[0] eq "autoconf" )
{
if ($ret)
{
print "no ($ret)\n";
exit 1;
}

my $ua = LWP::UserAgent->new(timeout => 30);

my @badports;
foreach my $port (@PORTS) {
my $url = sprintf $URL, $port;
my $response = $ua->request(HTTP::Request->new('GET',$url));
push @badports, $port unless $response->is_success and $response->content =~/^Total Accesses:/im;
}
if (@badports) {
print "no (no apache server-status or ExtendedStatus missing on ports
@badports)\n";
exit 1;
} else {
print "yes\n";
exit 0;
}
}

I can go to https://<mysslpage>/server-status?auto and it prints out all the information I would expect it to so I know info (a2enmod info) is working. However, when I run ./apache_accesses autoconf it prints out "no (no apache server-status or ExtendedStatus missing on ports @badports)". Maybe I need to change out the HTTP::Request but I'm not sure how to do this for SSL. Any suggestions?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.