You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 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.

Concepts


Концепция MID заключается во взаимодействии между системой SimpleOne и внешними сервисами (например, серверами LDAP или почтовыми сервисами) со следующими целями:

  • синхронизация информации в системе SimpleOne по заранее заданным шаблонам.
  • синхронизация информации в сторонних системах по заранее заданным шаблонам.

Взаимодействие производится с помощью PHP-приложения, запускающегося в среде Windows. Для запуска необходимы интерпретатор PHP версии не менее 7.2 и curl. Принципиальная схема взаимодействия показана ниже

Как должно происходить взаимодействие:

  1. На инстансе SimpleOne устанавливается MID-сервер
  2. На вин-сервере во внешней инфраструктуре устанавливается MID-агент
  3. Агент отправляет запрос к серверу для получения задания (задания настраиваются пауэршел-скриптами в мид скрипт)
    1. Если правила файрвола не позволяют соединиться с сервером, то агент не сможет получить задания.
  4. При наличии заданий агент их выполняет, передает серверу сообщение об успешном или неуспешном выполнении.



To set up and configure your MID server, you'll need to have:

  1. A SimpleOne instance deployed in a cloud;
  2. An external Windows server with PHP 7.2 and CURL installed.

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

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

Setting up the MID server


Please complete the steps below to add the server parameters into the appropriate table:

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

MID Server form fields

FieldDescription
NameThe MID server name displayed on the list.
HostnameThe hostname of the external server to which to connect.
Last connectThe date and time of the latest connect. This field is populated automatically and always read-only.
UserThe system user name with access to the MID agent functionality.

MID agent consists out of two .bat files:

  • the first one is to add the MID agent starting up into the external server schedule;
  • and the second one is to remove it from the scheduler.

This functionality allows monitoring task processing with at a given interval.

Adding scripts


After you set up your MID server, you need to configure the scripts for it. They are written using PowerShell (if this is a Windows server) or Bash (in the case of Linux server) scripting languages.

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

MID Script form fields

FieldDescription
NameThe MID server name displayed on the list.
DescriptionBrief script description.
Is activeSelect 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.

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

MID Queue form fields

FieldDescription
Status

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

  • Created - the job was just created but not yet processed;
  • Processing - the job is processing now, and no error code was returned;
  • Done - the job was completed successfully, and the error code 0 was returned;
  • Error - the job was completed with errors, and any other error code was returned.
  1. If there is more than one job in the queue, then they will be executed sequentially, one by one, from old to new.
  2. If an external server is not responding for a minute, then 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:
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.

RequestType the request to the external server in the JSON format.
ResponseServer response containing command output (the stdout response) and other feedback. This field is populated automatically.
DescriptionBrief job description.
Processed atThe date and time when the request was processed.
ServerReference to the record containing information about the MID server configured earlier in the MID Server table.
ScriptReference to the record containing the MID script that was set up earlier in the MID Script table.

  • No labels