Skip to content

tulsluper/sanscript

Repository files navigation

SANscript

An application for SAN monitoring written in Python using Django, supports HP EVA, HP 3PAR, HDS AMS storages and Brocade FC switches.

Installation on Debian 8

Install python3 and other packages

apt-get install python3 python3-dev python3-pip
apt-get install git

# support LDAP
apt-get install libldap2-dev libsasl2-dev libssl-dev

# support 32-bit (for Hitachi SNM2 CLI)
dpkg --add-architecture i386
apt-get update
apt-get install gcc-multilib

# (for EVA SSSU)
apt-get install libstdc++5

Download application and install requirements

mkdir /home/django/
cd /home/django/
git clone https://github.com/tulsluper/sanscript.git
cd sanscript
pip3 install -r requirements.txt

Configure database

If you use SQLite:

no actions needed

If you use PostgreSQL:

apt-get install postgresql
apt-get install python3-psycopg2
cp /home/django/sanscript/configs/postgres/db_settings.py /home/django/sanscript/sanscript/
su - postgres
psql -f /home/django/sanscript/configs/postgres/db_init.sql
exit

Init application

./manage.py migrate auth
./manage.py migrate
./manage.py createsuperuser
./manage.py loaddata fixtures/*
./manage.py collectstatic
chown -R www-data:www-data ../sanscript

Install uwsgi and nginx

apt-get install uwsgi uwsgi-plugin-python3
apt-get install nginx

Copy uwsgi and nginx configs:

cp /home/django/sanscript/configs/uwsgi/sanscript.ini /etc/uwsgi/apps-available/
cp /home/django/sanscript/configs/nginx/sanscript.conf /etc/nginx/sites-available/

Enable configs:

ln -s /etc/uwsgi/apps-{available,enabled}/sanscript.ini
ln -s /etc/nginx/sites-{available,enabled}/sanscript.conf 

Disable default nginx config:

rm /etc/nginx/sites-enabled/default

Restart uwsgi and nginx:

service uwsgi restart
service nginx restart

Now application should be available in browser on http://domain_name/ or http://ip_address/

Add systems to application and collect data.

For schedule data collection add records to crontab:

0 * * * * /home/django/sanscript/apps/da/scripts/collect_data.py
0 * * * * /home/django/sanscript/apps/fc/scripts/collect_data.py
*/5 * * * * /home/django/sanscript/apps/bc/scripts/collect_data.py

For enable SANscript services:

cp /home/django/sanscript/configs/systemd/* /etc/systemd/system/
systemctl enable san_trap_server 
systemctl enable san_event_server 
systemctl start san_trap_server
systemctl start san_event_server

About

An application for SAN monitoring written in Python using Django

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published