This document outlines the installation sequence as well as the steps to 
be followed for testing.

Install sequence : 
------------------
1) To setup the SNIA environment for testing, refer to 
http://www.opengroup.org/snia-cimom. The 'cmpi-adapter' package would have to 
be installed from the SBLIM site.
Alternately, for the pegasus environment, download the latest source using CVS
from http://openpegasus.org, and follow the instructions in the readme files.
JRE1.4 is required to set up the pegasus environment. j2sdk1.4.1_07 may be 
downloaded from http://java.sun.com/j2se/1.4.1.
Refer to README.txt within the ../src/Java directory in the source tree for 
installing the xerces jar which is also required for setting up the pegasus
environment. Download the xerces-1.4.4 version.
 
2) Install event logging (evlog-1.6.0-alpha) from the evlog site
(http://evlog.sf.net). 

3) Untar the code tarball (ela_indprovider.7.3.tar). For the package structure, 
refer to the README document. Untar the 'evsub_ela.tar' file if the code is to 
be used in the SNIA environment. If the code is to be used in  the SNIA environment, 
open the file 'env.snia' and set the paths therein to match the environment. 
Also uncomment "LOCAL=1" if evsub is to be used locally, or "REMOTE=1" if 
evsub is to be used remotely. Copy env.snia as env. If the code is to be 
used for testing with a remote client, refer to the section 'setup for 
testing with a remote client'. In case of a remote client, the evsub needs to 
be built separately on the remote machine (make clean, make all, and make 
install). In either case, the EVSUBHOST, EVSUBUSER, and EVSUBPASS variables 
in the createsub.sh file need to be set to the name of the host on which the 
provider runs (by which the client machine recognizes the machine on which the 
provider runs), the username used to call createsub.sh and the corresponding 
password. Note that the evsub/createsub.sh and evsub/cancelsub.sh files are
set for j2sdk1.4.1_07. Modify them according to your java environment. 

Alternately, if the code is to be used in the PEGASUS environment, untar
the 'pegasus_test.tar' file. Open the file 'env.pegasus', set the path variables 
accordingly, and copy the env.pegasus file as env. The pegasus source and the
other prereqs have to be set up on the local or remote client wherever it needs
to be tested.

4) In the top level directory, do a 'make clean', 'make' and 'make install'.
This will build and install the daemon called 'ela_daemon' and the parser and 
provider libraries. On the pegasus environment,  start cimserver by calling 
'cimserver' , and create the directory (as specified by MOFINSTALL in the 
env.pegasus file) if it doesnot exist, before doing a make install since the mof 
files are loaded only with the server started. Do a 'cimserver -s' to stop 
the server.

In the snia environment, this will also build and install the client code (evsub).
In the pegasus environment, this will build the source code for testing out 
the provider code (pegasus_test).

If step 2) couldnot be completed go to the 'sample' directory and do a make 
and a make install, for a sample script to test the provider.

5) Ensure that the property 'RequireAuthorization' is set to false in the file 
'/etc/sniacimom/client.properties' for the snia environment.  

6) Start the daemon (/etc/init.d/elad start). This in turn will start
/usr/sbin/ela_daemon.

Steps 7) through 10) apply only to the SNIA environment. For the Pegasus
environment, refer to the package readme file in pegasus_test directory.

7) start the cim server. Delete pending subscriptions (refer cleanup section 
below) if any, and load the /usr/sniacimom/lib/mof/Ela_Indication.mof file while
testing for SNIA. 
(in case of the pegasus environment, this is loaded by make install itself, and
the mof files donot have to be loaded explicitly).

8) start the evsub client by running createsub.sh on the local/ remote machine 
as the case may be. This should result in some output at the daemon window. 

9) If step 2) was successfully completed (event logging was installed and started), 
refer to the TestEla section below, else follow step 10). 

10) To test the provider in the absence of an actual report generator, follow the 
steps listed below under category 'Test'. 

11) To stop the daemon, use "/etc/init.d/elad stop".

12) To uninstall, 'make uninstall' may be used at the top level directory.

Note : After doing a make uninstall in the Pegasus environment, do the
following :
a) Ensure that the cimserver is started. Start it by calling 'cimserver' 
if it is not.
b) Call "cimprovider -r -m Ela_IndicationProviderModule" to delete the indi-
cation provider module. If this gives an error message (e.g. CIM_ERR_FAILED:
A general error occurred..), do a 'cimserver -s' to stop the cimserver and 
restart it. Retry the cimprovider command. If the message now shows as 
'Empty HTTP Response Message', then the cimserver has gone down and has 
to be started again. Try the cimprovider command again. Now, you should 
get a message 'Provider module deleted successfully' which confirms that 
the indication provider module has been deleted.

Test :
----
1) cd sample.
2) make all
3) make install.

The sample ela_report files under directory 'sample' are already installed at 
/var/evlog/ela_report/. 

ela_report9041 contains a menugoal report only.
ela_report9042 and ela_report9043 contain both srn and menugoal reports.
ela_report9044 contains a srn report only.

