MySQL plugin
The plugin is available as a Cloud plugin and also as an on-premises plugin. This plugin allows for the connection from the on-premises SquaredUp agent to any MySQL instance which is available to connect to with SQL Login.

An on-premises plugin connects a service running in your internal network to SquaredUp. They require an agent installed on a machine that has access to your internal network.
How to add the MySQL plugin
You will only need to configure and deploy an agent if you adding the MySQL on-premises plugin. If you want to add the MySQL Cloud plugin, you only need to follow the steps detailed in Add the MySQL plugin in SquaredUp.
Configure and deploy an agent
If you have already created an agent in SquaredUp that you can use for this plugin, you can skip this step and choose the agent group you want to use while adding the plugin.

Create a unique API key for your agent and add the agent to an agent group in SquaredUp.
You create an API key by creating an agent in SquaredUp:
Go to Settings > Relay and add an Agent.
Give the new agent a name and a description that helps you identify where the agent is installed. For example:
Name: server1.domain.localDescription: Test server in production domain
Choose the Agent Group for this agent:
If you already have agent groups, assign it to an existing group and click create.
If you don't have any agent groups yet or want to assign the new agent to a new group, leave the Agent Groups field empty and click create. Then create the agent group by clicking on Add Agent Group and select the new agent in the Agents field for the new group.
After you created the agent, the API key for this agent will be shown to you. Copy the key and store it until you inserted the key into the configuration of the agent you want to deploy on your machine.
The API key will only be displayed to you once. If you lose this API key, you need to generate a new one (by creating a new agent) and any references to the old API key in the configuration of the agent you deployed on your machine will need to be updated.
- The Agent status will show as gray until the next stage of configuring the service is completed successfully.
Deploy the agent on a machine that has access to the service the plugin connects to.
Download the latest release of the SquaredUp Agent zip file, by clicking the download icon under Options next to the Agent you have just added.
Prerequisites for Agents
The Agent needs to run on a Windows machine that has access to the data source for the on-premises plugin
Make sure the Agent is able to make outbound connections on port 443 (no inbound required) to SquaredUp and Microsoft APIs (Azure Relay).
Optional DNS-based restrictions: *.servicebus.windows.net
On a Windows machine, with access to the data source your plugin needs to use, extract the downloaded zip file.
In the directory of the extracted zip file, open PowerShell as an administrator and run the following command:
Copy./Install-SQUPAgent.ps1 -ApiKey "key" -AsService -ServiceSuffix "name" -ServiceAccount domain\username
Parameters to replace:
-ApiKey "key"
Mandatory Replace key
with the API key you created for the Agent in SquaredUp-AsService
Recommended Run the Agent as a service on the machine -ServiceSuffix "name"
Optional To change the default service name of squpagent replace name
with your new service name.-ServiceAccount domain\username
Optional To run the Agent as a domain service account (for example, for the SCOM plugin), provide the username as domain\username
and it will prompt for the password when it sets up the serviceConfigure a domain service account using the installation script, for example:
./Install-SQUPAgent.ps1 -ApiKey "key" -AsService -ServiceAccount domain\username
where
key
is the API key, anddomain\username
is the domain service accountAlternatively, in Services > SquaredUp Cloud Agent > Properties select the account on the Log On tab.
Use a dedicated user account for the agent's service identity. Create a special service account for this domain service account, do not use an existing user account.
The account (typically a service account) needs to have the log on as a service permission.
Adjust any permissions for the service and start the service.
How to start the Agent service
You can start the agent service from Services > SquaredUp Cloud Agent, or using PowerShell using either:
Start-Service -Name <ServiceName>
Where
<ServiceName>
should be replaced with the service name shown in brackets in the upgrade script output (or Properties of the service).For example:
Start-Service -Name squpagent
or
Start-Service -DisplayName <DisplayName>
Where
<DisplayName>
should be replaced with the service name shown before the brackets in the upgrade script output (or Properties of the service).How to find the Agent folder location or Service name in Properties
Look at the Properties of the SquaredUp Cloud Agent service:
On the server running the Agent, open Services
Scroll down to the SquaredUp Cloud Agent in the list
Right-click on the SquaredUp Cloud Agent service and then Properties
Here you can see the Service name, Display name and Path to the Agent folder.
You can also start or stop the service from here.
- Check the Agent status in SquaredUp Settings > Relay
Running the Agent as a domain service account
By default, the SquaredUp agent service uses the local system identity, but this can be changed to a domain service account if required, for example for the SCOM plugin.
Add the MySQL plugin in SquaredUp
In SquaredUp browse to Settings > Plugins > Add plugin and search for the plugin.
Display Name:
Enter a name for your plugin. This helps you to identify this plugin in the list of your plugins.
Username:
Enter the SQL login username
Password:
The SQL login password
Server:
The server address or IP which to connect to. Do not include a port with the SERVER value.
If you are adding the MySQL on-premises plugin, the server must be accessible from the machine running the SquaredUp on-premises agent.
Database:
The name of the database which to initially connect to. Any queries executed without a database explicitly set will be run against this database.
Port:
The port to use to connect to SQL. The default is 3306, but can be changed as needed.
Object Query (optional):
The MySQL Server Connection can create objects in the Knowledge Graph import and these can be used to create context sensitive objects and drill-downs.
Object Query
These plugins support the creation of objects from a database query. The resulting table must contain sourceId, name, and type fields. Additional fields are allowed, and any non-null fields will be included with the object when imported into the Knowledge Graph.
A sample query result is below:
sourceId
name
type
initials
operating_system
abeLincoln
Abraham Lincoln
user
AL
server_1
Infra-SQL01.local
server
windows
In the above sample table two objects will be created in the Knowledge Graph. The first will be of type user and have a sourceId of abeLincoln and a single property for initials. The operating_system attribute will not be added to this object as it has a null property. The second object created will be a server with sourceId server_1 and a single property of operating_system.
Relationship Query (optional):
If you are creating objects with the Object Query set in the previous step, you can relate those objects in the Knowledge Graph.
Relationship Query
Along with an Object Query an additional Relationship Query can also be used. The result of this query must contain the fields inV, outV, and label. The rows of this result will be converted to relationships in the Knowledge Graph.
A sample query result is below:
outV
label
inV
abeLincoln
own
server_1
After the import is complete the two objects created from the Object Query will now be linked, with Abraham Lincoln owning Infra-SQL01.local
Agent Group:
Select the Agent Group that contains the agent(s) you want to use.
This field will only appear if you are adding the MySQL on-premises plugin.
Leave the checkbox for Automatically create a workspace ticked, this will create a new workspace for this plugin containing out of the box dashboards and scopes.
Optionally, select whether you would like to restrict access to this plugin instance. By default, restricted access is set to off.
Restrict access to this workspace?
The term plugin here really means plugin instance. For example, a user may configure two instances of the AWS plugin, one for their development environment and one for production. In that case, each plugin instance has its own access control settings.
By default, Restrict access to this plugin? is set to off. The plugin can be viewed, edited and administered by anyone. If you would like to control who has access to this plugin, switch Restrict access to this plugin? to on.
Use the Restrict access to this plugin? dropdown to control who has access to the workspace:
By default, the user setting the permissions for the plugin will be given Full Control and the Everyone group will be given Link to workspace permissions.
Tailor access to the plugin, as required, by selecting individual users or user groups from the dropdown and giving them Link to workspace or Full Control permissions.
If the user is not available from the dropdown, you are able to invite them to the plugin by typing in their email address and then clicking Add. The new user will then receive an email inviting them to create an account on SquaredUp Cloud. Once the account has been created, they will gain access to the tenant.
At least one user or group must be given Full Control.
Admin users can edit the configuration, modify the Access Control List (ACL) and delete the plugin, regardless of the ACL chosen.
Plugin access levels
Access Level:
Link to workspace
- User can link the plugin to any workspace they have at least Editor permissions for.
- Data from the plugin can then be viewed by anyone with any access to the workspace.
User can share the plugin data with anyone they want.
User cannot configure the plugin in any way, or delete it.
Full Control - User can change the plugin configuration, ACL, and delete the plugin.
See Access control for more information.
Click Save.
Using the MySQL plugin
Add a dashboard and go into the configuration of a tile.
Add a scope. For example:
Plugin: MySQL On-Premises
Type: MySQL Connections
Create a data stream by clicking on one of the customizable data streams.
Creating data streams for the MySQL plugin
This plugin allows you to configure your own data streams.

