Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

Concept

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:

  1. Information synchronization on SimpleOne instance with predefined templates.
  2. 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


SoftwareHW 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:

  1. Install the infrastructure agent on Microsoft Windows server in a customer infrastructure.
  2. Configure the infrastructure server on the SimpleOne instance.
  3. 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.

  1. If there are no tasks to run, the agent performs further attempts within the intervals configured.
  2. If there are any some tasks to run, the agent starts executing them in turn.
    1. 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 AddedImage 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:

  1. Navigate to MID servers → MID server.
  2. Click New and fill in the form.
  3. Click Save or Save and Exit to apply the changes.

MID Server form fields

FieldMandatoryDescription
NameY
The
Specify the infrastructure server name displayed on the list.
HostnameY
The
Specify the hostname of the external server to which to
connect.Last ConnectYThe date and time of the latest
connect
. This field is populated automatically and always read-only
.
UserY
The
Specify a system user
name
with access to the infrastructure agent functionality.


Configure the infrastructure agent
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

Anchor
mid agent
mid agent


  1. Download the infrastructure agent archive.
  2. On disk C, create a folder named MID_agent.
  3. Move the downloaded .exe and .env files to the created folder.
  4. In the .env file, set the following configurations:

FieldDescription
MID_API_USERNAMEThe system user name username with granted access to the infrastructure the functionality of the infrastructure agent functionality.
MID_API_PASSWORDThe password of the appropriate specified user.
MID_API_SERVERIDThe server ID of the server configured earlier in the that is configured in the MID Server table.
MID_API_ENDPOINTLink to the SimpleOne instance.

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

Adding

Add scripts

After you set up your infrastructure your infrastructure agent, you need to configure the PowerShell scripts for it. 

NoteLearning how to develop PowerShell scripts is out of scope of this article; please refer to PowerShell product documentation.

  1. Navigate to MID Servers → MID Scripts.
  2. Click New and fill in the form.
  3. Click Save or Save and Exit to apply the changes.

MID Script form fields

FieldMandatoryDescription
NameY
The infrastructure
Specify the infrastructure server name displayed on the list.
DescriptionN
Brief script description
Add a brief description of the script.
Is ActiveNSelect this checkbox to
make
activate the script
active or inactive
.
ScriptY
Type 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 bundle

instances.

As an

For example, you can make

such a

this definition in your MID Script:

Code Block
languagejs
themeEclipse
titleMID 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
languagetext
titleMID Queue Request
{"param1":"String value"}

After the script

execution

is executed, the Response field in the related MID Queue record is equal to:

Code Block
languagetext
titleMID Queue Response
Title:
String value



Anchor
Tasks
Tasks

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.

  1. Navigate to MID Servers → MID Queue.
  2. Click New and fill in the form.
  3. Click Save or Save and Exit to apply the changes.

MID Queue form fields

FieldMandatoryDescription
RequestN
Type the
Enter a request to
the
an external server in
the
JSON format.
ResponseN
Server
The server response containing the output of the command
output
(
the 
the stdout response) and other feedback. This field is populated automatically.
DescriptionN
A
Add a brief description of the job
description
.
ServerY
Reference 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.
ScriptY
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
N
Y

The job status. This field is populated automatically. Available options:

  • Created
-
  • the job
was just
  • has been created, but not yet been processed.
  • Processing
-
  • the job is
processing
  • being processed now, and no error code
was
  • is returned.
  • Done
-
  • the job
was
  • is completed successfully, and the 0 error code
0 was
  • is returned.
  • Error
-
  • the job
was
  • is completed with errors, and any other error code
was returned. Tip
  1. If there is more than one job in the queue, they will be executed sequentially, one by one, from old to new.
  2. 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.
  3. 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
  • is returned.
Processed atNThe date and time when the request was processed.


Table of Contents
absoluteUrltrue
classfixedPosition
printablefalse