Using the CSV File Device Replicator

CSV Device Replicator

This external utility is used for device replication from CSV files into the internal SafeQ database.

Functionality and configuration

Regular start-up shall be provided by the user, e.g. the Scheduled Task service in Windows, by running the batch file delivered. To avoid pause in the end of run, add -nopause parameter.

<SAFEQ_DIR>\bin\device_import.bat

Next, several parameters can be set up in the YSoft SafeQ configuration (through System Settings page):

  • csv_device_dir – the value of this parameter must refer to the directory where the source csv files with the definition of the imported devices are located. Only files with the .csv extension are uploaded and then read in an alphabetic order. Should this directory not exist, the replication will not proceed and this service will be recorded in the log (default: C:/SafeQ5/server/csv_devices)

  • csv_device_emails – if this parameter is enabled, the replicator sends, after replication, an email to the SafeQ administrator (and to other addresses defined) if an error has occurred during replication. (default: disabled)

  • csv_device_email_address – other email addresses may be added to this parameter where the error log of the replicator shall be sent. Please separate the individual addresses with commas.

  • csv_device_incremental – if disabled (default) replicator will delete all devices created by previous replication. If enabled, replicator will only update existing devices.

  • csv_charset – character encoding for csv files. Value follows Java convention for defining charsets. (default: UTF-8)

CSV file structure

CSV files must have an accurate format. Mandatory values must be entered (shown in the list in blue), otherwise the device will not be replicated into the internal database. Optional values may be left blank. In this case, they will be obtained from the device template.
The individual parameters shall be separated with a semi-colon (;), should a value contain a semi-colon, then such value must be enclosed by inverted commas ("text;text").

All names are "case-sensitive", i.e. small and capital letters are distinguished. Example: group "default" is not the same as "Default".

  1. Device name  – name of a device. This parameter doesn't have to be unique in device group. If no Device name is specified in csv file, the device will not be replicated.

  2. Group name  – name of a device group (ORS group or Default group) to which the device will be assigned. If no group exists or specified group does not exist, the device will not be replicated.

  3. Template name  – name of device template from which the values not specified in the csv file will be taken. All missing parameters (accounting, price list, terminal embedded settings, advanced parameters...) are taken over from it. If template does not exist or is not specified in csv file, the device will not be replicated.

  4. Device   IP address  – IP address or domain name of a device. If csv file contains domain name for device instead of IP, replicator first translate domain into IP and then continue (this is necessary to eliminate possibility of replication 2 same devices - one with IP and one with domain). The replicator will determine if device with same IP address exists within the specified Group name. If exists, the device parameters will be updated according to the values taken from the csv file and will marked as replicated. If no such device exists with this IP, a new device will be created. IP address of the device must be unique within one ORS Group and within all CML groups. If csv file contains device specified with domain name and SafeQ already has this device, but with IP address, then IP is changed to domain name. If the Device IP address is not specified in csv file, the device will not be replicated.

  5. Terminal serial number or IP address – if specified, a new hardware terminal will be assigned to the device (or an old one updated). Terminal serial number must be unique within the whole SafeQ (including all CML and ORS groups). If the Terminal serial number or IP address already exists, then the device will not be replicated.

  6. Direct queues – if the value is filled out, then direct queues will be assigned to the device. If updating the device, then all previously assigned direct queues will be removed and newly specified queues are added. The individual names must be separated with commas (if multiple queues are to be assigned). Direct queue must be unique within the whole SafeQ (including all CML and ORS groups). If the device with same direct queue exists, the new device will not be replicated.

  7. Accounting center number - cost center to which the device will be assigned if value is specified. If value is incorrect (CC is already deleted or renamed) or value is not specified, the value is taken from template. If no such Accounting center number exists (CC in template is also incorrect), the device will not be replicated.

  8. Device description - description of the device. If no value is specified in csv file, then the value from template is taken.

  9. Device location - location of the device. If no value is specified in csv file, then the value from template is taken.

  10. Inventory number - equipment number of the device. If no value is specified in csv file, then the the value stays empty.

  11. Service Agreement number - m aintenance contract number. If no value is specified in csv file, then the the value stays empty.

  12. Person to contact -  If no value is specified in csv file, then the the value from template is taken.

  13. ZIP code - If no value is specified in csv file, then the the value from template is taken.  

Sample line:

_Main HQ printer;Default;Template 1;10.0.0.1;SQPR751331000E;direct1,direct2;0;My printer;"Downstairs in office; third from the left";EQ66;ServNo#66;"Phil Johnson";10001

Further information

  • If replicated devices use terminal embedded, admin will have to install TE manually after replication. TE setting are preconfigured and admin has to just click on reinstall button in device settings.

  • It is possible to have 2 devices with same terminal, because we cannot translate terminal IP into its SN and vice versa. So the first device can have terminal specified by its IP and second can have terminal specified by SN.

  • All replicated devices must have proper DNS record (DNS server must be accessible from SafeQ CML server) in order to disallow replication of 2 same devices (one with domain name and one with IP address).

Full replication must be run in maintenance hours only.