At present this method requires use of the Terminal. However if you are using a client machine that has Node.js installed you can run the file there too, no extra dependencies required.

Two methods for generating will be shown here, you only need to choose one to generate an import file :

  1. Generating from a simple TXT
  2. Generating from a complex CSV

A Quick Explanation : Generating from Simple TXT

Within the Shinobi root directory there is a folder called "tools", here you can find a command line script that generates a configuration set from a base file and a listing of camera stream URLs. The file is named "createMonitorsJsonFromTxt.js".

Here is a link to the script we will be using for this tutorial : https://gitlab.com/Shinobi-Systems/Shinobi/-/raw/master/tools/createMonitorsJsonFromTxt.js?ref_type=heads

To use this script you can open command line and run the following :

cd /home/Shinobi/tools
node ./createMonitorsJsonFromTxt.js MONITOR_BASE.json PLAIN_LIST.txt
  • MONTIOR_BASE.json would be a complete config you want to use as a base for each new monitor added. Easiest way to get this is to open Monitor Settings for a monitor you have already configured and do an Export from the bottom right menu.
  • PLAIN_LIST.txt would be a simple txt file with stream urls. each stream url would be on a new line.

An example of PLAIN_LIST.txt is as shown below :

rtsp://username:password@host_ip_1:554/h264
rtsp://username:password@host_ip_2:554/h264

If you have followed this method to generate an import file you can skip to "A Configuration Set has been Generated".

Generating from Complex CSV

Like the TXT generator there is a CSV generator that allows for further detailed import file generation. Here is how you can run it.

cd /home/Shinobi/tools
node ./createMonitorsJsonFromCsv.js MONITOR_BASE.json COMPLEX_LIST.csv
  • MONTIOR_BASE.json would be a complete config you want to use as a base for each new monitor added. Easiest way to get this is to open Monitor Settings for a monitor you have already configured and do an Export from the bottom right menu.
  • COMPLEX_LIST.csv would be a csv file with stream urls and other data. Each Monitor would be on a new line.

Here is an example of COMPLEX_LIST.csv :

MODE,MONITOR_ID,NAME,TAGS,Days to Keep Video,LAT,LON,STREAM_URL
start,MONID1,MONNAME1,tag1;tag2;,10,38.82573889,-77.12148611,rtsp://username:[email protected]/multicast/stream0
record,MONID2,MONNAME2,tag1;tag3;,10,38.82573889,-77.12148611,rtsp://username:[email protected]/multicast/stream1
  • MODE : The internal value used to designate what mode the Monitor will initiate in. You can choose between the following :
    • start : Watch-Only
    • record : Record Continuous
    • stop : Disabled
    • idle : Idle
  • MONITOR_ID : The unique ID that needs to be given to a Monitor, no special characters.
  • TAGS : Semi-colon delimited list of tags that will automatically group your Monitors.
  • Days to Keep Video : Set a max amount of time recorded footage will be kept before purging that data for this Monitor. Leave Blank to use Global value.
  • LAT : Geolocation Latitude
  • LON : Geolocation Longitude
  • STREAM_URL : The complete stream host and path required to connect to the camera.

Note : the header must exist in the CSV and must follow the order shown.

A Configuration Set has been Generated

  1. Now that you have a configuration set generated you may copy this file over to the PC where you will open the dashboard for Shinobi. If you are running the script on that machine already then move on to the next step.
  2. Open the Shinobi Dashboard.
  3. Open the Monitors tab and open the menu in the bottom right.
  4. Select Import and a window will appear where you can upload the Configuration Set JSON that was generated.
  5. When you press Import it will start loading the configurations. Depending on the number of configurations this may take some time so please be patient when waiting for this to complete.
  6. One by one you will see each Monitor becoming active (assuming each provided Stream URL is correct and compatible with the MONITOR_BASE.json provided).

Enjoy!