$ucservice =~ tr/a-z/A-Z/;
my $lcservice = $service;
$lcservice =~ tr/A-Z/a-z/;
+ next if $services{$ucservice};
$services{$ucservice}++;
print OUT <<END;
define service{
END
} elsif ($service =~ /^HTTPS-CERT$/i) {
+ next if $services{'HTTPS-CERT'};
$services{'HTTPS-CERT'}++;
print OUT <<END;
define service{
}
# prep a bunch of variables for the text we'll spit out
my $description = "$protocol-$server-$path";
+ $description =~ tr/A-Z/a-z/;
+ next if $services{$description};
+ $services{$description}++;
$description =~ s/-\//-/g;
$description =~ s/\/-/-/g;
$description =~ s/\//-/g;
$description =~ s/-$//g;
- $description =~ tr/A-Z/a-z/;
my $ucdescription = $description;
$ucdescription =~ tr/a-z/A-Z/;
my $SSL = "";
}
END
- if ($services{$protocol}) {
+ if ($services{$protocol} && $name eq $server) {
print OUT <<END;
define servicedependency{
dependent_host_name $name
printf STDERR "Machine %s has unknown service %s; ignoring\n", $name, $service;
}
} # if SERVICE else URL
-
- if ($services{'HTTPS'} && $services{'HTTPS-CERT'}) {
- print OUT <<END;
+ } # while @tags
+ if ($services{'HTTPS'} && $services{'HTTPS-CERT'}) {
+ print OUT <<END;
define servicedependency{
dependent_host_name $name
dependent_service_description HTTPS-CERT
}
END
- }
}
} # while $sth->fetchrow_array