jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [ntp/] [makeindex.pl] - Rev 30 Go to most recent revision

Compare with Previous - Blame - Download


#!/usr/bin/env perl

# $Id: makeindex.pl,v 1.10 2004/06/02 23:25:10 bernisys Exp $

# include PERL libraries
use warnings;
use diagnostics;

# include HotSaNIC libraries
use lib "../../lib";
use lib "./platform";
use HotSaNICparser;
use HotSaNIChtml;
use common;

(my $VERSION = '$Revision: 1.10 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: makeindex.pl,v 1.10 2004/06/02 23:25:10 bernisys Exp $') =~ s/.*,v (.*) \$/$1/;

# read global settings
#
$MODNAME=lc HotSaNICparser::get_module_name();
%CONFIG=HotSaNICparser::get_config("../..");
$IMAGEFORMAT=$CONFIG{IMAGEFORMAT};
$WEBDIR=$CONFIG{WEBDIR}."/".lc $MODNAME;
$VARDIR=$CONFIG{VARDIR}."/modules/".lc $MODNAME;
$REFRESH=$CONFIG{REFRESH};
$REFRESH=0 if !defined $REFRESH;

%MODCONFIG=HotSaNICmod::common::configure();
@DIAGRAMS=("hour","6h","day","week","month","year");
@TIMES=("6h","week");
@GRAPHS=("stratum","distance","dispersion","frequency","stability");

# build time-based .html files
#
foreach $time (@TIMES) {
  open (FILE,">$WEBDIR/$time.html");
  print FILE HotSaNIChtml::create_header($MODNAME,$REFRESH,"$time overview page")."<table>\n";
  foreach $graph (@GRAPHS) {
    foreach $entry (@{$MODCONFIG{HOST}}) {
      my (undef,undef,undef,$dbname,$name,$file,$description)=HotSaNICmod::common::get_names($entry,$graph);
      print FILE HotSaNIChtml::create_table_entry($IMAGEFORMAT,$file,$time,$name,$description,1);
      }
    }
  print FILE "</table>\n".HotSaNIChtml::create_footer($MODNAME);
  close FILE;
  }

# build device-based .html files and complete index
#
my $maxcols = scalar@{$MODCONFIG{HOST}};
open (IDXFILE,">$VARDIR/idxdata");
print IDXFILE HotSaNIChtml::create_overview_table_header($MODNAME,join(" ",@TIMES),$maxcols);
$num=0;
foreach $graph (@GRAPHS) {
  $num++;
  foreach $entry (@{$MODCONFIG{HOST}}) {
    my (undef,undef,undef,$dbname,$name,$file,$description)=HotSaNICmod::common::get_names($entry,$graph);
    print IDXFILE HotSaNIChtml::create_overview_table_entry($MODNAME,$IMAGEFORMAT,$num,$file,$name,$description);
    HotSaNIChtml::make_device_page($MODNAME,$WEBDIR,$IMAGEFORMAT,$file,$description,@DIAGRAMS);
    }
  }

close IDXFILE;



Powered by WebSVN 2.2.1