MySQL Database Import (MySQL_Import)

The MySQL Database Import (MySQLImport) allows the import of assets by querying a table in a MySQLDB.


MySQL is a very popular and widely used Relational Database technology. This import system is ideal for importing asset information from a CMDB (Configuration Management Database) using this technology.

The different fields to be filled in by the user, as well as the instructions for querying the MySQL table, are detailed one by one below.


Realm Name

This field is not editable and indicates the name of the Realm that is the subject of the Import Task.

Task Type

This field indicates the Task Type that will be generated. It is the first selectable field in the dropdown menu and influences the remaining fields.

If a different Task type is selected before saving the changes, the data entered in the other fields will be lost.


This field contains the name chosen by the user to identify the new Task created.


Checking this box enables and activates this new Import Task for its next execution.

By default this option is enabled.


By means of this drop-down it is possible to choose how often the import of Assets of this new Task will be executed. The possible options are:

  • Task executed daily (Every 1 days).

  • Task executed every second (Every 1 second).


An alternative option to set the frequency at which the Task will be executed. Its configuration is done using the Crontab format, providing greater flexibility for more specific use cases.

Expand on information about defining execution periods aquí.

Host name

In this field the user must enter the Host name or the IP address of the Host where the DB resides.

Database user

In this field you have to enter a valid user name within the database from which you want to extract the import data.

Database password

In this field you must enter the password associated with the user account indicated above.

Database name

In this field you must indicate the name of the database containing the information to be imported.

Database table

In this field you have to enter the name of the above mentioned database table, which contains the information of the Hosts to be imported into WOCU-Monitoring.


In this field you can specify conditions for the import of Assets and their corresponding data. It is possible to define as conditions WHERE ... AND ..., thus allowing you to filter and return only certain data that you want to import and that WOCU-Monitoring requires for monitoring.

The condition must follow the following syntax:

"address": "",
"cif": "B0000000"


This field establishes a relationship and correspondence between the fields of the table to be imported and the variables used internally by WOCU-Monitoring to store the data on the monitored Hosts.

The mapping is done by entering in the Mapping field which WOCU-Monitoring internal variable or field will host the values of a certain field of the DB table used to perform the import.

The mapping follows this syntax:

{'_DEVICEVENDOR': '$vendor',
'_IFACES': '$interfaces_macro_byid',
'_IFACES_BYNAME': '$interfaces_macro',
'_SNMPCOMMUNITY': '$community',
'_SNMPVERSION': '$snmpversion',
'active_checks_enabled': '$active_checks_enabled',
'address': '$ipgest',
'alias': '$alias',
'business_impact': '$business_impact',
'check_command': '$check_command',
'check_interval': '$check_interval',
'check_period': '$checkperiod',
'check_period_link': '$check_period_link',
'display_name': '$display_name',
'host_name': '$mnemonico',
'hostgroups': '$hostgroups',
'latitude': '$latitude',
'longitude': '$longitude',
'macros': '$macros',
'max_check_attempts': '$max_check_attempts',
'notification_period': '$notificationperiod',
'notification_period_link': '$notification_period_link',
'notifications_enabled': '$notifications_enabled',
'parents': '$parents',
'poller_tag': '$poller_tag',
'realm': '$realm',
'retry_interval': '$retry_interval',
'service_excludes': '$service_excludes',
'service_includes': '$service_includes',
'service_overrides': '$service_overrides',
'use_packs': '$use_packs',
'use_templates': '$use_templates'}


For example, the host_name field of the MySQL database used for the import corresponds to the WOCU-Monitoring internal field $mnemonico where the name of the Hosts is stored.

The text adjacent to the edit block provides the following list:

Allowed fields for Host:


In addition, hovering the cursor over the help button () will bring up a new view with the following information:

Mapping for database extraction.

Example: {"host_name": "$column_host", "address": "$column_ip",
"check_command": "$check_command"}

Also allowed any macros.

Example: {"_SNMPCOMMUNITY": "$community",
"_SNMPVERSION": "$snmpversion","_DEVICEVENDOR": "$column_vendor"}

Overwrite simple macros

This option allows you to enable or disable the updating of the simple macros of the Assets. By default this option is enabled.

Overwrite complex macros

This option allows you to enable or disable the updating of the complex macros of the Assets. By default this option is disabled.


Macros are elements that WOCU-Monitoring uses internally to store properties and information of the monitored Assets.

A simple macro stores a single value. An example is _DEVICEVENDOR, a macro that stores as a value the name of the manufacturer of the Host. For example, for a Cisco switch this macro would have the value:


A complex macro, on the other hand, can store a multitude of values within a table. An example is _IFACES, a macro that stores all the data of the ports and network interfaces of a Host. For example, for a Cisco switch this macro would have the value:

_IFACES:Fa0/0$(1)$$(1)$$(0)$$(0)$$(m)$,Fa1/1$(4)$$(0)$$(0)$$(0)$$(m)$, WAN_CPD_01$(8)$$(0)$$(0)$$(0)$$(m)$...

Given the difficulty of configuring some complex macros, which may require additional manual configuration, it may be preferable to avoid overwriting them when running an Import Task. This is why this option to overwrite complex macros is disabled by default. It is advisable to use this option only with caution, when the user is sure that the execution of this option will not cause major misalignments in the configuration of the Assets.

Register as active

By enabling this option, assets imported via MySQL databases will be sent directly to the list of Active Assets, i.e. the registration in Pending Assets will be omitted and they will go directly to monitoring.

Exclude fields

The various import tasks in WOCU-Monitoring have a set of Host attributes ignored by default, during the import or update of the asset configuration profile.

In this field the user can manually edit the fields excluded during the asset check by querying a table in a MySQL database. It is possible to modify the list by adding new fields or deleting some of the preset ones.

Once you have entered the data in the corresponding fields, click on the blue button Add Tasks to save the new Task in the list.


By clicking on the button identified by the i (Information) icon, a new window will appear with help information for the different fields. This action does not make any changes to the configuration.