A configurable data stream allows you to easily create new data streams specific to your needs, by entering information into a form, such as metric names or queries. Configurable data streams have a + before the name, and once new data streams have been created they show in the normal list of data streams.
Any data streams you create can be edited from Settings > Data Streams.
When using the plugin to create data streams you have the option to create three different query types, as detailed below. The use of dynamic {{mustache}} properties is supported and is detailed following the types.
Custom Table Query
This allows for any tabular data to be pulled into to SquaredUp and be displayed in a standard table.
Custom Metrics Query
This configurable data stream type allows for data to be displayed in a visual format, such as a line graph. When writing a query for use as a Metrics query, the below three columns are mandatory and all others will be ignored.
Column Name (case sensitive) | Content |
label | The label for the value passed in, for example ‘Percent Utilization’. Each distinct ‘label’ value will get its own line color which includes only values for that label. |
timestamp | A DateTime value of when this reading occurred |
value | A numerical non-null value to be visualized |
Custom State Query
This configurable data stream allows for data to be displayed as a state tile (Red, Yellow, or Green blocks). When writing a query for use in a State query the below three columns are mandatory and all others will be ignored.
Column Name (case sensitive) | Content |
label | The label for the state passed in, for example ‘Deliveries’. These ‘label’ values must be distinct and will each produce their own status block |
id | If this state will be tied to an object, then that object’s sourceId should be used, otherwise passing the ‘label’ value a second time will work effectively. |
state | The state of the labeled object, options are ‘Success’, ‘Warning’, ‘Error’, and ‘Unknown’ |
Available Properties ({{mustache}})
timeframe
All of the properties in the calling event payload are passed through to the template builder with the addition of below three properties.
• durationSeconds
• durationMinutes
• durationHours
Example
Parameter | Replacement value | Type |
{{timeframe.start}} | 2022-03-13T19:45:00.000Z | string |
{{timeframe.unixStart}} | 1647200700 | number |
{{timeframe.end}} | 2022-03-14T19:45:00.000Z | string |
{{timeframe.unixEnd}} | 1647287100 | number |
{{timeframe.enum}} | last24hours | string |
{{timeframe.interval}} | PT15M | string |
{{timeframe.durationSeconds}} | 86400 | number |
{{timeframe.durationMinutes}} | 1440 | number |
{{timeframe.durationHours}} | 24 | number |
Select CustomerName, Order from dbo.Orders where orderDT > DateADD(mi, -{{timeframe.durationMinutes}},GetDate())
sourceIds
This is a unique property as some pre-processing occurs within the plugin to modify the values. sourceIds will return a list of all the targeted nodes sourceId elements, concatenated with commas and string delimiters for TSQL friendly systems.
Example
Parameter | Replacement value | Type |
{{sourceIds}} | 'idOne','idTwo','idThree' | string |
Select CustomerName, Order from dbo.Orders where customerId IN ({{sourceIds}})
sourceId
This will return the sourceId of the first target node in the query. While not as powerful as the sourceIds value, it works for systems that don't support TSQL syntax and will still allow drill-down behavior
Example
Parameter | Replacement value | Type |
{{sourceId}} | idOne | string |
Select CustomerName, Order from dbo.Orders where customerId = '{{sourceId}}'
targetNodes
This property represents the targetNodes on the calling event with the small addition of a first and last property on the respective nodes. This allows for Mustache templates to do a couple tricks, as noted below.
Example
Parameter | Replacement value | Type |
{{targetNodes.0.sourceId}} | idOne | string |
{{#targetNodes}}'{{sourceId}}'{{^last}},{{/last}}{{/targetNodes}} | 'idOne','idTwo','idThree' | string |
Select CustomerName, Order from dbo.Orders where customerId = '{{targetNodes.0.sourceId}}'
Select CustomerName, Order from dbo.Orders where customerId IN ({{#targetNodes}}'{{sourceId}}'{{^last}},{{/last}}{{/targetNodes}})
Comments
0 comments
Please sign in to leave a comment.