The following sections detail how to setup a instance of Inventory-Manager
Requirements
- Netbox
- Python3.6 and Virtualenv
- Postgres (for production environment)
- Kafka
- Graylog (mongodb + elasticsearch) - OPTIONAL
Installation
Developer Mode
First create a Virtualenv ( more information here)
$ virtualenv env_manager
$ source env_manager/bin/activate
Clone project goLeHI-Manager and install the requirements:
$ git clone https://gitlab.com/netbox-nmap-inventory/inventory-manager
$ cd inventory-manager
$ pip3 install -r requirements.txt
Ingress inside goleHI/goleHI folder and copy the file settings.py.orig
to settings.py
:
$ cd goleHI/
$ cp goleHI/settings.py.orig goleHI/settings.py
Execute the default django settings: migrate, create superuser and run server:
$ ./manage.py migrate
$ ./manage.py createsuperuser
$ ./manage.py runserver
gunicorn Installation
Install gunicorn
# pip3 install gunicorn
Copy contrib/gunicorn.py to /opt/inventory-manager/goleHI/gunicorn.py. We make a copy of this file to ensure that any changes to it do not get overwritten by a future upgrade.
# cp contrib/gunicorn.py /opt/inventory-manager/goleHI/gunicorn.py
You may wish to edit this file to change the bound IP address or port number, or to make performance-related adjustments.
systemd configuration
Copy contrib/goleHI-manager.service to the /etc/systemd/system/ directory:
# cp contrib/goleHI-manager.service /etc/systemd/system/
You may wish to edit this file to adjustments.
# systemctl daemon-reload
# systemctl start goleHI-manager.service
# systemctl enable goleHI-manager.service