-
Notifications
You must be signed in to change notification settings - Fork 19
/
README.linux
187 lines (143 loc) · 8.43 KB
/
README.linux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
To build xosview:
Follow the instructions found in README. In addition please consider
the following:
- The memory meter can now display shared memory correctly.
Unfortunatly, it needs more information than a "stock" linux
kernel provides to do this. It can get this information with
the help of a kernel module (memstat.o) which is provided with
this release. If this module is not loaded, then xosview will
not provide a "shared" memory field in the memory meter.
The memstat module is now built by default if you are running a 2.0.x
or 2.2.x kernel. Paal Beyer <pbeyer@online.no> provided code to make
it work under linux 2.1. At the moment it seems that 2.1 is in a bit
of a transitory state as far as the proc filesystem goes. So, the
memstat module is disabled by default for 2.1 kernels. It has been
built under linux2.1.71. If you do not want to build the memstat
module you can run configure with a '--disable-linux-memstat' switch.
At the moment this module will not work for the 2.4 kernels.
To install xosview:
If one installs xosview via the 'make install' target it will place
things in the following locations. The binary (xosview) will be copied
to /usr/bin/X11/xosview and will be suid root. If you do not want to
run xosview suid root (this will just disable the serial meters) you
can change the permissions to whatever you like. The X defaults for
xosview (Xdefaults) are copied to /usr/lib/X11/app-defaults/XOsview.
To run xosview :
- The network meter has been changed from the way it behaved in
version 1.3.2. It now displays the network usage in bytes / sec.
This is done by using the IP accounting features of the kernel.
Newer 2.1 series kernels contain this information in /proc/net/dev.
If you are running one of these kernels, xosview will use this
information and you will not need to read further in this section.
NOTE (2.1+ series kernels): /proc/net/dev has the downside of
logging ANY packet passing on your interface, regardless of its
destination/source. This causes the network meter to report
non-zero traffic even if there are no in/outbound packets from the
machine. Ipchains provides a way to solve this, but it requires
xosview to access /proc/net/ip_fwchains, which requires root
privileges (i.e. it's bad). If xosview is installed setuid root
it can access the ip_fwchains file: it'll then scan it for two
chains named "iacct" and "oacct" to determine traffic.
The chains are created with the following commands (you must
be root to execute this), where YOUR-IP is either your ip or
your hostname:
ipchains -N iacct
ipchains -N oacct
ipchains -A iacct -s \! YOUR-IP -d YOUR-IP
ipchains -A oacct -s YOUR-IP -d \! YOUR-IP
ipchains -A input -j iacct
ipchains -A output -j oacct
(these rules will also eliminate any traffic from your machine
to your machine).
If you are running an older 2.1 or 2.0 kernel then you must setup
ipaccounting to get the information for xosview. In order for this
new network meter to function you must do the following for older
kernels:
1 Make sure that IP accounting is enabled in your
kernel. This means you may need to rebuild it.
2 Enable IP accounting for all IP packets into and out
of your machine. This is done by using a program called
'ipfwadm'. The example below is how I run ipfwadm to do
this at boot time in my rc.local:
/sbin/ipfwadm -A -a -P all -S 192.168.0.3 -D 0/0
/sbin/ipfwadm -A -a -P all -S 0/0 -D 192.168.0.3
If you do not do these steps, you will still be able to use xosview.
You just will not be able to use the network meter.
- The serial meter code in has been updated so that it
displays more useful information. To do this xosview now looks
directly at a couple of the serial registers. As a result of
this, xosview now need to be suid root in order to use the serial
meters. If you try to use xosview with a serial meter enabled
and it is not suid root it will display a message to this effect
and exit. A non suid version of xosview will still function
normally. It just will not be able to run with the serial meters
toggled on. I hope that at some point in the future the Linux
/proc filesystem will provide some more useful serial stats and
xosview will not have to be suid to get serial information.
- The memory meter no longer displays shared memory by default. The
information found in /proc/meminfo is not sufficient to figure out
what percentage of real memory is being used for 'shared'. There
is a kernel module which comes with xosview that provides this
information. It is found in the linux/memstat directory. If this
module is loaded into the kernel, a new entry will show up in /proc
called /proc/memstat. Xosview will display a shared memory field if
it finds this file (ie the memstat module is loaded).
- If you have an SMP machine xosview will now show a seperate cpumeter
for each processor provided your kernel has support for this. To
get this to work you will need Jerome Forissier's kernel patch which
modifies the proc filesystem to provide stats on a per processor basis.
You can find this patch at the following URL:
http://www-isia.cma.fr/~forissie/smp_kernel_patch/
These patches are only needed for 2.0 kernels. Newer kernels
already have the patch.
- Raidmeter notes from Thomas Waldmann:
Linux now supports a RAID meter. This meter is disabled by default
since a couple of kernel patches are currently required to get
it working. It can be enabled via an X resource.
You need a kernel patched with raid0145-19990824 stuff AND
mdstat-tw1.diff. xosview RAID display won't work without
mdstat-tw1.diff applied!
Because I didn't find out the kernel variable which holds the md device
count, you have to set it in the Xdefaults file (you don't need to
change it if you have 1 md device). If you know how to modify the
kernel to make this obsolete, please tell me!
Also there might be some redundant values in /proc/mdstat - I just
included everything that was there in old format.
linux/mdstat-tw1.diff
change /proc/mdstat to be more easily readable and parseable
RAID1 and RAID5 arrays will give a nice "working disk map" and
"resync status" display. When using a RAID1 or RAID5 array it is
very important to NOTICE a disk failure. If you don't notice it
because your system continues to work normally, you'll have a bad
day if the next disk fails...
RAID0 won't give a senseful display because there is no "working
disk map" and there is no "resync status" at all. As RAID0 has no
redundancy you will for sure notice a disk failure (that's the
moment when all your data is gone and you need a backup tape), so
you maybe won't need xosview for that.
The usual disclaimer
====================
The patches work on my machine, but there's no guarantee at all.
Use on your OWN risk. If it breaks your RAID array, you own the parts.
What you need
=============
kernel source 2.2.11 or 2.2.12 or 2.2.13
(ftp.kernel.org/pub/linux/kernel/...)
kernel RAID patch raid0145-19990824-2.2.11 + corresponding raidtools
(ftp.kernel.org/pub/linux/daemons/raid/alpha/...)
Installation
============
Kernel
------
Unpack kernel source, patch it with the RAID patch (if you are using
kernel 2.2.12 or 2.2.13 you will get some warnings. Answer "n" for
any question. You can ignore the warnings safely, you get them
because some stuff in the patch already IS in the kernel source).
Patch your kernel source with the mdstat-tw1.diff:
cd /usr/src/linux
patch -p1 <mdstat-tw1.diff
Compile / install kernel as usual.
Install raidtools source, compile it and install binaries.
Reboot.
cat /proc/mdstat to see new layout.
Mike Romberg (mike.romberg@noaa.gov)