API NetWorks Environmental Monitoring and misc. utilities
---------------------------------------------------------

This package consists of a hardware monitoring
daemon and a set of drivers for the i2c bus
controllers as well as the various i2c connected sensors
that are used on API NetWorks products.

The i2c and sensor drivers were ported from
the 2.4.0-test-x i2c drivers and lm_sensors-2.5.4.
A few of them are rewritten and modified to make the 
work with both 2.2.x and 2.4.x.

Driver Modules: 
--------------
Files : i2c-*.c sensors.c adm9240.c lm75.c


The drivers should be built against the kernel source
tree that was used to build the kernel you plan to run
with (and which has the .config file on top of the source tree).

To compile with the default source tree in /usr/src/linux

    # make

To use a different kernel source tree

    # make KERNSRC=/root/linux-2.4.0

To install the resulting drivers

    # make install

This will install the modules in the appropriate directories for your kernel version.
Version information in Makefile under kernel source tree is very important.
Redhat has multiple kernels in their distribution but their Makefile in
kernel source tree has version information which doesn't match what was
used to build the smp kernels.  For example, an smp kernel might be
named 2.2.4-6.0smp so the Makefile for smp kernel has to have the same name.

Edit the Makefile as follows to make the version info match

EXTRAVERSION=-6.0    ->    EXTRAVERSION=-6.0smp

without this modules will complain about version mismatches when insloaded.
You would need to modify /boot/kernel.h if smp configuration doesn't compile or
the module is not loaded well. Or just reboot the system then startup
script will modify /boot/kernel.h automatically.


Monitoring Daemon
-----------------
Files : hwmon*

A daemon program named hwmon will be installed to /usr/sbin/
After everything is installed just run hwmon. 

The distribution comes with a number of template configuration
files.  Select the correct file for your platform and copy
it to /etc/hwmon.conf.  The examples are named hwmon-<name>.conf
where <name> corresponds to API's internal code name for
the product.  The following table shows the equivalences

	CS20	Shark
	UP2000+	Swordfish+
	UP2000	Swordfish
	UP1100	
	UP1000	Nautilus

If desired, the configuration file can be edited to change
monitoring behavior and actions.

The monitor daemon takes the following flags

hwmon [-d] [-f fan_low_lim] [-u temp_high] [-l temp_low] [-i poll_interval]

-d is for daemon mode.


Startup script
--------------
Files : hwmon.d

As part of the installation process the file hwmon.d will be
copied to /etc/rc.d/init.d/hwmon and a link is created to it
from /etc/rc.d/rc3.d/S99hwmon so that the daemon will be started
automatically at the next system boot.


Asset info. util.
-----------------
Files : asset.c

You can manage 8582, 256 byte flash ROM in CS20, with this util.
If it runs without argument then it dumps whole image.
If it is given two arguments, one is address and the other is
data, it dumps whole image and write given data.
Argument form is like this. All arguments are in hexa.
./asset 3f 002a69
first 3f is address, and 002a69, three bytes of data.
It'll write 0x00 to 0x3f, 0x2a to 0x40 and 0x69 to 0x41.



Node ID LED control script for CS20
--------------------------------------------
Files : nodeid_cs20

To tell the system that users are interested in,
this script on/off the front panel LEDs.
In node indication mode, Red LED will stay on and amber LED will blink in 2Hz
In normal mode, Red LED will stay off and amber LED will blink depends on CPU load.

This script accepts one argument [on/off]



Node ID util. for UP2000+
-------------------------
Files : nodeid_up2k+.c

The utillity, nodeid_up2k+ blinks red LED in the front panel once a second.
It's usage is different from the same util. for CS20 because
This one is standalone and CS20's is daemon based.
So this one should be keep running to blink the LED while CS20's doesn't.
Or you can give "on" or "off" argument to make it stay on or off
and the util. will exit after changing the state.



System Activity LED Driver
--------------------------
Files : sysactled.c sysactled.d redled.c

This module uses the i2c bus to control the CS20 LEDs.

This will create three new pseudofiles in /proc/sys/dev/sysactled/

	README
	mode
	redled

The mode entry takes the following four values which control the
blinking of the amber light:

0 Amber LED blinks once a second if the system is idle.
  If there's CPU activity, then the light blinks at a rate determined
  by the system load.  I/O activity doesn't effect the rate, only CPU.
  [Default]

1 Amber LED blinks at a constant rate of 1 Hz

2 Amber LED blinks at a constant rate of 2Hz,
  This mode is used for Node Indication with redled.

3 Same as mode 0 except LED stays off if system is idle.
  Good for large clusters where lots of blinking lights is annoying.

To change the mode, write a the new value to /proc/sys/dev/sysactled/mode

    # echo 3 > /proc/sys/dev/sysactled/mode


RED LED
--------
Files : the same as sysactled

You can control red LED if i2c drivers are loaded already.
A utility to turn this light on and off is packaged as a
a binary contained in the activity light module to keep 
everything self-contained so this activity led driver can be loaded
even if i2c drivers are not loaded yet.

The utility isn't runnable in-place, so you'll need to 
copy it to a temporary location to be able to use it.

For example,

    # cp /proc/sys/dev/sysactled/redled /tmp	

You can then use the resulting binary to turn the red
LED on and of as follows:

    # /tmp/redled 0   -> to turn on the red LED.
    # /tmp/redled 2   -> to turn off the red LED.



