Categories
RalphNG

RalphNG DCIM

RalphNG Data Centre Infrastructure Manager (DCIM), Asset Management with rack layouts diagram and more.

The amount of time I have not had diagrams and have spent my own time or remotely talked someone through trying to find a device in a rack and when it is found having to follow cables to find out how it is patched this is a time black hole and we are all happy for this to continue by turning a blind eye to the lack of up to date documentation and saying your too busy to document it now.

Ralph won’t help you with keeping up to date but it will centralise and standardise your documentation from the warehouse to each rack.

How to Install

Add the repositories

sudo apt-key adv --keyserver  hkp://keyserver.ubuntu.com:80 --recv-keys E2D0F3764B54797F
sudo sh -c "echo 'deb https://dl.bintray.com/allegro/debng bionic main' >  /etc/apt/sources.list.d/ralph.list"

Peform updates.

# updates
 sudo apt update
# install the database web server and ralph
sudo apt install mysql-server nginx ralph-core

it will ask about the database settings for ralph say yes

Setting up the My SQL database and local user credentials

sudo mysql -u root -p
CREATE DATABASE ralph_ng;
CREATE USER 'ralph_ng'@'localhost' IDENTIFIED BY 'SuperStrongPassword1';
GRANT ALL PRIVILEGES ON ralph_ng.* TO 'ralph_ng'@'localhost';
FLUSH PRIVILEGES;
QUIT;

Test they access you just set up above

mysql -u ralph_ng -pSuperStrongPassword1
QUIT;

edit the config file amend the password in the file with the SuperStrongPassword1

sudo vi /etc/ralph/conf.d/database.conf

Migrate the data from the install package to the database with the command don’t panic this can and will take some time

sudo ralphctl migrate

time to create a supper user

sudo ralphctl createsuperuser

OPTIONAL (for the first time users have a look at the demo data then rebuild it again after.)

sudo ralphctl demodata

One last ralphctl command to resync all the items

sudo ralphctl sitetree_resync_apps

setting up the service and getting it to start on os boot.

# start the service
sudo systemctl enable ralph.service
sudo systemctl start ralph.service

# Check its running
systemctl status ralph.service

default port is 8000 navigate to the host IP on port 8000 http://X.X.X.X:8000 to check a page is loading not an error page

But we don’t leave it here like this and its best to put a proxy in front of this so you can use SSL among other things

Create a Ralph nginx configuration file

sudo vi /etc/nginx/conf.d/ralph.conf

insert this option for not SSL

server {

    listen 80;
    client_max_body_size 512M;

    proxy_set_header Connection "";
    proxy_http_version 1.1;
    proxy_connect_timeout  300;
    proxy_read_timeout 300;

    access_log /var/log/nginx/ralph-access.log;
    error_log /var/log/nginx/ralph-error.log;

    location /static {
        alias /usr/share/ralph/static;
        access_log        off;
        log_not_found     off;
        expires 1M;
    }

    #location /media {
    #    alias /var/local/ralph/media;
    #    add_header Content-disposition "attachment";
    #}

    location / {
        proxy_pass http://127.0.0.1:8000;
        include /etc/nginx/uwsgi_params;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

or insert this option for SSL needs a Cert

server {
    listen 443;
    ssl on;
    ssl_certificate /etc/ssl/ssl-bundle.crt;
    ssl_certificate_key /etc/ssl/ssl-tutorials.key;
    server_name ssl-tutorials.com;
    
    client_max_body_size 512M;
    server_name ralph.example.com;
    proxy_set_header Connection "";
    proxy_http_version 1.1;
    proxy_connect_timeout  300;
    proxy_read_timeout 300;
    
    access_log /var/log/nginx/nginx.vhost.access.log;
    error_log /var/log/nginx/nginx.vhost.error.log;

    location / {
        root /var/www/;
        index index.html;
    }

}

Remove the default nginx page

sudo mv /etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf.bak

sudo rm /etc/nginx/sites-enabled/default

Restart the service and

sudo systemctl restart nginx.service

# check status of the service
sudo systemctl status nginx.service

Now we can go to the URL http://X.X.X.X for no SSL
https://X.X.X.X for SSL

log in with the super user we set up and start having fun

link to vendor website https://ralph-ng.readthedocs.io/en/stable/

At the moment I prefer this over Netbox but that is just my choice as I used this before Netbox was mainstream. and like all good systems, there is a Rest API https://ralph-ng.readthedocs.io/en/stable/user/api/

Leave a Reply

Your email address will not be published.