jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [ping/] [setup] - Blame information for rev 36

 

Line No. Rev Author Line
11simandl#!/usr/bin/env sh
2 
3if ! [ -e settings ]; then OUTFILE="settings"; else OUTFILE="settings.new"; fi
4 
5cat > $OUTFILE << EOF
6# query-interval in seconds.
7#
8EOF
9var=`cat settings|grep "^INTERVAL="`
10if [ "$var" = "" ]; then var="INTERVAL=\"60\"";fi
11echo $var >> $OUTFILE
12 
13cat >> $OUTFILE << EOF
14 
15# set type of diagrams (whatever you like best ... Thanx M. Renner! :) )
16# classic (default) -> shade ranges for min, avg, max in different colors
17# simple -> only shade area between min and max in light blue
18#
19EOF
20var=`cat settings|grep "^TYPE="`
21if [ "$var" = "" ]; then var="TYPE=\"classic\"";fi
22echo $var >> $OUTFILE
23 
24cat >> $OUTFILE << EOF
25 
26# set diagram scaling
27# log -> set logarithmic scaling (default)
28# lin -> set linear scaling
29#
30EOF
31var=`cat settings|grep "^SCALE="`
32if [ "$var" = "" ]; then var="SCALE=\"log\"";fi
33echo $var >> $OUTFILE
34 
35cat >> $OUTFILE << EOF
36 
37# set diagram initial upper border in milliseconds (for better graph comparison)
38# UPPER="10" sets all diagrams upper border to 10ms
39# UPPER="0.01" sets all diagrams upper border to 100us
40#
41EOF
42var=`cat settings|grep "^UPPER="`
43if [ "$var" = "" ]; then var="UPPER=\"1\"";fi
44echo $var >> $OUTFILE
45 
46cat >> $OUTFILE << EOF
47 
48# how many ping processes shall be done in parallel. Reducing the number
49# causes the process to run longer, but keeps your system load a bit lower.
50#
51EOF
52var=`cat settings|grep "^PARALLEL="`
53if [ "$var" = "" ]; then var="PARALLEL=\"4\"";fi
54echo $var >> $OUTFILE
55 
56cat >> $OUTFILE << EOF
57 
58# use system's "ping" command instead of perl library. This is useful when not
59# running as root. Fallback is implemented in case Net::Ping is not installed
60# on your system
61#
62# SYSPING="0" use Net::Ping library (default)
63# SYSPING="1" use system command
64#
65EOF
66var=`cat settings|grep "^SYSPING="`
67if [ "$var" = "" ]; then var="SYSPING=\"0\"";fi
68echo $var >> $OUTFILE
69 
70cat >> $OUTFILE << EOF
71 
72# If SYSPING is set to "0", then you may specify the protocol used to ping all
73# hosts. Valid are "icmp" (the default) and "tcp". If you run HotSaNIC without
74# root privileges, you should use "tcp" - but note, that some hosts don't reply
75# to tcp ping packages!
76#
77# PROTOCOL="icmp"
78#
79EOF
80var=`cat settings|grep "^PROTOCOL="`
81if [ "$var" = "" ]; then var="PROTOCOL=\"icmp\"";fi
82echo $var >> $OUTFILE
83 
84cat >> $OUTFILE << EOF
85 
86# configure multiple destinations of the form:
87# HOST=<host>,<description>
88#
89EOF
90 
91if [ "$OUTFILE" = "settings.new" ]; then
92 cat settings | grep "^HOST=" >> $OUTFILE
93 fi
94 
95echo
96echo "Please check the settings file and adapt it to satisfy your needs."
97echo "you have to configure some destination hosts."
98if [ "$OUTFILE" = "settings.new" ]; then
99 mkdir -p backup
100 NOW=`date +%Y%m%d-%H%M%S`
101 mv -f settings backup/settings-$NOW
102 mv -f settings.new settings
103 echo "a backup of the previous settings has been saved."
104 fi
105echo
106 

Powered by WebSVN 2.2.1