my($hpart,$urlpath) = ( $url =~ m|^([^/]+)(/.*)| );
my($hname,$port) = split(/:/,$hpart);
$port = 80 if ! $port;
- $hname = $host if ( ! $hname || $hname eq '_HOST_' );
+ #$hname = $host if ( ! $hname || $hname eq '_HOST_' );
+ if ( ! $hname ) {
+ $hname = $host;
+ } elsif ( $hname eq '_HOST_' ) {
+ $hname = $host;
+ $url =~ s/_HOST_/$host/;
+ }
my $message =
&check_tcp( $hname, $port,
my $code = $1;
if( $code >= 500 ) {
- $color = "red"; $summary = "error - $code - $url";
+ $color = "red"; $summary = "http error - $code - $url";
# Treat a 401 (authorization Required) code as a green
} elsif( $code >= 400 && $code != 401) {
if( $color ne "red" ) {
- $color = "yellow"; $summary = "warning - $code - $url"; }
+ $color = "yellow"; $summary = "http warning - $code - $url"; }
} else {
if( $color ne "red" && $color ne "yellow" ) {
- $color = "green"; $summary = "ok - $code"; }
+ $color = "green"; $summary = "http ok - $code"; }
}
} elsif( $message !~ /HTTP/m ) {
$color = "red"; $summary = "no response from http server";
my $code = $1;
if( $code >= 500 ) {
- $color = "red"; $summary = "error - $code - $file";
+ $color = "red"; $summary = "http error - $code - $file";
# Treat a 401 (authorization Required) code as a green
} elsif( $code >= 400 && $code != 401) {
if( $color ne "red" ) {
- $color = "yellow"; $summary = "warning - $code - $file"; }
+ $color = "yellow"; $summary = "http warning - $code - $file";
+ }
} else {
if( $color ne "red" && $color ne "yellow" ) {
- $color = "green"; $summary = "ok - $code"; }
+ $color = "green"; $summary = "http ok - $code"; }
}
} elsif( $message !~ /HTTP/m ) {
$color = "red"; $summary = "no response from http server";