Using perl Syntax Highlighting
sub monitor{
my $host = $_[0];
my $count = $_[1];
my $dirTxt = $_[2];
my $ping;
my $fecha;
my $verFqn = Net::DNS::Resolver->new;
print "<br>aqui estoy</br>\n";
if ($verFqn->query($host)){
$ping = qx(/sbin/ping -c$count $host);
$fecha = qx(date +_%Y-%m-%d_%H:%M.txt);
open(texto, ">$dirTxt/$host$fecha");
print texto $ping;
close(texto);
print "existe el host";
} else {
print "<br>Usted a ingresado un host inválido</br>";
}
}
my $host = $_[0];
my $count = $_[1];
my $dirTxt = $_[2];
my $ping;
my $fecha;
my $verFqn = Net::DNS::Resolver->new;
print "<br>aqui estoy</br>\n";
if ($verFqn->query($host)){
$ping = qx(/sbin/ping -c$count $host);
$fecha = qx(date +_%Y-%m-%d_%H:%M.txt);
open(texto, ">$dirTxt/$host$fecha");
print texto $ping;
close(texto);
print "existe el host";
} else {
print "<br>Usted a ingresado un host inválido</br>";
}
}
Coloreado en 0.004 segundos, usando GeSHi 1.0.8.4