  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)

Revision: $Id$
