jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [branches/] [HotSaNIC-0.5.0-pre6/] [modules/] [ping/] [setup.pl] - Blame information for rev 18

 

Line No. Rev Author Line
11simandl#!/usr/bin/env perl
2 
3# $Id: setup.pl,v 1.11 2004/07/12 07:50:15 bernisys Exp $
4 
5# include PERL libraries
6use strict;
7use warnings;
8use diagnostics;
9 
10# include HotSaNIC libraries
11use lib "../../lib";
12use lib "./platform";
13use HotSaNICparser;
14 
15use HotSaNIClog;
16use common;
17 
18$|=1;
19 
20(my $VERSION = '$Revision: 1.11 $') =~ s/.*(\d+\.\d+).*/$1/;
21(my $IDENTIFIER = '$Id: setup.pl,v 1.11 2004/07/12 07:50:15 bernisys Exp $') =~ s/.*,v (.*) \$/$1/;
22 
23my $MODNAME=HotSaNICparser::get_module_name();
24my %MODCONF=HotSaNICmod::common::configure();
25my $OUTFILE="settings.new";
26if ( ! -e "settings" ) { $OUTFILE="settings"; }
27open OUTFILE,">$OUTFILE" || die "could not open ".HotSaNICparser::get_module_name()." settings file for writing.\n";
28 
29if (@{$MODCONF{HOST}}) { $MODCONF{HOST}="HOST=\"".join("\"\nHOST=\"",@{$MODCONF{HOST}})."\""; }
30else { $MODCONF{HOST}=""; }
31 
32 
33print OUTFILE "# query-interval in seconds.
34#
35INTERVAL=\"$MODCONF{INTERVAL}\"
36 
37# set type of diagrams (whatever you like best ... Thanx M. Renner! :) )
38# classic (default) -> shade ranges for min, avg, max in different colors
39# simple -> only shade area between min and max in light blue
40#
41TYPE=\"$MODCONF{TYPE}\"
42 
43# set diagram scaling
44# log -> set logarithmic scaling (default)
45# lin -> set linear scaling
46#
47# This item was previously named \"SCALE\"
48#
49GRAPH_STYLE=\"$MODCONF{GRAPH_STYLE}\"
50 
51# set diagram initial upper border in milliseconds (for better graph comparison)
52# GRAPH_MAX=\"10\" sets all diagrams upper border to 10ms
53# GRAPH_MAX=\"0.01\" sets all diagrams upper border to 100us
54#
55# This item was previously named \"UPPER\"
56#
57GRAPH_MAX=\"$MODCONF{GRAPH_MAX}\"
58 
59# how many ping processes shall be done in parallel. Reducing the number
60# causes the process to run longer, but keeps your system load a bit lower.
61#
62PARALLEL=\"$MODCONF{PARALLEL}\"
63 
64# which PING method shall be used by default
65# If you run HotSaNIC without root privileges, you should either use \"ping\" or
66# \"perl-tcp\" - but note, that some hosts don't reply to tcp ping packages!
67#
68# valid methods are:
69# perl-icmp use Net::Ping library / Proto: ICMP (default)
70# perl-tcp use Net::Ping library / Proto: TCP
71# ping use the system's \"ping\" command
72# echo use \"echoping\" / Proto: ECHO
73# echo-udp use \"echoping\" / Proto: UDP
74# echo-icp use \"echoping\" / Proto: ICP
75# echo-http use \"echoping\" / Proto: HTTP
76# echo-smtp use \"echoping\" / Proto: SMTP
77# echo-disc use \"echoping\" / Proto: discharge
78# echo-cgen use \"echoping\" / Proto: chargen
79#
80METHOD=\"$MODCONF{METHOD}\"
81 
82# configure multiple destinations of the form:
83# HOST=<host>,<description>,<method>
84#
85# method can be one of the above methods, it overrides the default method
86#
87$MODCONF{HOST}
88";
89 
90close OUTFILE;
91 
92if ($OUTFILE eq "settings.new") {
93 HotSaNICparser::backup_file("settings");
94 rename "settings.new","settings";
95 }
96 
97print "Please check the settings file and adapt it to satisfy your needs.\n";
98if ($OUTFILE ne "settings.new") {
99 print "you probably have to configure some destination hosts.\n";
100 }
101 

Powered by WebSVN 2.2.1