Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

In NMIS /and opCharts we can add custom validations for custom fields in the nodes table.

This is a list of the steps the customer needs to follow :-

1)Add the custom field name to NMIS, in In this example we are using "device_ci" as the name of our custom field and "Device CI" as our the label to be displayed in the screens.


1) Add the custom field name to NMIS.


/usr/local/nmis9/conf-default/Table-Nodes.nmis

...

Code Block
languageperl
title/usr/local/nmis9/conf/Config.nmis
'node_summary_field_list' => 'host,uuid,customer,device_ci,businessService,serviceStatus,snmpdown,wmidown',


3) add a custom _indices field index in Config.nmis.


Config.nmis::database:: 

Code Block
languageperl
title/usr/local/nmis9/conf/Config.nmis
'custom_indices' => {
      'nodes' => [
          [ {'configuration.device_ci' => 1}, { unique => 1, partialFilterExpression => { "configuration.device_ci" => { '$exists' => true } }  }] 
        ]
}

...

Code Block
themeMidnight
title/usr/local/nmis9/bin/nmis-cli act=ensure_indexes debug=9
/usr/local/nmis9/bin/nmis-cli act=ensure_indexes debug=9

...

debug=9



5) Add the Device Ci CI to the admin node table schema


/usr/local/omk/lib/json/admin/table_schemas/admin_node-ip.json

...

6) Add the Device Ci to the opCharts node table schema


/usr/local/omk/lib/json/opCharts/table_schemas/opCharts_node-list.json

...

7) Add the Device Ci to the admin edit node fields. (admin_nodes.json file will need to be created in the "/usr/local/omk/conf/form_schemas/" directory )


vi /usr/local/omk/conf/form_schemas/admin_nodes.json

...


8) Add the device_ci to omk/opCharts/nodes so it shows in the node info table


vi /usr/local/omk/lib/json/opCharts/table_schemas/opCharts_node-summary-table.json and add the device_ci as shown below

...