Versions Compared

Key

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

Table of Contents

Table of Contents

Feature Overview

IMPORTANT: See opCharts Extra Fields for using the Admin UI for maintaining custom fields.

NMIS supports custom fields, or custom attributes for managed nodes.  For example; some organisations may find that a Country attribute is important to them.   Once a custom filed is provisioned in NMIS it may be extended to opCharts, where it can be added to the node filter so nodes can be filtered by the new attribute, the the node table so it is possible to see this value for all nodes and to the node view page so the new attribute can be seen when looking at an overview of an individual node.

...

Adding a custom field to NMIS is accomplished by modifying /usr/local/nmis8/conf/Table-Nodes.nmis.  Notice that this file contains a hash with a Nodes section.  For this example we will add a Country field.  Several fields may be added if required.  Put the new field between the 'extra_options' entry and the 'advanced_options' entry.  Observe the new country field in the code block below.


NMIS9

make backup of Table-Nodes 

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

Code Block
title/usr/local/nmis8/conf/Table-Nodes.nmis
--snip
%hash = (
        Nodes => [ # using an array for fixed order of fields
                { name => { mandatory => 'true', header => 'Name',display => 'key,header,text',value => [""] }},
                { host => { mandatory => 'true', header => 'Name/IP Address',display => 'header,text',value => [""] }},
                { group => { mandatory => 'true', header => 'Group',display => 'header,popup',value => [ @groups] }},
                { community => { mandatory => 'true', header => 'SNMP Community',display => 'text',value => ["$C->{default_communityRO}"] }},
                { extra_options => { special => 'separator', header => 'Extra Options'}},
                { country => { header => 'Country', display => 'header,text',value => [""] }},
                { netType => { header => 'Net Type', display => 'popup',value => ["wan", "lan"] }},
                { roleType => { header => 'Role Type', display => 'popup',value => ["core", "distribution", "access"] }},
                { location => { header => 'Location',display => 'header,popup',value => [ sort keys %{loadGenericTable('Locations')}] }},
                { advanced_options => { special => 'separator', header => 'Advanced Options'}},
--snip

...

Code Block
perl -c /usr/local/nmis8/conf/Config.nmis
# /usr/local/nmis8/conf/Config.nmis syntax OK

 

...



Configure opCharts4

Copy /usr/local/omk/lib/json/opCharts/table_schemas/opCharts_node_selector_sections.json to /usr/local/omk/conf/table_schemas/opCharts_node_selector_sections.json

Edit opCharts_node_selector_sections.json and add the property from the node you wish to display with a label.

Code Block
languagejs
[
  {
    "name" : "catchall.data.nodestatus",
    "label" : "Node Status"
  },
  {
    "name" : "configuration.custom",
    "label" : "Custom Prop"
  },
	....
]



Configure opCharts3

Modify opCommon.nmis

Add the new field to the following attributes attribute in /usr/local/omk/conf/opCommon.nmis.

...

  • opcharts_node_selector_sectionsopcharts_gui_node_summary_list

Examples of modifying each of these attributes may be found in the code block below. 

...