The infrastructure agent is an PHP application written on Go that can be run as a Windows service in order to facilitate communication and task handling between SimpleOne instance and external systems.
ConceptsConcept
In SimpleOne, communication among the instance and customer infrastructure (for example, LDAP servers or mail servers) is implemented using the "server-agent" technology.
It is used for collaboration when integration with customer software is neededUse the infrastructure agent when you need to integrate your SimpleOne instance with any other software. Main aims of this collaboration are:
- Information synchronization on SimpleOne instance with predefined templates.
- Information synchronization on customer instances with predefined templates.
Tip |
---|
Technically, these These templates are PowerShell the scripts implementing that enable handling some specific tasks to handle. |
System Requirements
Either The server or and the agent have been developed as a very lightweight applications application and do not require many any considerable system resources, such as CPU, RAM or hard disk space.
Software requirements
Software | HW Requirements (minimum) | SW Requirements |
---|
Agent | - CPU: 1.4 GHz 64-bit processor.
- RAM: 512 MB
- HDD: 32 GB
- Internet connection: 10/100/1000 Mbit/sec
Info |
---|
Agent system requirements are limited to OS system requirements. |
| - Microsoft Windows server (2012r2 or higher)PHP interpreter (version 7.2 or higher)cURL library
|
Tip |
---|
Infrastructure The infrastructure server is configured on the SimpleOne instance as a dictionary record, implementing appropriate business logic on the server and client logicsides. |
Interaction procedure
Interaction configuring, if simplified, can be represented as described belowTo configure the interaction, complete the following steps:
- Install the infrastructure agent on Microsoft Windows server in a customer infrastructure.
- Configure the infrastructure server on the SimpleOne instance.
- Configure the tasks for the infrastructure agent.After that
As a result, the interaction
begins.Agent is configured and starts. The agent sends requests to the server to get a job assignment.
Request interval can be configured via Windows Task Scheduler (generally, it is 1 minute)The request interval usually takes the couple of minutes.
- If there are no tasks to run, the agent performs further attempts within the intervals configured.
- If there are any some tasks to run, the agent starts executing them in turn.
- Whether tasks were completed successfully or not, the agent will connect connects to the server to report on the execution.
Note |
---|
Please note that you need to allow "agent→server" connections in your firewall rules. |
You can find graphical principles of this process on the diagram below:
The diagram below illustrates the process:
Image Added
Image Removed
Anchor |
---|
| Infrastructure server |
---|
| Infrastructure server |
---|
|
Setting Set up the infrastructure server
Please complete the steps below to To add the server parameters into the appropriate table, complete the following steps:
- Navigate to MID servers → MID server.
- Click New and fill in the form.
- Click Save or Save and Exit to apply the changes.
MID Server form fields
Field | Mandatory | Description |
---|
Name | Y |
The Specify the infrastructure server name displayed on the list. |
Hostname | Y |
The Specify the hostname of the external server to which to |
connect.Last Connect | Y | The date and time of the latest . This field is populated automatically and always read-onlyThe name with access to the infrastructure agent functionality. |
Tip |
---|
Infrastructure agent contains two .bat files: - one for adding the infrastructure agent starting up into the external server schedule;
- and one for removing it from the scheduler.
This functionality allows monitoring task processing with at a given interval. |
Configuring infrastructure agent
To configure your infrastructure agent, you need to find the .env configuration file in the \bin directory where the infrastructure agent was installed. Copy your *.env.example file into the *.env one and modify it in appropriate with your instance settings.
Example of the configuration file:
MID_API_USERNAME=admin
MID_API_PASSWORD=123456
MID_API_SERVERID=157237947616342741
MID_API_ENDPOINT=https://instance.example.com/rest
Infrastructure Server configuration file description
- Download the infrastructure agent archive.
- On disk C, create a folder named MID_agent.
- Move the downloaded .exe and .env files to the created folder.
In the .env file, set the following configurations:
Field | Description |
---|
MID_API_USERNAME | The system user name username with granted access to the infrastructure the functionality of the infrastructure agent functionality. |
MID_API_PASSWORD | The password of the appropriate specified user. |
MID_API_SERVERID | The server ID of the server configured earlier in the that is configured in the MID Server table. |
MID_API_ENDPOINT | Link to the SimpleOne instance. |
Adding Example of the configuration file:
MID_API_USERNAME=admin
MID_API_PASSWORD=123456
MID_API_SERVERID=157237947616342741
MID_API_ENDPOINT=https://instance.example.com/rest
Add scripts
After you set up your infrastructure your infrastructure agent, you need to configure the PowerShell scripts for it.
Note |
---|
Learning how to develop PowerShell scripts is out of scope of this article; please refer to PowerShell product documentation. |
- Navigate to MID Servers → MID Scripts.
- Click New and fill in the form.
- Click Save or Save and Exit to apply the changes.
MID Script form fields
Field | Mandatory | Description |
---|
Name | Y |
The infrastructure Specify the infrastructure server name displayed on the list. |
Description | N |
Brief script descriptionAdd a brief description of the script. |
Is Active | N | Select this checkbox to |
make active or inactiveType your script here, handling Specify a script that handles the necessary tasks and |
duties related to responsibilities associated with the corresponding activities. Tip |
---|
In these scripts, you can use variables |
|
facilitating to facilitate the data exchange |
|
within customer across the client infrastructure and the SimpleOne |
|
instance bundleAs an For example, you can make |
|
such a this definition in your MID Script: Code Block |
---|
language | js |
---|
theme | Eclipse |
---|
title | MID Script |
---|
| $title='Title:\n';Write-Host($title);Write-Host($param1); |
Then the value |
|
for of the title variable should be transferred |
|
into in the Request field of the related MID Queue record: Code Block |
---|
language | text |
---|
title | MID Queue Request |
---|
| {"param1":"String value"} |
After the script |
|
executionis executed, the Response field in the related MID Queue record is equal to: Code Block |
---|
language | text |
---|
title | MID Queue Response |
---|
| Title:
String value |
|
|
Setting Set up a task
To set up a job on the external infrastructure element, you need to create a record in the MID Queue (sys_mid_queue) table. For this, please complete the steps below.
- Navigate to MID Servers → MID Queue.
- Click New and fill in the form.
- Click Save or Save and Exit to apply the changes.
MID Queue form fields
Field | Mandatory | Description |
---|
Request | N |
Type the the the Server The server response containing the output of the command |
output the the stdout response) and other feedback. This field is populated automatically. |
Description | N |
A Add a brief description of the job |
descriptionReference to the record containing information about the infrastructure server configured earlier in the Specify a record that contains the information about the previously configured infrastructure server in the MID Server table. |
Script | Y |
Reference to the record containing the infrastructure script that was set up Specify a record that contains the infrastructure script that you configured earlier in the MID Script table. |
Status |
NY | The job status. This field is populated automatically. Available options: |
- was just - has been created, but not yet been processed.
- Processing
|
- processing - being processed now, and no error code
|
was - was - is completed successfully, and the 0 error code
|
0 was - was - is completed with errors, and any other error code
|
was returned. Tip |
---|
- If there is more than one job in the queue, they will be executed sequentially, one by one, from old to new.
- If an external server is not responding for a minute, the script will be terminated by timeout. Note: in this case, the corresponding task will not return the error code.
- You can run a job manually if necessary. For this, run the command:
Code Block |
---|
php.exe bin\agent mid:run-job |
Where run:job is a job name you need to execute.
Note: bin\agent is a pathway relatively infrastructure agent installation folder. In the case of you are in the another folder, please specify the full path; otherwise, the job may not be executed |
Processed at | N | The date and time when the request was processed. |