How to create a custom field in Open-AudIT and integrate that into NMIS/OMK

How to create a custom field in Open-AudIT and integrate that into NMIS/OMK

This page outlines the steps to create a new custom field in Open-AudIT enterprise and how to integrate that field into the Admin Portal and opCharts.

This procedure has been tested in the following software releases only.

  • Open-AudIT Enterprise 5.6.5

  • opCharts 4.9.0

  • NMIS 9.6.2

 OAE Instructions

Create a new field in OAE called locationcity

  1. From the Open-AudIT summary dashboard, select the Fields option under Resources. Alternatively, click Manage → Fields → Create Fields

  2. Enter the following details:

    1. name locationcity

    2. Type - Varchar. This will create a text field.

    3. Click Submit to save the new field.

  3. A new field called locationcity should now be listed in the Fields page.

  4. When you view a device, select the Fields option under the Summary on the left had panel to view the additional fields for that device. The locationcity field should be visible now.

  5. Open-AudIT provide the ability to bulk edit discovered devices. We can use this ability to update the new field on a number of devices.

    1. Manage → Devices –> List Devices

    2. One the far right, click the check box beside the devices you want to bulk edit and then click the pen icon at the top of the column.

    3. In the bulk update screen, scroll down to the Fields section and find the locationcity field.

    4. Click the pen icon, update the field with the city, and click the tick icon to save.

      1. Take note that a list of the devices that will be updated is displayed in the device section at the bottom of the bulk update page.

    5. Repeat this process to update this field for other devices.

  6. Next we need to update the integration script so the field data will the transferred across to NMIS and a Admin Portal

    1. Manage → Integrations → List Integrations. Select the Integration you want to update by clicking on the Details button

    2. Select Fields. Scroll to the bottom of this screen and click Add Field.

    3. Add the following:

      1. Open-AudIT Field Name: fields.locationcity

      2. NMIS Field Name: configuration.locationcity

        1. Note: we will create this field name in NMIS in subsequent steps. Just ensure the name you use in NMIS matches the name in this field.

      3. NMIS Field Type: Text

      4. Priority: Internal

        1. This ensures Open-AudIT is considered the source of truth for this field

      5. Click the green Add button at the end of the line to add the field to the integration.

Do not run the integration yet, we need to create the field in NMIS first.

 NMIS Instructions

Create a new field in NMIS called locationcity

  1. Create a custom form_schema for the new field (configuration.locationcity) in the admin portal. The entire process is outlined in this wiki page: opCharts Form Schema. For our custom field, we need to do the following:

    1. Create a new schema file: /usr/local/omk/conf/form_schemas/admin_nodes.json

    2. Add the following contents:

{ "label": "Custom node fields", "description": "Edit in conf/form_schemas/admin_nodes.json", "component": ["node_admin"], "tags": ["node"], "schema": { "configuration.locationcity": { "title": "City", "type": "Text" } } }
  1. Update the opCharts_node_selector_sections.json table_schema to include this new field as well.

    1. Edit the following schema file

      /usr/local/omk/conf/table_schemas/opCharts_node_selector_sections.json
    2. If this file does not exist, create it by doing the following:

      sudo cp /usr/local/omk/lib/json/opCharts/table_schemas/opCharts_node_selector_sections.json /usr/local/omk/conf/table_schemas
    3. Add the following contents to /usr/local/omk/conf/table_schemas/opCharts_node_selector_sections.json:

{ "name" : "configuration.locationcity", "label" : "City" },
  1. Restart omkd and opchartsd

sudo systemctl restart omkd sudo systemctl restart opchartsd

 OAE/NMIS Integration

  1. Manage → Integrations → List Integrations

  2. Select the integration that was updated earlier and click Execute

  3. The new field will be copied across as part of the integration and will be visible in the Admin Portal when you view the Extra-Fields tab for a device.

    1. When viewing the node list in opCharts, you will be able to filter on the new field using the Node Filter panel on the left hand side.

 Related articles

opCharts Form Schema

Filter by label

There are no items with the selected labels at this time.