You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 6 Next »
The MID server is an PHP application that can be run as a Windows service intended for facilitating communication and task handling between SimpleOne instance and external systems.
Отсутствие документации, описания и схемы архитектурного решения, схемы взаимодействия с инстансом и инфраструктурой клиента, требований к ресурсам и публичной ссылки на скачивание самого MID сервера.
Concepts
In SimpleOne, communication among the system and third-party infrastructure (for example, LDAP servers or mail servers) is implemented using the "server-agent" technology.
It is used for collaboration when integration with 3rd-party software is needed. Main aims of this collaboration are:
- Information synchronization on SimpleOne instance with predefined templates.
- Information synchronization on 3rd-party instances with predefined templates.
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 | Requirements |
---|---|
Server |
|
Agent |
|
Interaction procedure
Interaction configuring, if simplified, can be represented as described below:
- Install MID agent on Microsoft Windows server in a customer infrastructure
- Install MID server on SimpleOne instance.
- After that, 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
- 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 server to report execution.
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:
Setting up the MID 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 | Description |
---|---|
Name | The MID server name displayed on the list. |
Hostname | The hostname of the external server to which to connect. |
Last connect | The date and time of the latest connect. This field is populated automatically and always read-only. |
User | The system user name with access to the MID agent functionality. |
MID agent contains two .bat files:
- one for adding the MID 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 MID server
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=https://instance.example.com/rest
MID Server configuration file description
Field | Description |
---|---|
MID_API_USERNAME | The system user name with granted access to the MID 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 server, you need to configure the PowerShell scripts for it.
Learning how to develop PowerShell scripts is out of scope of this article; please refer to PowerShell product documentation.
- Navigate to MID Servers → MID script
- Click New and fill in the form.
- Click Save or Save and Exit to apply changes.
MID Script form fields
Field | Description |
---|---|
Name | The MID server name displayed on the list. |
Description | Brief script description. |
Is active | Select this checkbox to make the script active or inactive. |
Script | Type your PowerShell script here, handling necessary tasks and duties related to the corresponding activities. |
Setting 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 changes.
MID Queue form fields
Field | Description |
---|---|
Status | The job status. This field is populated automatically, Available options:
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 MID 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. |
Request | Type the request to the external server in the JSON format. |
Response | Server response containing command output (the stdout response) and other feedback. This field is populated automatically. |
Description | A brief job description. |
Processed at | The date and time when the request was processed. |
Server | Reference to the record containing information about the MID server configured earlier in the MID Server table. |
Script | Reference to the record containing the MID script that was set up earlier in the MID Script table. |
- No labels