stta/stta/tmp/sp/hosts/tta_alivehosts.cgi
2021-10-01 20:35:43 +01:00

55 lines
1.6 KiB
Perl
Executable File

#!/usr/bin/perl
# tta_alivehosts.cgi
# Alive Hosts from Services with Tarantella
# STTA Rev. 1.3 Copyright (c) 2001-2002 Jesús Pérez Lorenzo --- license GNU GPL
require './stta-lib.pl';
&ReadParse();
$hostname = $in{hostname};
if (!$hostname) { &redirect("tta_selhosts.cgi?form=alivehosts"); }
$postform = $in{postform};
&headerstta($text{'index_alivehosts'}, "", "alivehosts",undef,1,1,$text{headpage_rigth} );
print "<hr><p>\n";
print "<table width=100% border>\n";
if ( !$hostname ) {&footHere; exit } ;
%h_hosts=&list_hosts();
%h_grphosts=&list_grphosts();
if ($hostname && $hostname ne "all" ) {
$obj_name="";
$ens_hosts="";
$dns_hosts="";
if ( $h_hosts{$hostname}->{'alias'} ne $hostname ) {
$err_msg=$text{'list_err'};
&footHere;
exit;
}
}
if ( $hostname eq "all" ) {
$title=$text{edit_all};
} else {
$title="$h_hosts{$hostname}->{name} ($h_hosts{$hostname}->{ipname})";
}
print "<tr $tb> <td><b>$text{'titidx_alivehosts'} $title </b></td> </tr>\n";
print "<tr $cb> <td><table width=100%>\n";
print "<center>\n";
$rv = { 'fh' => time().$$ };
if ( $hostname eq "all" ) {
foreach $item (keys (%h_hosts)) {
next if ( !$h_hosts{$item}->{'portalive'}) ;
$hosts_status=&check_host($item,"true");
print "<tr><td><b>$hosts_status</b></td></tr>\n";
}
} else {
$hosts_status=&check_host($hostname,"true");
print "<tr><td><b>$hosts_status</b></td></tr>\n";
}
print "<tr><tr></table></table><hr><p>\n";
&footer($config{'back_return'},$text{'index'});
print "<p><p><p>\n";
do "footer.pl";
exit;