jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [ping/] [setup.pl] - Rev 11 Go to most recent revision

Compare with Previous - Blame - Download


#!/usr/bin/env perl

# $Id: setup.pl,v 1.11 2004/07/12 07:50:15 bernisys Exp $

# include PERL libraries
use strict;
use warnings;
use diagnostics;

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

use HotSaNIClog;
use common;

$|=1;

(my $VERSION = '$Revision: 1.11 $') =~ s/.*(\d+\.\d+).*/$1/;
(my $IDENTIFIER = '$Id: setup.pl,v 1.11 2004/07/12 07:50:15 bernisys Exp $') =~ s/.*,v (.*) \$/$1/;

my $MODNAME=HotSaNICparser::get_module_name();
my %MODCONF=HotSaNICmod::common::configure();
my $OUTFILE="settings.new";
if ( ! -e "settings" ) { $OUTFILE="settings"; }
open OUTFILE,">$OUTFILE" || die "could not open ".HotSaNICparser::get_module_name()." settings file for writing.\n";

if (@{$MODCONF{HOST}}) { $MODCONF{HOST}="HOST=\"".join("\"\nHOST=\"",@{$MODCONF{HOST}})."\""; }
else { $MODCONF{HOST}=""; }


print OUTFILE "# query-interval in seconds.
# 
INTERVAL=\"$MODCONF{INTERVAL}\"

# set type of diagrams (whatever you like best ... Thanx M. Renner! :) )
#   classic (default)  ->  shade ranges for min, avg, max in different colors
#   simple             ->  only shade area between min and max in light blue
#
TYPE=\"$MODCONF{TYPE}\"

# set diagram scaling
#   log -> set logarithmic scaling (default)
#   lin -> set linear scaling
#
# This item was previously named \"SCALE\"
#
GRAPH_STYLE=\"$MODCONF{GRAPH_STYLE}\"

# set diagram initial upper border in milliseconds (for better graph comparison)
#   GRAPH_MAX=\"10\"     sets all diagrams upper border to 10ms
#   GRAPH_MAX=\"0.01\"   sets all diagrams upper border to 100us
#
# This item was previously named \"UPPER\"
#
GRAPH_MAX=\"$MODCONF{GRAPH_MAX}\"

# how many ping processes shall be done in parallel. Reducing the number
# causes the process to run longer, but keeps your system load a bit lower.
#
PARALLEL=\"$MODCONF{PARALLEL}\"

# which PING method shall be used by default
# If you run HotSaNIC without root privileges, you should either use \"ping\" or
# \"perl-tcp\" - but note, that some hosts don't reply to tcp ping packages!
#
# valid methods are:
#   perl-icmp  use Net::Ping library / Proto: ICMP (default)
#   perl-tcp   use Net::Ping library / Proto: TCP
#   ping       use the system's \"ping\" command
#   echo       use \"echoping\" / Proto: ECHO
#   echo-udp   use \"echoping\" / Proto: UDP
#   echo-icp   use \"echoping\" / Proto: ICP
#   echo-http  use \"echoping\" / Proto: HTTP
#   echo-smtp  use \"echoping\" / Proto: SMTP
#   echo-disc  use \"echoping\" / Proto: discharge
#   echo-cgen  use \"echoping\" / Proto: chargen
#
METHOD=\"$MODCONF{METHOD}\"

# configure multiple destinations of the form:
# HOST=<host>,<description>,<method>
#
# method can be one of the above methods, it overrides the default method
#
$MODCONF{HOST}
";

close OUTFILE;

if ($OUTFILE eq "settings.new") {
  HotSaNICparser::backup_file("settings");
  rename "settings.new","settings";
  }

print "Please check the settings file and adapt it to satisfy your needs.\n";
if ($OUTFILE ne "settings.new") {
  print "you probably have to configure some destination hosts.\n";
  }


Powered by WebSVN 2.2.1