Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
The MID server infrastructure agent is an PHP application that can be run as a Windows service intended for facilitating in order to facilitate communication and task handling between SimpleOne instance and external systems.Отсутствие документации, описания и схемы архитектурного решения, схемы взаимодействия с инстансом и инфраструктурой клиента, требований к ресурсам и публичной ссылки на скачивание самого MID сервера.
Concepts
Концепция MID заключается во взаимодействии между системой SimpleOne и внешними сервисами (например, серверами LDAP или почтовыми сервисами) со следующими целями:
- синхронизация информации в системе SimpleOne по заранее заданным шаблонам.
- синхронизация информации в сторонних системах по заранее заданным шаблонам.
Взаимодействие производится с помощью PHP-приложения, запускающегося в среде Windows. Для запуска необходимы интерпретатор PHP версии не менее 7.2 и curl. Принципиальная схема взаимодействия показана ниже
Image Removed
Как должно происходить взаимодействие:
- На инстансе SimpleOne устанавливается MID-сервер
- На вин-сервере во внешней инфраструктуре устанавливается MID-агент
- Агент отправляет запрос к серверу для получения задания (задания настраиваются пауэршел-скриптами в мид скрипт). Периодичность запросов задается планировщиком Windows
- Если правила файрвола не позволяют соединиться с сервером, то агент не сможет получить задания.
- При наличии заданий агент их выполняет, передает серверу сообщение об успешном или неуспешном выполнении.
Требования к ресурсам / System requirements
Как таковых требований к системным ресурсам у агента нет. Он устанавливается на сервере windows, соответственно, системные требования ограничены требованиями к серверу windows. Потребление ресурсов агентом минимально. Агент требует установленный интерпретатор пхп 7.2 (не меньше) и курл.
Требования к системным ресурсам сервера: устанавливается на инстансе симпла, много тоже не требует. Как и агент, требует пхп 7.2 минимум и курл.
To set up and configure your MID server, you'll need to have:
- A SimpleOne instance deployed in a cloud;
- An external Windows server with PHP 7.2 and CURL installed.
Note |
---|
Role required: admin. |
To configure your MID server, you need to find the .env configuration file in the \bin directory where the MID server 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=http://simple.test/rest
MID Server configuration file description
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 needed. 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 templates are PowerShell scripts implementing some tasks to handle. |
System Requirements
Either server or agent have been developed as a very lightweight applications and do not require many system resources, such as CPU, RAM or hard disk space.
Software requirements
Software | HW Requirements (minimum) | SW Requirements | ||
---|---|---|---|---|
Agent |
|
|
Tip |
---|
Infrastructure server is configured on SimpleOne instance as a dictionary record implementing appropriate business server and client logic. |
Interaction procedure
Interaction configuring, if simplified, can be represented as described below:
- Install infrastructure agent on Microsoft Windows server in a customer infrastructure.
- Configure infrastructure server on SimpleOne instance.
- Configure tasks for infrastructure agent.
- After that, the interaction begins.
- Agent sends requests to server to get a job assignment. Request interval can be configured via Windows Task Scheduler (generally, it is 1 minute).
- If there are no tasks to run, the agent performs further attempts within the intervals configured.
- If there are any tasks to run, the agent starts executing them in turn.
- Whether tasks were completed successfully or not, the agent will connect to the server to report 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:
Image Added
Anchor | ||||
---|---|---|---|---|
|
server
Please complete the steps below to add the server parameters into the appropriate table:
- Navigate to MID servers → MID server.
- Click New and fill in the form.
- Click Save or Save and Exit to apply changes.
MID Server form fields
Field | Mandatory | Description |
---|---|---|
Name | Y | The |
infrastructure server name displayed on the list. | ||
Hostname | Y | The hostname of the external server to which to connect. |
Last |
Connect | Y | The date and time of the latest connect. This field is populated automatically and always read-only. |
User | Y | The system user name with access to the |
infrastructure agent functionality. |
Tip |
---|
MID agent consists out of Infrastructure agent contains two .bat files:
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
Field | Description |
---|---|
MID_API_USERNAME | The system user name with granted access to the infrastructure agent functionality. |
MID_API_PASSWORD | The password of the appropriate user. |
MID_API_SERVERID | The ID of the server configured earlier in the MID Server table. |
MID_API_ENDPOINT | Link to the SimpleOne instance. |
Adding scripts
After you set up your MID serveryour 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 scriptScripts.
- Click New and fill in the form.
- Click Save or Save and Exit to apply changes.
MID Script form fields
Field | Mandatory | Description |
---|---|---|
Name | Y |
The infrastructure server name displayed on the list. | ||
Description | N | Brief script description. |
Is |
Active | N | Select this checkbox to make the script active or inactive. |
Script | Y | Type your |
script here, handling necessary tasks and duties related to the corresponding activities.
|
Anchor | ||||
---|---|---|---|---|
|
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 changes.
MID Queue form fields
Field | Mandatory | Description |
---|---|---|
Request | N | Type the request to the external server in the JSON format. |
Response | N | Server response containing command output (the stdout response) and other feedback. This field is populated automatically. |
Description | N | A brief job description. |
Server | Y | Reference to the record containing information about the infrastructure server configured earlier in the MID Server table. |
Script | Y | Reference to the record containing the infrastructure script that was set up earlier in the MID Script table. |
Status | N | The job status. This field is populated automatically |
. Available options:
|
|
|
|
|
|
|
|
| ||
Processed at | The date and time when the request was processed. |
Table of Contents | ||||||
---|---|---|---|---|---|---|
| ||||||