print ' Exchange\' xAxisName=\'fecha\' yAxisName=\'Segundos\' numberSuffix=\'sec\' '; print ' numberSuffix=\'sec\' labelStep=\'5\' labelDisplay=\'ROTATE\' slantLabels=\'0\' showValues=\'0\' yAxisMinValue=\'0\' setAdaptiveYMin=\'0\' >'."\n"; my $ref=0; while(<>){ chop(); s/Summary: test //; s/ tiene.*RTT de//; s/ secs.*//; ($hora,$fecha,$dato)=split(/ /, $_); print ''."\n"; if ($dato > $ref){ $ref=$dato; } } print "\n"; if ($dato > 60 ){ open (ERROR_LOG, ">> error.log"); print ERROR_LOG "$fecha $hora $dato segundos \n"; close ERROR_LOG; my $sendmail = "/usr/sbin/sendmail -t"; my $reply_to = "Reply-to: user\@dominio.es\n"; my $From = "From: user\@dominio.es\n"; my $subject = "Subject: Exchange XXX:el mensaje de $fecha $hora ha superado los 60 sec de delay ($dato) sec\n"; # my $content = "Exchange XXX: el mensaje de $fecha $hora ha superado los 60 sec de delay ($dato) sec\n"; my $to = "jose.de.arce\@gmail.com "."\n"; my $file = "subscribers.txt"; my $send_to = "To: ".$to; open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!"; print SENDMAIL $From; print SENDMAIL $reply_to; print SENDMAIL $subject; print SENDMAIL $send_to; print SENDMAIL "Content-type: text/plain\n\n"; print SENDMAIL $content; close(SENDMAIL); }