1. INSTALLATION

1.1 REQUISITES

IM is based on python, so Python 2.4 or higher runtime and standard library must
be installed in the system.

If you will use pip to install the IM, all the requisites will be installed.
You must install them if you will install IM from sources.

It is also required to install the Python Lex & Yacc library (http://www.dabeaz.com/ply/).
It is available in all of the main distributions as 'python-ply' package.

It is also required to install the paramiko ssh2 protocol library for python
(http://www.lag.net/paramiko/). It is available in all of the main distributions
as 'python-paramiko' package.

It is also required the YAML library for python. It is available in all of the
main distributions as 'python-yaml' or 'PyYAML' package

It is also required the SOAPpy library for python. It is available in all of the
main distributions as 'python-soappy' or 'SOAPpy' package

The IM uses ansible to configure nodes in the infrastructures. So Ansible
(http://www.ansibleworks.com/) 1.4.2 or later must be installed in the system.
To ensure the functionality the following values must be set in the ansible.cfg file:

[defaults]
host_key_checking = False
transport = paramiko
record_host_keys = False

1.2 OPTIONAL PACKAGES

In case of using the Amazon EC2 plugin the boto library version 2.0 or later
must be installed (http://boto.readthedocs.org/en/latest/).

In case of using the LibCloud plugin the apache-libcloud library version 0.15 or later
must be installed (http://libcloud.apache.org/).

In case of using the SSL secured version of the XMLRPC API the SpringPython
framework (http://springpython.webfactional.com/) must be installed.

In case of using the REST API the Bottle framework
(http://bottlepy.org/) must be installed.

In case of using the SSL secured version of the REST API the CherryPy Web
framework (http://www.cherrypy.org/) must be installed.

1.3 INSTALLING

1.3.1 FROM PIP

You only have to call the install command of the pip tool with the IM package.

**WARNING: In some linux distributions (REL 6 or equivalents) you must unistall
the packages python-paramiko and python-crypto before installing the IM with pip.**

$ pip install IM

Pip will install all the pre-requisites needed. So Ansible 1.4.2 or later will be 
installed in the system. In some cases it will need to have installed the GCC compiler 
and the python developer libraries ('python-dev' or 'python-devel' packages in main
 distributions).

You must also remember to modify the ansible.cfg file setting as specified in the 
REQUISITES section.

1.3.2 FROM SOURCE

Select a proper path where to install the IM service (i.e. /usr/local/im, 
/opt/im or other). This path will be called IM_PATH

$ tar xvzf IM-X.XX.tar.gz
$ chown -R root:root IM-X.XX
$ mv IM-X.XX /usr/local

Finally you must copy (or link) $IM_PATH/scripts/im file to /etc/init.d directory.

$ ln -s /usr/local/im/scripts/im /etc/init.d

1.4 CONFIGURATION

In case that you want the IM service to be started at boot time, you must 
execute the next set of commands:

On Debian Systems:

$ chkconfig im on

On RedHat Systems:

$ update-rc.d im start 99 2 3 4 5 . stop 05 0 1 6 .

Or you can do it manually:

$ ln -s /etc/init.d/im /etc/rc2.d/S99im
$ ln -s /etc/init.d/im /etc/rc3.d/S99im
$ ln -s /etc/init.d/im /etc/rc5.d/S99im
$ ln -s /etc/init.d/im /etc/rc1.d/K05im
$ ln -s /etc/init.d/im /etc/rc6.d/K05im

Adjust the installation path by setting the IMDAEMON variable at /etc/init.d/im 
to the path where the IM im_service.py file is installed (e.g. /usr/local/im/im_service.py),
or set the name of the script file (im_service.py) if the file is in the PATH
(pip puts the im_service.py file in the PATH as default).

Check the parameters in $IM_PATH/etc/im.cfg or /etc/im/im.cfg. Please pay attention
to the next configuration variables, as they are the most important

DATA_FILE - must be set to the full path where the IM data file will be created 
         (e.g. /usr/local/im/inf.dat). Be careful if you have two different instances
         of the IM service running in the same machine!!.
         
CONTEXTUALIZATION_DIR - must be set to the full path where the IM contextualization files
		are located. In case of using pip installation the default value is correct
		(/usr/share/im/contextualization) in case of installing from sources set to 
		$IM_PATH/contextualization (e.g. /usr/local/im/contextualization)

1.4.1 SECURITY

Security is disabled by default, but it should be taken into account that it would
be possible that someone that has local network access can "sniff" the traffic and
get the messages with the IM with the authorisation data with the cloud providers.

I can be activated both in the XMLRPC and REST APIs. Setting this variables:

XMLRCP_SSL = True

or

REST_SSL = True

And then set the variables: XMLRCP_SSL_* or REST_SSL_* to your certificates paths.

