Adding tbox reporting. -mcafee

This commit is contained in:
cltbld%netscape.com 2003-03-28 08:32:37 +00:00
Родитель 15f64b54b3
Коммит 236d058e2a
2 изменённых файлов: 35 добавлений и 13 удалений

Просмотреть файл

@ -12,7 +12,7 @@ my $script_dir = "/builds/tinderbox/mozilla/tools/tinderbox";
# Send data to graph server via HTTP. # Send data to graph server via HTTP.
require "$script_dir/reportdata.pl"; require "$script_dir/reportdata2.pl";
use Sys::Hostname; # for ::hostname() use Sys::Hostname; # for ::hostname()
@ -69,12 +69,15 @@ sub is_http_alive() {
# main # main
{ {
my $alive_time = 0; # Hours http has been up. my $alive_time = 0; # Hours http has been up.
my $alive = 0;
my $timefile = "$script_dir/http_alive_timefile.$ARGV[0]"; my $timefile = "$script_dir/http_alive_timefile.$ARGV[0]";
PrintUsage() if $#ARGV == -1; PrintUsage() if $#ARGV == -1;
if (is_http_alive()) { $alive = is_http_alive();
if ($alive) {
print "$ARGV[0] is alive\n"; print "$ARGV[0] is alive\n";
# #
@ -131,6 +134,22 @@ sub is_http_alive() {
"$alive_time", "$alive_time",
::hostname(), ::hostname(),
"http_alive", "http_alive",
"$ARGV[0]") "$ARGV[0]");
my $status = "";
if($alive) {
$status = "success";
} else {
$status = "busted";
}
# Hard-coded for now.
my $graph_url = "http://tegu.mozilla.org/graph/query.cgi?tbox=$ARGV[0]&testname=http_alive&autoscale=&size=&days=&units=hours&ltype=&points=&avg=&showpoint=";
ReportData::send_tbox_packet("tinderbox-daemon\@warp.mcom.com",
"Talkback",
$status,
"TinderboxPrint:<a title=\"Hours httpd:80 has been alive.\" href=\"$graph_url\">Ta</a>",
"$ARGV[0]",
"$ARGV[0] HTTP Alive Test");
} }

Просмотреть файл

@ -10,7 +10,7 @@ require 5.003;
use strict; use strict;
$::Version = '$Revision: 1.2 $ '; $::Version = '$Revision: 1.3 $ ';
package ReportData; package ReportData;
@ -52,30 +52,33 @@ sub send_results_to_server {
# Fake a tinderbox message. # Fake a tinderbox message.
sub send_tbox_packet { sub send_tbox_packet {
#my ($server, $status, $log, $build_name) = @_; my ($server_email, $tree, $status,
$log, $machine, $build_name) = @_;
my $foo; my $foo;
my $now = time(); my $now = time();
$foo .= <<END_PRINT; $foo .= <<END_PRINT;
tinderbox: tree: Talkback tinderbox: tree: $tree
tinderbox: builddate: $now tinderbox: builddate: $now
tinderbox: status: busted tinderbox: status: $status
tinderbox: build: Linux btek Depend tinderbox: build: $build_name
tinderbox: errorparser: unix tinderbox: errorparser: unix
tinderbox: buildfamily: unix tinderbox: buildfamily: unix
tinderbox: END tinderbox: END
END_PRINT END_PRINT
$foo .= $log;
print "foo = \n$foo\n"; print "foo = \n$foo\n";
open MSG, ">msg.txt"; open MSG, ">msg.$machine";
print MSG $foo; print MSG $foo;
close MSG; close MSG;
system "/bin/mail tinderbox-daemon\@warp.mcom.com " . "< msg.txt"; system "/bin/mail $server_email " . "< msg.$machine";
unlink "msg.txt"; unlink "msg.$machine";
} }