# Common Dashboards

Below are examples of common custom dashboards so you can view specific data to make informed decisions regarding your environments. Each walkthrough will provide step-by-step instructions on how to create the dashboard and can be customized to fit your needs.

{% hint style="info" %}
Creating new Data Providers, or updating of existing Data Providers, can only be done in an on-premises environment. For security reasons, the SaaS environment required signed Data Providers. Please reach out to our [Support team](https://adaptiva.com/support) for assistance.
{% endhint %}

## Inactive Device Dashboard

After a device has been inactive for over 21 days, it is permanently removed from the OneSite platform and no longer visible in the Admin Portal. This dashboard and associated subscription allow you to receive a notification when a device has been inactive for over 15 days in order for you to take further action regarding the inactive devices. This could include troubleshooting a device that should be active, checking on a device that is no longer in use to ensure it is in compliance with your asset management policies.

{% hint style="info" %}
We recommend 15 days, however, you can modify this to suit your specific needs.
{% endhint %}

### Create Inactive Device dashboard

<details>

<summary>Step 1 - Create a new Data Provider</summary>

#### Create a new Data Provider

For more information on how to create a Data Provider and Data Provider types, please see our [Data Providers](https://docs.adaptiva.com/platform-guide/platform-features/dashboards/data-providers) page.

1. Select **Dashboards > Data Providers** under **Platform Features** from the left side navigation.

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-0d3f878a62830f53de295a80ddaab0b6c7635d3c%2Fside-navigation.png?alt=media)
2. Click **+ New**.
3. Under **General** enter:
   * **Name** - Device Age
   * (Optional) **Description**
   * **Data Provider Type** - Adaptiva SQL
4. Under **Data Sets** click **+ Add Data Set** and enter the following:
   * **Name** - Device age greater than 15 days
   * (Optional) **Description**
5. Click **+ Add Column** and enter the following for **Column Name**, **Column Display**, **Column Type** for each of the associated columns that will be returned in the SQL query (see below):

   * **ComputerName** | Computer Name | Text
   * **OfficeName** | Office Name | Text
   * **AdaptivaClientVersion** | Adaptiva Client Version | Text
   * **OSName** | Operating System | Text
   * **LastMessageReceiveTime** | Last Message Received | Date-Time
   * **numberdays** | Number of Days Old | Whole Number
   * **IPAddress** | IP Address | Text

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-ead3e19321bb3462394e5e8f009ccf37e5c03fef%2Fcreate-dataset-columns.png?alt=media)
6. Click **Save** after each column information is entered.
7. Under **Data Set Queries** copy and paste the following SQL query into the **Data Query** tab field:

   ```sql
   SELECT * 
   FROM (
       SELECT 
       device_name AS ComputerName
       , location AS OfficeName
       , version AS AdaptivaClientVersion
       , device_type AS OSName
       , [last_check-in] AS LastMessageReceiveTime
       , DATEDIFF(dd, [last_check-in], GETDATE()) AS numberdays
       , ip_address AS IPAddress
       FROM a_AdaptivaClientDetails
       WHERE DATEDIFF(dd, [last_check-in], GETDATE()) > 15
       ) data
   ```

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-a57612336075205a90c8285b286108c33a3e727a%2Fdataset-queries.png?alt=media)
8. Copy and past the following SQL query into the **Count Query** tab field:

   ```sql
       SELECT COUNT(*) 
       FROM (
           SELECT 
           device_name AS ComputerName
           , location AS OfficeName
           , version AS AdaptivaClientVersion
           , device_type AS OSName
           , [last_check-in] AS LastMessageReceiveTime
           , datediff(dd, [last_check-in], getdate()) AS numberdays
           , ip_address AS IPAddress
           FROM a_AdaptivaClientDetails
           WHERE datediff(dd, [last_check-in], getdate()) > 15
           ) data
   ```
9. Click **Submit**.
10. Click **Save**.

</details>

<details>

<summary>Step 2 - Create a Dashboard</summary>

For more information on how to create a Dashboard, please see our [Dashboards](https://docs.adaptiva.com/platform-guide/platform-features/dashboards) and [Dashboard Widgets](https://docs.adaptiva.com/platform-guide/platform-features/dashboards/widget-types-properties) pages.

1. Select **Dashboards > Dashboards** from the left side navigation..
2. Click **+ New**.
3. Select **Default Dashboard**.

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-e9606a93191f64392ec10741d398f62038eeb935%2Fdefault-dashboard.png?alt=media)
4. Click the pencil icon to change the **Name** to **Device Age**.

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-429a598953e5b143faae57898afe5bcb7cd4f737%2Fpencil-change-name.png?alt=media)
5. Click on the ellipses (**...**) from the column toolbar and select **Add Widget > Table**.

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-d7c5cecd24118b8ab3eced324dc8fb8d5530814e%2Fselect-table-widget.png?alt=media)
6. Enter the following:

   * **Card Title** - Device Age
   * **Data Provider** - Browse and select the data provider you created Device Age
   * **Default Sort Column** - NumDaysOld
   * **Default Sort Ascending** - Toggle **OFF**

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-a1a959bbf789393430ae7ff6fd5d1139e986bb48%2Fedit-table-widget.png?alt=media)
7. Click **OK**.
8. Click **Save**.

You can click **Preview** to see if any devices have been inactive for longer than 15 days. Any device that is less than 15 days, will not be displayed.

![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-108ab118ee3aada01105df4656a282275569e6df%2Fpreview-dashboard.png?alt=media)

</details>

<details>

<summary>Step 3 - Create Dashboard Subscription</summary>

For more information, please see our [Subscriptions](https://docs.adaptiva.com/platform-guide/platform-features/dashboards/subscriptions) page.

{% hint style="info" %}
Subscriptions require SMTP to be configured in the settings. For more information, please see our [SMTP Settings](https://docs.adaptiva.com/platform-guide/additional-settings/smtp-settings) page.
{% endhint %}

The user Dashboard Subscription will send selected Roles an email notification with an Excel (.xlsx) file attached.

![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-9067a8d134806ade74a7942c3ed28ea631eed09a%2Femail-attachment.png?alt=media)

![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-25f190913588f3ec706b715de5500bf53f15f436%2Femail-attached-excel-spreadsheet.png?alt=media)

1. Select **Dashboards > Subscriptions** from the left side navigation.
2. Click **+ New**.
3. Under **Details** enter the following:
   * **Name** - Send Email for Devices Inactive More than 15 Days
   * (Optional) **Description**
4. Under **Email Settings** enter your desired **Email Subject Line** and **Email Body Text**.
5. Click **Browse** and select the Roles you wish to notify.

   ![](https://4278434842-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6zWDkRrsxRGskacChCcP%2Fuploads%2Fgit-blob-2692a751ed64b0141057966cc69851eca0a5b369%2Femail-settings.png?alt=media)
6. Click **Browse** under **Dashboard Settings** and select the Device Age dashboard you created above.
7. Click **OK**.
8. Click **Browse** under **Schedules** and select a schedule when you would like this subscription to be run, this will the schedule when your specified Roles will receive the email notification.
   * We recommend a daily schedule since this is a daily accrual of inactive days.
9. Click **Browse** Next to **Data Provider for Condition** and select **Device Age** data provider created above. This will autofill the **Data Set for condition** dropdown with the data set you created: Device age greater than 15 days.
10. Click **Save**.

If you would like to test your subscription before your specified schedule, you can click the **More** dropdown and select **Run Subscription**.

{% hint style="info" %}
If you do not have any devices that meet the specified criteria, you will NOT receive an email notification even after manually running a subscription.
{% endhint %}

</details>
