jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [system/] [setup] - Rev 27 Go to most recent revision

Compare with Previous - Blame - Download


#!/usr/bin/env sh

if ! [ -e settings ]; then OUTFILE="settings"; else OUTFILE="settings.new"; fi

cat > $OUTFILE <<EOF
# Since the cpu stats lack support of multiprocessor machines,
# this is a little HotFix for users who want their CPU graphs
# to show values reaching above 1. Be sure that this is just a
# multiplier for the values stored in the CPU database. And
# only effects the diagrams, not the values stored!
#
EOF

var=`cat settings | grep "^NUMCPU="`
if [ "$var" = "" ]; then var="NUMCPU=\"1\""; fi
echo "$var" >>$OUTFILE

cat >> $OUTFILE <<EOF

# This modifies the output format of the CPU graphs.
# If you prefer a percentage legend over the absoulte, just set
#   CPUGRAPH="percent"
# otherwhise set it to what ever you like.
#
EOF

var=`cat settings | grep "^CPUGRAPH="`
if [ "$var" = "" ]; then var="CPUGRAPH=\"1\""; fi
echo "$var" >>$OUTFILE

cat >> $OUTFILE << EOF

# Configure which module sections to run locally
# 
# Example:
# SECTIONS="cpu load proc mem users int uptime"
SECTIONS="cpu load proc mem users int uptime"


# Configure SNMP monitored hosts
#
# HOST=SNMP:<host>:<community>,<description>
#
# Example:
# HOST=SNMP:somehost:public,Router

# IRQ description
#
# IRQ=<number>,<short description>
#
# The short description will be trimmed to 5 chars in the diagrams.
#
# example (for an IBM compatible PC):
#
# IRQ=0,timer
# IRQ=1,kbd
# IRQ=2,casc
# IRQ=3,ser1
# IRQ=4,ser2
# IRQ=5,?
# IRQ=6,fdd
# IRQ=7,lpt
# IRQ=8,rtc
# IRQ=9,?
# IRQ=10,?
# IRQ=11,?
# IRQ=12,?
# IRQ=13,CoPro
# IRQ=14,?
# IRQ=15,?
#
EOF

if [ "$OUTFILE" = "settings.new" ]; then
    cat settings | grep "^IRQ=" >> $OUTFILE
  else
    cat >> $OUTFILE << EOF
IRQ=0,timer
IRQ=1,kbd
IRQ=2,casc
IRQ=3,ser1
IRQ=4,ser2
IRQ=5,
IRQ=6,fdd
IRQ=7,lpt
IRQ=8,rtc
IRQ=9,
IRQ=10,
IRQ=11,
IRQ=12,
IRQ=13,CoPro
IRQ=14,
IRQ=15,

EOF
  fi

echo
echo "Please check the settings file and adapt it to satisfy your needs."
if [ "$OUTFILE" = "settings.new" ]; then
  mkdir -p backup
  NOW=`date +%Y%m%d-%H%M%S`
  mv -f settings backup/settings-$NOW
  mv -f settings.new settings
  echo "a backup of the previous settings has been saved."
  fi
echo


Powered by WebSVN 2.2.1