1 | 1 | simandl | #!/usr/bin/env sh |
2 | | | |
3 | | | if ! [ -e settings ]; then OUTFILE="settings"; else OUTFILE="settings.new"; fi |
4 | | | |
5 | | | cat > $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 | | | # |
12 | | | EOF |
13 | | | |
14 | | | var=`cat settings | grep "^NUMCPU="` |
15 | | | if [ "$var" = "" ]; then var="NUMCPU=\"1\""; fi |
16 | | | echo "$var" >>$OUTFILE |
17 | | | |
18 | | | cat >> $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 | | | # |
25 | | | EOF |
26 | | | |
27 | | | var=`cat settings | grep "^CPUGRAPH="` |
28 | | | if [ "$var" = "" ]; then var="CPUGRAPH=\"1\""; fi |
29 | | | echo "$var" >>$OUTFILE |
30 | | | |
31 | | | cat >> $OUTFILE << EOF |
32 | | | |
33 | | | # Configure which module sections to run locally |
34 | | | # |
35 | | | # Example: |
36 | | | # SECTIONS="cpu load proc mem users int uptime" |
37 | | | SECTIONS="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 | | | # |
72 | | | EOF |
73 | | | |
74 | | | if [ "$OUTFILE" = "settings.new" ]; then |
75 | | | cat settings | grep "^IRQ=" >> $OUTFILE |
76 | | | else |
77 | | | cat >> $OUTFILE << EOF |
78 | | | IRQ=0,timer |
79 | | | IRQ=1,kbd |
80 | | | IRQ=2,casc |
81 | | | IRQ=3,ser1 |
82 | | | IRQ=4,ser2 |
83 | | | IRQ=5, |
84 | | | IRQ=6,fdd |
85 | | | IRQ=7,lpt |
86 | | | IRQ=8,rtc |
87 | | | IRQ=9, |
88 | | | IRQ=10, |
89 | | | IRQ=11, |
90 | | | IRQ=12, |
91 | | | IRQ=13,CoPro |
92 | | | IRQ=14, |
93 | | | IRQ=15, |
94 | | | |
95 | | | EOF |
96 | | | fi |
97 | | | |
98 | | | echo |
99 | | | echo "Please check the settings file and adapt it to satisfy your needs." |
100 | | | if [ "$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 |
107 | | | echo |
108 | | | |