
                          MAT Installation Guide
                          ----------------------

MAT is a three part program, the MAT Console, the MAT agent, and the MAT daemon.  
The MAT console is the GUI front-end.  It provides the easy to use interface for 
managing your UNIX hosts.  The MAT agent is the backend process which processes 
the requests from the MAT console, and modifies the UNIX configuration files. 
The MAT deamon provides the system monitoring and alarms.  The MAT agent and 
daemon has to be installed on every machine you want MAT to manage.  The MAT
console only needs to be installed on one machine.  The following instructions
outlines how to install MAT console, and agents.


MAT Console on Windows 95/NT:
-----------------------------
If you plan on using the MAT console in Windows 95 you will have to download 
Tcl/TK from http://www.scriptics.com.  Version 8.0.3 works better than 8.1.0.
There are some minor problems with fonts.

Extract the MAT console, and rename the file "mat" to "mat.tk"
.  Double-click on the MAT icon, and away you go.


Installing the MAT Console on UNIX:
-----------------------------------
The MAT console requires Tcl/TK.  Tcl/TK is part of the Linux distribution.  
Tck/TK version 8.0 or higher is highly recommended for 
the large speed improvements.  See www.scriptics.com for the latest
Tcl/TK download.

1. Edit the install.console file and set the MATHOME variable.  Then run 
the script.

2. Make sure that Tcl/TK is installed on the machine you want to run the 
console on.  If it's in your path, you should be able to find it by running:
	whereis wish    or
	which wish
After you have found it edit the file "MATHOME/bin/mat" and replace
"#!/usr/local/bin/wish8.0"  with "#!{your location for wish}"

3.  The MAT console is now ready to run, just go to the MAT bin directory and
type ./mat

 
Installing the MAT agent, and daemon:
-------------------------------------
Before starting the install make sure you have the correct agent for the 
platform you wish to install on.  Currently the MAT agent is available for the
following operating systems:
	- Linux  (only tested on 2.0.x, 2.2.x  with lib5)
	- Solaris 2.5 or higher
	- SunOS 4.1.4
	- IRIX 6.2 or higher
	- HPUX 10.20

Installation of the MAT agent has five steps.
	1.  Unpack the distribution.  Install in /var/mat, or /usr/mat.
	2.  Update /etc/services.
	3.  Update /etc/inetd.conf, and restart inetd.
	4.  Update the rc files to startup the daemon on reboot.
	5.  Check the location on the Perl package.

Unpack the MAT tar file.  You will see something like:
BUGS                  Readme                matagent.tar.linux_s
INSTALL               install.agent*        matagent.tar.solaris
License               install.console*      matagent.tar.sunos
Migration_Guide       matagent.tar.linux    matcon.tar

Edit the install.agent file, and set the MATHOME variable to the directory 
of your choice.  Do not install MAT in a NFS mounted partition, because the 
daemon stores host status information which may not be available should there
be a problem.  Set the AGENT_TYPE variable to the appropriate value, by 
uncommenting ONE of the lines.
Run the install.agent file, and it will install the MAT agent.

Installation of the MAT daemon is a little more involved.  The binary has to 
be added to the rc scripts so it starts at boot time, and the scripts require
Perl in /usr/local/bin.

Add "$MATHOME/mat/bin/matd" to the rc scripts.  The location varies with the 
OS.  A SYSV start/stop script is included, and can be used on Solaris, and 
IRIX machines.  Copy "Matd" to /etc/init.d   then type:   
   cd /etc/rc2.d ;ln -s ../init.d/Matd S97Matd
Then start the daemon by running:     /etc/init.d/Matd start      or
$MATHOME/mat/bin/matd

The Perl scripts look for the Perl interperator in /usr/bin/perl.  Rather than 
update the scripts every time MAT is installed or upgraded just make a link to
/usr/bin/perl.


The install script is very simple.  If it fails you can install manually quite 
easily:

1.  Make a directory for the MAT agent, and untar the matagent.tar.{TYPE} file 
into the directory.
 
2.  Edit the /etc/services file.  It should have an entry like the following:
mat		2345/tcp		# Mat agent

This will let MAT use port 2345.  If you want to use another port, just change
2345 to whatever you want that's free.  If you change it from the default 2345
you will need to edit the MAT console executable "mat", and set the "port"
variable to the new value.

3.  Edit the /etc/inetd.conf file.  It should have an entry like the following:
mat	stream	tcp	nowait	root	/var/mat/bin/matagent	/var/mat
If you choose to install in another directory you will need to change the last 
two entries in the above line.  For example to install in /usr/local/mat
change:  /var/mat/bin/matagent   to   /usr/local/mat/bin/matagent
 and          /var/mat           to        /usr/local/mat

4.  Restart the inetd deamon.  That should be it.

To test the agent telnet to the host with the agent on the appropriate port
e.g.   telnet localhost 2345
It should respond with something like:
MAT Agent Started.  C version 0.12 (Beta).
Type "ping".  It will respond with the version number and OS type.

To test the daemon make sure it is not running, and delete: 
$MATHOME/mat/etc/matd.conf   if it exists.
Start the daemon from the command line using the absolute path eg:
    /var/mat/bin/matd
You should see something like the following:
  darkstar:/# /var/mat/bin/matd
  NOTICE:  Can't find matd.conf.  Running Discover
  Creating new matd.conf 
  Discovering  1001 1002 1004 1005 1006 1007 1008 1009 
  Writing config file....
  interval 1001 6 1 60 0 0 var/runlog 288 /tmp/none 0 0 1
    :
    :
The daemon will now start to gather information about your system.



Troubleshooting:
----------------
If it does not run re-check the location of "wish".  You should be able to 
run it manually.  If the wish path is properly set in the mat program try
rebuilding the  tclIndex  file in the MAT console lib directory.
Go to the lib directory in the MAT console installation and start tclsh e.g.
	>  cd mat/lib
	>  tclsh
You will see the tclsh prompt "%".  Type "auto_mkindex {MAT lib path} *.tcl".
If the MAT lib directory was /home/root/mat/lib you would type:
	%   auto_mkindex /home/root/mat/lib *.tcl



