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
From the Open-AudIT summary dashboard, select the Fields option under Resources. Alternatively, click Manage → Fields → Create Fields
Enter the following details:
name locationcity
Type - Varchar. This will create a text field.
Click Submit to save the new field.
A new field called locationcity should now be listed in the Fields page.
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.
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.
Manage → Devices –> List Devices
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.
In the bulk update screen, scroll down to the Fields section and find the locationcity field.
Click the pen icon, update the field with the city, and click the tick icon to save.
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.
Repeat this process to update this field for other devices.
Next we need to update the integration script so the field data will the transferred across to NMIS and a Admin Portal
Manage → Integrations → List Integrations. Select the Integration you want to update by clicking on the Details button
Select Fields. Scroll to the bottom of this screen and click Add Field.
Add the following:
Open-AudIT Field Name: fields.locationcity
NMIS Field Name: configuration.locationcity
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.
NMIS Field Type: Text
Priority: Internal
This ensures Open-AudIT is considered the source of truth for this field
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
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:
Create a new schema file:
/usr/local/omk/conf/form_schemas/admin_nodes.jsonAdd 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"
}
}
}Update the opCharts_node_selector_sections.json table_schema to include this new field as well.
Edit the following schema file
/usr/local/omk/conf/table_schemas/opCharts_node_selector_sections.jsonIf 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_schemasAdd the following contents to /usr/local/omk/conf/table_schemas/opCharts_node_selector_sections.json:
{
"name" : "configuration.locationcity",
"label" : "City"
},Restart omkd and opchartsd
sudo systemctl restart omkd
sudo systemctl restart opchartsdOAE/NMIS Integration
Manage → Integrations → List Integrations
Select the integration that was updated earlier and click Execute
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.
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
Filter by label
There are no items with the selected labels at this time.