Performance Graphs

Populates Custom Fields with graphs for performance history of devices.

These scripts are designed to populate performance information into WYSIWYG custom fields. There are two scripts; one to gather the required performance information into a local json file on a device and a second to aggregate the data and generate the graphs. There are three options for the graphs you can generate (you can generate all 3 to their own fields or just the ones you want):

24 Hours - This will show the performance data for last 24 hours

Last 30 Days to 24 Hours - This will generate a graph for the last 30 days up until 24 hours in the past.

Last 90 Days to 30 Days - This will generate a graph for the last 90 days until 30 days in the past.

Setup

To configure this you will need to create 3 device custom fields to store the different graphs:

Field Name
Field Description
Type
Automation Permissions
Definition Scope

24HourPerformanceData

24 Hour Performance Data

WYSIWYG

Write

Device

30DayPerformanceData

30 Day Performance Data

WYSIWYG

Write

Device

90DayPerformanceData

90 Day Performance Data

WYSIWYG

Write

Device

Optionally you can also set the Advanced Setting to automatically expand the fields if you wish.

The Scripts

Data Gathering

Add this script to your automation library and then add it as a script condition set to run every 5 minutes to the policy of any windows devices you wish to monitor.

https://github.com/lwhitelock/NinjaOneAutomation/blob/main/PerformanceGraphs/Data-Gathering.ps1

Graph Generation and Data Aggregation

Configure this script either as a scheduled task or as a condition set to run once per hour. This script relies on the data generated by the data generation script.

https://github.com/lwhitelock/NinjaOneAutomation/blob/main/PerformanceGraphs/Graph-Aggregation.ps1

Last updated