![]() ![]() |
hotsanic |
Subversion Repositories: |
Compare with Previous - Blame - Download
#!/usr/bin/env shif ! [ -e settings ]; then OUTFILE="settings"; else OUTFILE="settings.new"; ficat > $OUTFILE << EOF# query-interval in seconds.#EOFvar=`cat settings|grep "^INTERVAL="`if [ "$var" = "" ]; then var="INTERVAL=\"60\"";fiecho $var >> $OUTFILEcat >> $OUTFILE << EOF# 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#EOFvar=`cat settings|grep "^TYPE="`if [ "$var" = "" ]; then var="TYPE=\"classic\"";fiecho $var >> $OUTFILEcat >> $OUTFILE << EOF# set diagram scaling# log -> set logarithmic scaling (default)# lin -> set linear scaling#EOFvar=`cat settings|grep "^SCALE="`if [ "$var" = "" ]; then var="SCALE=\"log\"";fiecho $var >> $OUTFILEcat >> $OUTFILE << EOF# set diagram initial upper border in milliseconds (for better graph comparison)# UPPER="10" sets all diagrams upper border to 10ms# UPPER="0.01" sets all diagrams upper border to 100us#EOFvar=`cat settings|grep "^UPPER="`if [ "$var" = "" ]; then var="UPPER=\"1\"";fiecho $var >> $OUTFILEcat >> $OUTFILE << EOF# 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.#EOFvar=`cat settings|grep "^PARALLEL="`if [ "$var" = "" ]; then var="PARALLEL=\"4\"";fiecho $var >> $OUTFILEcat >> $OUTFILE << EOF# use system's "ping" command instead of perl library. This is useful when not# running as root. Fallback is implemented in case Net::Ping is not installed# on your system## SYSPING="0" use Net::Ping library (default)# SYSPING="1" use system command#EOFvar=`cat settings|grep "^SYSPING="`if [ "$var" = "" ]; then var="SYSPING=\"0\"";fiecho $var >> $OUTFILEcat >> $OUTFILE << EOF# If SYSPING is set to "0", then you may specify the protocol used to ping all# hosts. Valid are "icmp" (the default) and "tcp". If you run HotSaNIC without# root privileges, you should use "tcp" - but note, that some hosts don't reply# to tcp ping packages!## PROTOCOL="icmp"#EOFvar=`cat settings|grep "^PROTOCOL="`if [ "$var" = "" ]; then var="PROTOCOL=\"icmp\"";fiecho $var >> $OUTFILEcat >> $OUTFILE << EOF# configure multiple destinations of the form:# HOST=<host>,<description>#EOFif [ "$OUTFILE" = "settings.new" ]; thencat settings | grep "^HOST=" >> $OUTFILEfiechoecho "Please check the settings file and adapt it to satisfy your needs."echo "you have to configure some destination hosts."if [ "$OUTFILE" = "settings.new" ]; thenmkdir -p backupNOW=`date +%Y%m%d-%H%M%S`mv -f settings backup/settings-$NOWmv -f settings.new settingsecho "a backup of the previous settings has been saved."fiecho