Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device.
Atlassian cookies and tracking notice, (opens new window)
Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
/
NMIS/opCharts Integration - Custom Fields
Updated Apr 16, 2024

    NMIS/opCharts Integration - Custom Fields

    Apr 16, 2024

      Table of Contents

      • 1 Feature Overview
      • 2 Configuration & Verification
        • 2.1 Configure NMIS
          • 2.1.1 Modify Table-Nodes.nmis
        • 2.2 NMIS9
            • 2.2.1.1 /usr/local/nmis8/conf/Table-Nodes.nmis
          • 2.2.2 Verify Table-Nodes.nmis
          • 2.2.3 Modify Config.nmis
            • 2.2.3.1 /usr/local/nmis8/conf/Config.nmis
          • 2.2.4 Verify Config.nmis
        • 2.3 Configure opCharts4
        • 2.4 Configure opCharts3
          • 2.4.1 Modify opCommon.nmis
            • 2.4.1.1 /usr/local/omk/conf/opCommon.nmis
          • 2.4.2 Verify opCommon.nmis
      • 3 Conclusion

      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.

      Configuration & Verification

      Configure NMIS

      Modify Table-Nodes.nmis

      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

      /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

      Verify Table-Nodes.nmis

      Using the NMIS GUI navigate to System -> System Configuration -> NMIS Nodes.  This should render the Table Nodes widget displaying the new field.  If it does not; restore the original Table-Nodes.nmis file and try again paying close attention to syntax.

      Assuming everything is working as desired we may now click the 'edit' button per device and update the Country attribute.

      Modify Config.nmis

      Modify the node_summary_field_list list attribute in /usr/local/nmis8/conf/Config.nmis.  Add the new field key value previously added to Table-Nodes.nmis to this list.  The code block below adds the country attribute.

      /usr/local/nmis8/conf/Config.nmis
       --snip 'node_summary_field_list' => 'host,uuid,country,customer,businessService,serviceStatus,snmpdown,wmidown,remote_connection_name,remote_connection_url,host_addr', --snip

      Verify Config.nmis

      Config.nmis can be compiled with perl to make sure there are no syntax errors 

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

       


      Configure opCharts4

       

      cd /usr/local/nmis9/admin ./node_admin.pl act=export file=abc.json node=<node_name> vi abc.json

      add "device_ci" : "check" inside "configuration

      add "name" : "<node_name>"

      ./node_admin.pl act=import file=abc.json

      ./node_admin.pl act=import file=abc.json

       

       

      Configure opCharts3

      Modify opCommon.nmis

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

      • opcharts_node_selector_sections

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

      /usr/local/omk/conf/opCommon.nmis
       --snip 'opcharts_node_selector_sections' => [ { 'key' => 'nodestatus', 'name' => 'Node Status' }, { 'key' => 'group', 'name' => 'Group' }, { 'key' => 'roleType', 'name' => 'Node Role' }, { 'key' => 'nodeType', 'name' => 'Node Type' }, { 'key' => 'nodeVendor', 'name' => 'Node Vendor' }, { 'key' => 'country', 'name' => 'Country' } ], --snip

      Verify opCommon.nmis

      • Restart the omkd service.

      • Open a browser to the opCharts GUI.

      • The new field should be found as in the example below.

      If any comfortableness in experienced restore the original opCommon.nmis

      Conclusion

      Understanding that 'one size fits all' solutions fits no one well; Opmantek strives to provide customers with the ability to customize their network management solutions.

        Community Home

        opCharts
        • Downloads
          Downloads
        • Downloads
          Downloads
        • Downloads
          Downloads
        • Troubleshooting articles
          Troubleshooting articles
        Results will update as you type.
        • Introduction & Setup
        • Configuration
          • Customising the opCharts GUI
          • Events Pane in the Node View - enabling websocket when using SSL or TLS
          • Managing multiple locations
          • NMIS/opCharts Integration - Custom Field Validation
          • NMIS/opCharts Integration - Custom Fields
          • opCharts - Customising Table Columns
          • opCharts Classic Auth and RBAC Feature access
          • opCharts Configuration
          • opCharts MSP Configuration Options
        • Features
        • How-To Guides
        • API
        • Release Notes
        • opCharts MongoDB 4.2 Features
        • Troubleshooting articles
        • Documentation Archive
          Questions
          Calendars

        You‘re viewing this with anonymous access, so some content might be blocked.
        {"serverDuration": 46, "requestCorrelationId": "31e8597ad16f4a2db1f70ead08108df9"}