The purpose of this article is how to export and import dashboards, maps, and charts from an old server running opCharts and migrate to a new server.

Reviewing your dashboards, charts, or maps:

You can use the tool. This is located in /usr/local/omk/bin.

Some examples below for listing views:

/usr/local/omk/bin/ act=list-dashboards
/usr/local/omk/bin/ act=list-charts
/usr/local/omk/bin/ act=list-maps

As well as: 

cd  /usr/local/omk/bin/
./ act=list-dashboards
./ act=list-charts
./ act=list-maps

For a full list of available operations, we can run on its own, for example /usr/local/omk/bin/

Usage: act=[action to take] [options...] act=list-{charts|maps|dashboards|business|pollers|collectors|enterprise} act=delete-{charts|maps|dashboards|business|pollers|collectors|enterprise} [name=A name=B...] act=export-{charts|maps|dashboards|business|pollers|collectors|enterprise} [name=A name=B...] [file=path]
file: save JSON to file, otherwise printed to STDOUT.
name: list of resource names to export. defaults to all resources. act=import-{charts|maps|dashboards|business|pollers|collector|enterprise} [name=A name=B...] [file=path] [force=true]
file: read JSON from file, otherwise read from STDIN
name: list of resource names to import. defaults to all resources.
force: if true will force the import to happen, replacing existing entries if they exist with the same name act=import-subnets  [force=true]
caches the subnets act=clear-subnets
clears the subnet cache act=import-user-dashboard name=dashboard-name users='user1, user2, ...'
change the default dashboard for a list of users act=clear-all-node-depend 
clear all node depend (subnet) act=update-subnet-dependency
Update all nodes dependencies act=setup-db
Sets up opCharts required indexes for MongoDB act=enrich-business-services
Enrich data for each business service to make fields sortable act={add|delete}-enterprise-service-object name="Enterprise Service Name" [type=node|interface|monitored_service] [node_uuid=A] [index=1] [monitored_service_name=A]
Add or delete a node, interface or monitored service from an existing enterprise service. act=migrate-business-service [name=A] [rename=B]
Creates an enterprise service from a business service, if the migrated name conflicts you can pass 'rename=example' to give the enterprise service a new name.

info=true:  print informational output
debug=true: print diagnostic output

Exporting dashboards, maps, and charts to a file (Export All Files)

/usr/local/omk/bin/ act=export-maps  file=/tmp/maps.json
/usr/local/omk/bin/ act=export-dashboards  file=/tmp/dashboards.json
/usr/local/omk/bin/ act=export-charts  file=/tmp/charts.json

You can then either use a SFTP application of choice to download these from the NMIS server to your local machine, or use SCP to copy direct from the CLI.

If you only require exporting a single view, you can instead add the name=My_Dashboard argument to the command:

/usr/local/omk/bin/ act=export-dashboards name=My_Dashboard file=/tmp/my_dashboard.json

Importing dashboards, maps, and charts from a file

/usr/local/omk/bin/ act=import-maps  file=/tmp/mpas.json
/usr/local/omk/bin/ act=import-dashboards  file=/tmp/dashboards.json
/usr/local/omk/bin/ act=import-charts  file=/tmp/charts.json

After you import the dashboards/charts/maps this will then be displayed in the relevant section of the opCharts GUI.

  • No labels