.. SANET requirements list, install instructions with requirements configuration. Point to another page for requirement install instructions (from source code) Point also to external FAQ and troubleshooting page ============ Installation ============ SANET relies on many other software applications and libraries. Here we list such dependecies. If you need help about how to install them in your system, we suggest to refer to your own system's documentation, or instead to our :doc:`../appendix/requirements` document which shows the procedures we use to install these packages (and may not be the best way to install them in your own system). .. _requirements-list: Requirements ------------ + :ref:`rrdtool-req` + :ref:`postgresql-req` + :ref:`graphviz-req` + Python 2.4 or greater + Python modules + :ref:`rrdtoolmod-req` + :ref:`pydotmod-req` + :ref:`pyxmlmod-req` + :ref:`netsnmpmod-req` + :ref:`reportlabmod-req` + :ref:`pilmod-req` + :ref:`pisamod-req` Installation procedure ---------------------- #. Download sanet-xxx.tar.gz source tarball from `SANET download page `__ and extract it. #. In your profile export the environment variable SANET_HOME pointing to the directory into which you extracted SANET: .. sourcecode:: bash helicopter:~# export SANET_HOME=`pwd`/sanet #. Copy `settings_dist.py` to `settings.py` and edit it according to your needs (for full documentation see :doc:`settings`) You MUST uncomment database connection settings and change them to suit your needs. In this documentation we always refer to default DATABASE_* settings .. sourcecode:: python # DATABASE_ENGINE = 'postgresql_psycopg2' # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'ado_mssql'. # DATABASE_NAME = 'sanet' # Or path to database file if using sqlite3. # DATABASE_USER = 'sanet' # Not used with sqlite3. # DATABASE_PASSWORD = '' # Not used with sqlite3. # DATABASE_HOST = '' # Not used with sqlite3. # DATABASE_PORT = '' # Not used with sqlite3. You can also choose the maximum number of targets, measures or events displayed in each page, by uncommenting and changing the respective MAX_*_PER_PAGE value .. sourcecode:: python # MAX_TARGETS_PER_PAGE = 30 # MAX_MEASURES_PER_PAGE = 30 # MAX_EVENTS_PER_PAGE = 30 .. _install-createdb: #. Create your own user and database (PostgreSQL suggested) .. sourcecode:: sql helicopter:~# psql -U postgres Welcome to psql 8.3.1, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands \? for help with psql commands \g or terminate with semicolon to execute query \q to quit postgres=# create role sanet login password ''; CREATE ROLE postgres=# create database sanet owner sanet encoding 'utf8'; CREATE DATABASE postgres=# grant all privileges on database sanet to sanet; GRANT postgres=# \q **NOTE**: At the momento SANET does NOT work with MySQL! Something let to fix... If you'd like to experiment MySQL anyway, follow the instructions in: :ref:`mysql-appendix` #. Initialize database and SANET library: .. sourcecode:: bash helicopter:~# python $SANET_HOME/manage.py syncdb helicopter:~# python $SANET_HOME/manage.py sanetdata helicopter:~# python $SANET_HOME/manage.py cli -l < $SANET_HOME/etc/library-it #. Run SANET ! You must be root to start the Poller process (you must be able to open RAW sockets to **ping**), or if you're using a GNU/Linux system, at least you must have the **CAP_NET_RAW** capability active. .. sourcecode:: bash helicopter:~# $SANET_HOME/etc/rc.sanet start To start the :doc:`../wui` (you don't need special privileges) execute: .. sourcecode:: bash helicopter:~$ $SANET_HOME/etc/rc.sanet web Test your installation ---------------------- + Testing database connection: .. sourcecode:: bash helicopter:/usr/local/sanet# etc/rc.sanet dbshell You should be taken to your database command line interface. See :ref:`rc.sanet dbshell does not work ` otherwise. + Testing that model has been installed correctly: .. sourcecode:: bash helicopter:/usr/local/sanet# etc/rc.sanet manage shell .. sourcecode:: python >>> from state.models import * >>> from map.models import * No output is given if it's all ok. If some error is raised it means that :ref:`requirements-list` are not satisfied. Deployment ---------- Only `apache` webserver deployment is currently supported. Requirements ^^^^^^^^^^^^ + Apache 2.x with mod_python 3.x. Recommends """""""""" + Apache 2.x modules: mod_ssl, mod_deflate Deployment procedure ^^^^^^^^^^^^^^^^^^^^ #. Execute: .. sourcecode:: bash # python manage.py deploy #. Configure your webserver accordingly to the configuration proposed. #. Make `$SANET_HOME/static/measures` and `$SANET_HOME/var/dcache` writable by your http daemon. .. sourcecode:: bash helicopter:~# ps aux | grep apache2 www-data 488 0.0 0.6 37724 6300 ? S 01:39 0:00 /usr/sbin/apache2 -k start www-data 492 0.0 0.6 37708 6340 ? S 01:39 0:00 /usr/sbin/apache2 -k start www-data 493 0.0 0.6 37732 6400 ? S 01:39 0:00 /usr/sbin/apache2 -k start root 10167 0.0 0.9 37264 9720 ? Ss Jun02 0:01 /usr/sbin/apache2 -k start www-data 10172 0.0 0.6 37836 6452 ? S Jun02 0:00 /usr/sbin/apache2 -k start www-data 10173 0.0 0.6 37732 6392 ? S Jun02 0:00 /usr/sbin/apache2 -k start helicopter:~# chown -R www-data $SANET_HOME/static/measures $SANET_HOME/var/dcache You might need to grep httpd instead of apache2 Commodities ^^^^^^^^^^^ You probably would like to set some symbolic links .. sourcecode:: bash helicopter:~# ln -sf $SANET_HOME/bin/* /usr/local/bin helicopter:~# ln -sf $SANET_HOME/etc/rc.sanet /etc/rc.d/ Maintenance operations ^^^^^^^^^^^^^^^^^^^^^^ The script `/etc/rc.d/rc.sanet nightly` performs some maintenance operations. We suggest to copy `maintenance_settings_dist.py` to `maintenance_settings.py` and put nightly script it in your crontab (i.e. setting it to be launched every day at 6:45 am): .. sourcecode:: bash # SANET maintainance 45 6 * * * /etc/rc.d/rc.sanet nightly > /root/lastoutput.sanet.nightly 2>&1 Troubleshooting --------------- For troubleshooting issues refer to the specific page :doc:`../tshoot` If you have any other question please refer to :doc:`../FAQ`. If you still have doubts don't hesitate to contact us at `nad@labs.it `__