jablonka.czprosek.czf

hotsanic

Subversion Repositories:
[/] [trunk/] [modules/] [system/] [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# Since the cpu stats lack support of multiprocessor machines,
7# this is a little HotFix for users who want their CPU graphs
8# to show values reaching above 1. Be sure that this is just a
9# multiplier for the values stored in the CPU database. And
10# only effects the diagrams, not the values stored!
11#
12EOF
13 
14var=`cat settings | grep "^NUMCPU="`
15if [ "$var" = "" ]; then var="NUMCPU=\"1\""; fi
16echo "$var" >>$OUTFILE
17 
18cat >> $OUTFILE <<EOF
19 
20# This modifies the output format of the CPU graphs.
21# If you prefer a percentage legend over the absoulte, just set
22# CPUGRAPH="percent"
23# otherwhise set it to what ever you like.
24#
25EOF
26 
27var=`cat settings | grep "^CPUGRAPH="`
28if [ "$var" = "" ]; then var="CPUGRAPH=\"1\""; fi
29echo "$var" >>$OUTFILE
30 
31cat >> $OUTFILE << EOF
32 
33# Configure which module sections to run locally
34#
35# Example:
36# SECTIONS="cpu load proc mem users int uptime"
37SECTIONS="cpu load proc mem users int uptime"
38 
39 
40# Configure SNMP monitored hosts
41#
42# HOST=SNMP:<host>:<community>,<description>
43#
44# Example:
45# HOST=SNMP:somehost:public,Router
46 
47# IRQ description
48#
49# IRQ=<number>,<short description>
50#
51# The short description will be trimmed to 5 chars in the diagrams.
52#
53# example (for an IBM compatible PC):
54#
55# IRQ=0,timer
56# IRQ=1,kbd
57# IRQ=2,casc
58# IRQ=3,ser1
59# IRQ=4,ser2
60# IRQ=5,?
61# IRQ=6,fdd
62# IRQ=7,lpt
63# IRQ=8,rtc
64# IRQ=9,?
65# IRQ=10,?
66# IRQ=11,?
67# IRQ=12,?
68# IRQ=13,CoPro
69# IRQ=14,?
70# IRQ=15,?
71#
72EOF
73 
74if [ "$OUTFILE" = "settings.new" ]; then
75 cat settings | grep "^IRQ=" >> $OUTFILE
76 else
77 cat >> $OUTFILE << EOF
78IRQ=0,timer
79IRQ=1,kbd
80IRQ=2,casc
81IRQ=3,ser1
82IRQ=4,ser2
83IRQ=5,
84IRQ=6,fdd
85IRQ=7,lpt
86IRQ=8,rtc
87IRQ=9,
88IRQ=10,
89IRQ=11,
90IRQ=12,
91IRQ=13,CoPro
92IRQ=14,
93IRQ=15,
94 
95EOF
96 fi
97 
98echo
99echo "Please check the settings file and adapt it to satisfy your needs."
100if [ "$OUTFILE" = "settings.new" ]; then
101 mkdir -p backup
102 NOW=`date +%Y%m%d-%H%M%S`
103 mv -f settings backup/settings-$NOW
104 mv -f settings.new settings
105 echo "a backup of the previous settings has been saved."
106 fi
107echo
108 

Powered by WebSVN 2.2.1