This feature is available from opCharts version 3.2.2 and newer. This is an advanced feature that allows customers to modify the data presented in tables. The default table content has been carefully selected based on Opmantek's numerous years of network management experience. This said there are cases where customers would like to alter the table data to display information that is important to their organisation. Most opCharts pages with table data can be customised to display different content. This feature allows table columns to be removed or added as required.
If when following these steps the View that is being modified does not behave normally; remove the custom configuration file and normality should be restored.
Views That Support Custom Columns
- Scheduled Outages
- Node Context - Node Info Widget
Executing an API call such as the following will reveal the available properties that can be made into columns for the Interface view.
Node View & Node Context - Node Info Widget
Executing an API call such as the following will reveal the available properties that can be made into columns for the Node view as well as the Node Context - Node Info Widget.
Scheduled Outages View
The properties that may be used for columns for the Scheduled Outages view may be found in the /usr/local/nmis8/conf/Outages.nmis file.
Each view has a separate configuration file that will be found in the following directory (by default this directory does not exist; reference the next step):
|Node Context - Node Info Widget||opCharts_node-summary-table.json|
Enabling the Feature
In order to enable this feature the following must be done.
- Create a directory called /usr/local/omk/conf/table_schemas
- Copy the specific view configuration file that requires modification from /usr/local/omk/lib/json/opCharts/table_schemas/ into /usr/local/omk/conf/table_schemas.
- Only the necessary json files should be copied to the /usr/local/omk/conf/table_schemas directory as having unecessary config files in this directory will result in future upgrades being unpredictable.
Enable this feature with care.
Future opCharts upgrades will need to be watched carefully as tables and node properties can change across versions. Based on this an upgrade has the potential to break the functionality of a custom table configuration. If this feature is enabled it is highly recommend to upgrade in a test environment prior to upgrading the production environment.
The configuration files are json files that have a specific syntax that must be observed. Add the desired property to the json file in the order it should appear in. The table will be constructed left to right based on attributed that are read from the top down.
Each property that is added will require a set of attributes. This is an example of the attributes that belong to the 'configuration.country' property.
- name: Name of the node property
- label: The column name that will render in the web page.
- cell: The cell type, usually this will be "string". For other options please contact email@example.com.
Adding and Removing Columns
To remove a column simply remove the associated section from the applicable json file. To add a column add a new section in the json file. The column placement will be relative to the order it is put in the json file.
The example below is the opCharts_node-list.json file. The version on the left is the default version. The version on the right adds the Country column between the Node Status and Group columns, it also removes the Links column.
JSON File Syntax Check
The syntax of a json file may be tested with the following command.
Please note that the version line at the top of the file will need to be removed in order to test in the manner.
Testing View Functionality
It is not necessary to restart any daemons. After editing the associated json file simply load (or reload) the view in question.
For more information on customizing fields with NMIS integration view our Wiki page Here: NMIS/opCharts Integration - Custom Fields