Date: Thu, 28 Mar 2024 17:44:52 +0000 (UTC) Message-ID: <1452887630.3932.1711647892554@skald.opmantek.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_3931_1131793972.1711647892553" ------=_Part_3931_1131793972.1711647892553 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
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 serve= r.
You can use the opcharts-cli.pl tool. This is located in /usr/local/omk/=
bin.
Some examples below for listing views:
/usr/local/omk/bi= n/opcharts-cli.pl act=3Dlist-dashboards /usr/local/omk/bin/opcharts-cli.pl act=3Dlist-charts /usr/local/omk/bin/opcharts-cli.pl act=3Dlist-maps
As well as:
cd /usr/loc= al/omk/bin/ ./opcharts-cli.pl act=3Dlist-dashboards ./opcharts-cli.pl act=3Dlist-charts ./opcharts-cli.pl act=3Dlist-maps
For a full list of available operations, we can run opcharts-cli.pl on i= ts own, for example /usr/local/omk/bin/opcharts-cli.pl.
Usage: opcharts-c= li.pl act=3D[action to take] [options...] opcharts-cli.pl act=3Dlist-{charts|maps|dashboards|business|pollers|collect= ors|enterprise} opcharts-cli.pl act=3Ddelete-{charts|maps|dashboards|business|pollers|colle= ctors|enterprise} [name=3DA name=3DB...] opcharts-cli.pl act=3Dexport-{charts|maps|dashboards|business|pollers|colle= ctors|enterprise} [name=3DA name=3DB...] [file=3Dpath] file: save JSON to file, otherwise printed to STDOUT. name: list of resource names to export. defaults to all resources. opcharts-cli.pl act=3Dimport-{charts|maps|dashboards|business|pollers|colle= ctor|enterprise} [name=3DA name=3DB...] [file=3Dpath] [force=3Dtrue] 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 opcharts-cli.pl act=3Dimport-subnets [force=3Dtrue] caches the subnets opcharts-cli.pl act=3Dclear-subnets clears the subnet cache opcharts-cli.pl act=3Dimport-user-dashboard name=3Ddashboard-name users=3D'= user1, user2, ...' change the default dashboard for a list of users opcharts-cli.pl act=3Dclear-all-node-depend=20 clear all node depend (subnet) opcharts-cli.pl act=3Dupdate-subnet-dependency Update all nodes dependencies=20 opcharts-cli.pl act=3Dsetup-db Sets up opCharts required indexes for MongoDB opcharts-cli.pl act=3Denrich-business-services Enrich data for each business service to make fields sortable opcharts-cli.pl act=3D{add|delete}-enterprise-service-object name=3D"Enterp= rise Service Name" [type=3Dnode|interface|monitored_service] [node_uuid=3DA= ] [index=3D1] [monitored_service_name=3DA] Add or delete a node, interface or monitored service from an existing enter= prise service. opcharts-cli.pl act=3Dmigrate-business-service [name=3DA] [rename=3DB] Creates an enterprise service from a business service, if the migrated name= conflicts you can pass 'rename=3Dexample' to give the enterprise service a= new name. options: info=3Dtrue: print informational output debug=3Dtrue: print diagnostic output
/usr/local/omk/bi= n/opcharts-cli.pl act=3Dexport-maps file=3D/tmp/maps.json /usr/local/omk/bin/opcharts-cli.pl act=3Dexport-dashboards file=3D/tm= p/dashboards.json /usr/local/omk/bin/opcharts-cli.pl act=3Dexport-charts file=3D/tmp/ch= arts.json
You can then either use a SFTP application of choice to download these f= rom the NMIS server to your local machine, or use SCP to copy direct from t= he CLI.
If you only require exporting a single view, you can instead add the nam= e=3DMy_Dashboard argument to the command:
/usr/local/omk/bi= n/opcharts-cli.pl act=3Dexport-dashboards name=3DMy_Dashboard file=3D/tmp/m= y_dashboard.json
/usr/local/omk/bi= n/opcharts-cli.pl act=3Dimport-maps file=3D/tmp/mpas.json /usr/local/omk/bin/opcharts-cli.pl act=3Dimport-dashboards file=3D/tm= p/dashboards.json /usr/local/omk/bin/opcharts-cli.pl act=3Dimport-charts file=3D/tmp/ch= arts.json
After you import the dashboards/charts/maps this will then be displayed = in the relevant section of the opCharts GUI.