4) run './send_sig.sh 9042'. This should result in a popup displaying the fields
that are in the report, and an output at the cim server window showing the details 
of the indication delivered. 

5) send a signal with 9041. The output should show null for the srn related fields. 

6) send a signal with 9043. similar output as 4) 

7) With 9044 it should show null for the menugoal related fields. 

8) 'make uninstall' when done. 

9) To test the platform ela error reports, use send_sig_rt14.sh instead of send_sig.sh
for the same set of reports which are also installed in /etc/diagela/data.
(Create the /etc/diagela/data directory if it doesnot exist, before doing a make
install)

Setup for testing with a remote client:
--------------------------------------
SNIA:
1)Copy the evsub_ela.tar file to the client, and build and install. Set the 
EVSUBHOST variable in 'createsub.sh' to a name by which the client machine 
can recognize the machine on which the provider is running.

2) export DISPLAY=<ip address/ name of the server where the provider runs>:0.0

3) On the server, say "xhost +". This is to ensure that the server can accept
connections from all remote clients. 

PEGASUS:

Follow instructions specified in the pegasus_test readme.

TestEla :
---------
Do the following steps in sequence (steps 1 through 11),
or,
cd /var/evlog/test and run the script ./ela_test1.sh.

1) Setup the e1000s facility :
............................

/sbin/evlfacility -a e1000s

2) Setup templates for e1000s events :
.....................................

mkdir /var/evlog/templates/e1000s
cp elatest1.t /var/evlog/templates/e1000s
cp ela.h /var/evlog/templates/e1000s
cd /var/evlog/templates/e1000s
/sbin/evltc -c elatest1.t

3) Log the events (as root or as ordinary user):
...............................................

cd /var/evlog/test

./log_evt_test1.sh

4) View the events, using default format:
........................................

/sbin/evlview -t 10 -c

5) View the events, displaying ALL attributes in name=value format :
..................................................................

/sbin/evlview -t 10 -q

6) Create the ela rule file :
...........................

cd /var/evlog/templates/e1000s

/sbin/ela_get_atts -f e1000s > /tmp/ela.rules

The rule file (/tmp/ela.rules) should look similar to :
invalid_eeprom_cksum {
 filter = 'facility="e1000" && event_type=0xd591e94e'
 threshold = 1
 interval = -1
 forany="dev_name"
}

This ela.rules file can be edited to change the threshold and the interval

7) Load rule file :
...................

/sbin/ela_add -f /tmp/ela.rules

8) Display ELA rules registered in the system:
..............................................

/sbin/ela_show_all (this will show all the rules registered in the system)

/sbin/ela_show no_cfg (this will display only the no_cfg rule. If the rule
                        file as above shows "e1000_no_cfg" instead, use
                        /sbin/ela_show e1000_no_cfg)

9) Ensure that steps 6) 7) and 8) in the 'Install Sequence' section have
successfully completed.
Now, log an event :
..................
cd /var/evlog/test
log_evt_test1.sh

10) Now, check for the following :
................................
a) a popup window showing the neccessary information (this needs to be
manually resized to see all the information)

b) a report written at /var/evlog/ela_report/. The report will be of
type ela_report<some number>.dat<a number from 01 to 10>. The popup corresponds
to the ela_report file that was written.

11) Removing the registered ela rules :
.......................................
/sbin/ela_remove_all     (will remove all rules)
/sbin/ela_remove no_cfg  (will remove only the no_cfg rule)

Things to note:
--------------- 
1)  output as of now shows all the fields of the report which are however not 
properly aligned. This needs to be fixed in the client code. 

2) Multiple clients can use the provider library at a time. 

3) It is expected that the data of the 'srn error text' field in the ela report
has no more than one single line of data. Further, in the single line, anything
beyond the 100th character is truncated and not shown in the popup.

The various components need to be started as mentioned : 
------------------------------------------------------
The daemon needs to be started first, followed by the cim server and finally 
the client (createsub.sh) which intends to receive information. 
Cleanup and Cancelling subscriptions:
------------------------------------
Once a client has received the desired information, during cleanup, use
'cancelsub.sh <pid of the createsub.sh process to terminate>' for terminating
the client and its corresponding subscription on the same machine from where
the corresponding 'createsub.sh' was originally run. This holds good for 
all remote as well as local client subscriptions that have been started.

'cancelsub.sh cleanrepos' may be used to cancel all existing subscriptions in
CIM. This will however not affect any of the running createsub.sh processes and
clean up the CIM subscriptions alone. In case of remote as well as local client
subscriptions, this may be run from either the local or the remote machine(s). 

It is not neccessary to shut down the cim server before ending the daemon since 
the cim server can run independent of the daemon.  

1) Even if all subscriptions are deleted, the daemon will not go down.
The daemon need not be started before 

2) It is not mandatory to delete all subscriptions before restarting the cim server
as the subscriptions can now be reused over a restart.

All existing subscriptions can be deleted by using the script cancelsub.sh 

To delete the subscriptions, the cim server should be kept running. 


