Back to OP5 Monitor FAQ

Dashboards - How to copy dashboards between users

INFO Copied

ITRS does not officially support the below instructions but provides them as is.

In OP5 Monitor version 7.2.6, Sharable Dashboards were introduced. There is also a how-to guide that features a Python script to clone multiple dashboards to another user.

This how-to guide, however, goes more involved in what happens when you copy a dashboard from one user to another. We include here some extended features that also delete the target user’s dashboard.

Step-by-step guide Copied

Preconditions Copied

  1. Start with a preconfigured dashboard that will be propagated to users;
  2. You need to remove the existing dashboard for the user before copying the new one. This must be done after the upgrade to 7.2.6, since the database layout has changed;
  3. Make sure that none of the users to whom you will be propagating the dashboards are logged in;
  4. Have a look at the database for dashboards:

dash-copy.sql

 # mysql merlin  mysql> select * from dashboards;  This will give you a long list of usernames with corresponding dashboards:  +----+-----------------------------------+--------------+--------+  | id | name | username | layout |  +----+-----------------------------------+--------------+--------+  | 1 | Dashboard for <user> | <user> | 1,3,2 |  | 2 | Dashboard for reports | reports | 3,2,1 |  | 3 | Dashboard for readonly | readonly | 3,2,1 |  [..]

Steps Copied

  1. Save this information to a text file for later use.

    ID-Column

    Notice the column ‘id’, this is very important to have to be able to delete the user’s dashboard from two tables: ‘dashboards’ and ‘dashboard_widgets’.

  2. To remove the current dashboard for the user ‘readonly’, execute the following:

    removing after copying

    mysql> DELETE FROM dashboard_widgets WHERE dashboard_id = '3'; mysql> DELETE FROM dashboards where id = '3';
    
  3. Repeat the procedure above for all users that should have a predefined dashboard.

  4. Download the custom script that you can find at the bottom of this article in zip format (contains copy-dashboard.php). It has been developed for this process to your op5 server

  5. Edit the script and change the parameters below, in this example I will copy the dashboard from the user ‘’ as the source user:

    // Name of the dashboard to copy to the users  $dashboard_name = 'Dashboard for <user>';  // Name of the user that owns (created) the dashboard  $dashboard_user = '<user>';
    
  6. Use the aforementioned list of users that was saved from the database to insert into the array below:

    // List of usernames to copy the dashboard to,  // could be fetched from multiple locations  $target_users = array('reports, 'readonly');
    
  7. Once you have double-checked the target and the source users, execute the script:

    # php copy-dashboard.php
    
  8. Log into OP5 Monitor with one of the target users that were specified as a target in the script to verify.

["Geneos"] ["FAQ"]

Was this topic helpful?