/[omni_gantt]/repgen.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /repgen.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Fri May 9 23:52:47 2003 UTC (20 years, 10 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/plain
Use omnirep to generate *HYPERLINKD* reports (it's html for god sake!)

1 #!/usr/bin/perl -w
2 #
3 # Generate hyperlinked OmniBack reports
4 #
5 # 2003-05-09 Dobrica Pavlinusic <dpavlin@pliva.hr>
6 #
7
8 use strict;
9 use HTML::TreeBuilder;
10
11 # location of omnirpt binary
12 my $omnirpt="/usr/omni/bin/omnirpt";
13 # output html pages to...
14 my $dir="/data/mon/omni/";
15 # master report
16 #my $master="index.html";
17 my $master="omni.html";
18 # how many hours to include in master report?
19 my $hr = 36;
20
21 my $html;
22 my %errors;
23
24 open(OR, "$omnirpt -report list_sessions -timeframe $hr $hr -html |") || die "list_sessions: $!";
25 while(<OR>) {
26 $html .= $_;
27 }
28 close(OR);
29
30 my $tree = HTML::TreeBuilder->new;
31 $tree->parse($html);
32 foreach my $tr ($tree->look_down('_tag', 'tr')) {
33
34 my $el = scalar $tr->content_list;
35 if ($el > 10) {
36 my @line;
37 foreach ($tr->look_down('_tag','td')) {
38 push @line,$_->as_text;
39 }
40 if ($line[1] &&
41 $line[1] ne "Completed" &&
42 $line[1] ne "In Progress" &&
43 $line[1] ne "Queuing"
44 ) {
45 #print "## $line[1]\n";
46 my $backup_spec = $line[0];
47 my $filename = lc($backup_spec);
48 $filename =~ s#[^a-z0-9]+#_#g;
49 if (! $errors{$backup_spec}) {
50 dump_rpt("-report backup_errors -timeframe $hr $hr -datalist $backup_spec",$filename);
51 $html =~ s#>$backup_spec<#><a href="$filename.html">$backup_spec</a><#gms;
52 $errors{$backup_spec}++;
53 }
54 }
55
56 my $session = $line[$#line];
57 if ($session) {
58 my $filename = $session;
59 $filename =~ s#/#-#g;
60 dump_rpt("-report session_objects -session $session",$filename);
61 $html =~ s#>$session<#><a href="$filename.html">$session</a><#gms;
62 }
63 }
64 }
65
66 $tree->delete;
67
68 # dump master report
69 open(WR, "> $dir/index.html") || die "can't create $dir/index.html: $!";
70 print WR $html;
71 close(WR);
72
73 # -report session_flow -timeframe 24 24 -html
74 #
75 #
76
77
78 sub dump_rpt {
79 my $arg = shift @_;
80 my $filename = shift @_;
81 $filename .= ".html";
82
83 #print "$filename\n";
84
85 # create session report
86 open(WSO, "> $dir/$filename") || die "can't create $dir/$filename: $!";
87 open(SO, "$omnirpt $arg -html |") || die "$arg: $!";
88 while(<SO>) {
89 print WSO $_;
90 }
91 close(SO);
92 close(WSO);
93 }
94

  ViewVC Help
Powered by ViewVC 1.1.26