Router Traps

This guide details the steps to follow to enable the functionality Router Traps in WOCU-Monitoring.

Prerequisites

You must have the appropriate privileges to edit system files and execute commands as a Superuser (root or using sudo).

Setup Steps

Step 1: Enable the Router Traps functionality

To enable this function, you must modify the wocu.yml configuration file located at /etc/wocu/wocu.yml.

  • Open the file for editing using the following command:

    sudo nano /etc/wocu/wocu.yml
    
  • Add the following configuration in the feature section:

    feature:
      router: enabled
    

Step 2: Configure the MongoDB Collector

You must define the MongoDB collector URI in advance, so the router can input the data. This is also done in the wocu.yml configuration file.

  • In the same wocu.yml file, add the following lines, replacing [IP-MONGO] with the IP address of the MongoDB instance (if they don’t exist, you must add them):

    wocu-indexer-addresses:
      collector_uri: "mongodb://[IP-MONGO]:27017"
    
  • (Optional) If MongoDB requires authentication, modify the collector_uri variable as follows:

    • Replace [USER] with the MongoDB username.

    • Replace [PASS] with the MongoDB password.

    collector_uri: "mongodb://[USER]:[PASS]@[IP-MONGO]:27017"
    

Step 3: Save and apply the changes

  • After making the necessary changes, save the file and close the editor (in nano, run the combination CTRL+O to save and CTRL+X to exit).

  • Apply the configuration by running the following command:

    sudo wocu-ctl configure
    

Verification

To verify that the settings have been applied correctly, you can review the contents of the file environ.yml generated by the system.

  • Open the following to review the changes:

    sudo cat /var/opt/wocu/etc/wocu/import_tool/environ.yml
    
  • Make sure the router role and MongoDB collector URI are correctly configured in this file.

Important

Do not manually modify the environ.yml file, as it is managed automatically by the command wocu-ctl configure.