Host migrations via spreadsheet

This process covers importing your Opsview Monitor configuration from an Excel spreadsheet and is designed to help with the following scenarios:

Note

This process only supports ASCII characters. For more comprehensive Unicode support, use the REST API.

Spreadsheet compatibility Copied

The importer tool reads Excel format files using Spreadsheet-ParseExcel. This reads Excel 95 - 2003 binary files. It has been tested with spreadsheets edited in Mac Office Excel 2008 and Open Office 3 - please see that link to see the currently supported spreadsheets.

Planning your migration Copied

Only hosts will be affected. Other related items - such as service checks, host templates, host groups - should already be defined.

Using the Migration Tool Copied

Locate and download the Excel spreadsheet at /opt/opsview/coreutils/installer/import_excel.xls. Instructions are held within sheet 1.

When the spreadsheet (referenced below as /tmp/updatedimport.xls) has been updated, it must be copied to a suitable location on the Opsview master server. Then run the following command as the ‘opsview’ user:

/opt/opsview/coreutils/bin/import_excel -y -o /tmp/results.xls /tmp/updatedimport.xls

The results.xls file will have information about success or failures.

Troubleshooting Copied

If you run without the -y flag, then the spreadsheet is read, but no changes are made to the database.

If you want more debug information, you can set the following in /opt/opsview/coreutils/etc/Log4perl.conf:

log4perl.logger.import_excel=DEBUG

This will show the data from the spreadsheet that is passed through to the host synchronisation method. If you think you have found a problem in how the data is read, you can take the output from here and contact us for support.

Import comments Copied

If the import has failed, there will be comments next to each row in the results spreadsheet. These are the possible errors.

Invalid field Copied

The field failed a validation constraint. There could be invalid characters or incorrect lengths in the data.

When trying to search for a related object (such as a host group, a host icon, service checks or time periods), could not find the object based on the search. Check in the web user interface if the related object exists.

Host group is not a leaf Copied

In Opsview, a host can only belong to one host group and that host group must be a leaf host group. Click on the Configuration-> Host Groups link on the left hand navigation to see the list of leaf host groups that can be used for importing.

No name specified Copied

The host is missing a name field

Service check {name} is listed in service checks and excluded service checks Copied

You cannot have the same service check listed in both columns.

Spreadsheet field information Copied

This section of the documentation will detail the spreadsheet format and the acceptable values for each column.

The second worksheet in the import_excel.xls contains the data that will be imported into Opsview and each row in this worksheet should map to an individual host in Opsview.

For the columns whose headers are highlighted in orange, the values in each row will be updated as part of the import process. For the remaining columns, the fields in the rows will be left unaltered.

Note that the column header names are read by the import process and should not be changed.

Action column Copied

This column dictates the action to be performed for the row of data in the worksheet. Acceptable cell values are:

Host column Copied

This column contains the unique Opsview host name, as described Hosts documentation.

If the named host already exists in Opsview, then the existing host will be updated in the Opsview configuration. If it does not already exist, then the host will be created within Opsview. Acceptable cell values are any alpha-numeric characters.

Hostname or IP column Copied

This column specifies the Opsview ‘Primary hostname/IP address’ field value, as detailed Hosts documentation. Acceptable cell values are:

Other addresses column Copied

This column specifies the Opsview ‘Other hostnames/IP addresses’ field value, as detailed Hosts documentation. The list of hostnames/IP addresses should be comma delimited. Acceptable cell values are:

Monitored by column Copied

This column should be left blank.

Description column Copied

This column can be used to specify a description of the host. Acceptable cell values are any alpha-numeric characters and ‘special’ characters.

Parents column Copied

This column specifies the host ‘parents’ field value, as detailed Hosts documentation. The list of parent names should be comma delimited. Acceptable cell values are:

Host group column Copied

This column specifies the name of the host group that this host is a member of. Note that the host group must already exist in Opsview and that the host group must also be a ’leaf’ host group - i.e. it is at the bottom level of the host groups tree. Acceptable cell values are:

Host check command column Copied

This column specifies the command that will be run to check the status of the host. For more information, see Hosts documentation. Acceptable values are:

Icon column Copied

This column specifies the name of an icon that will be used to pictorially represent the host within Opsview. The icon can either be an icon file included with Opsview, or a custom icon file that has been added to Opsview. For more information, see Hosts documentation.

Acceptable values are:

Keywords column Copied

This column is used to specify keywords) that will be assigned to the Opsview host. Each keyword should be comma delimited and if the keyword does not already exist within Opsview, it will be created automatically. For more information, see Hosts documentation.

Acceptable values are:

Notification options column Copied

This column is used to specify which events that the host sends an alert notification for. Where it legal to provide more than one notification event type, the types should be comma delimited.

Acceptable values are:

Note

If ’n’ for ’no notifications’ is specified, then no other values should be specified in the spreadsheet for the row concerned.

Notification period column Copied

This column is used to specify the time period in which alert notifications will be sent to Opsview contacts. The value in this column should be the name of a time period that has already been configured within Opsview, such as ‘24x7’. For more information, see Hosts documentation.

Re-notification interval column Copied

This column is used to specify the frequency (in minutes) of how often alert notifications are resend if the host status is not handled. For more information, see Hosts documentation.

Acceptable values are:

Check period column Copied

This column is used to specify time periods when the host status is checked. The value in this column should be the name of a time period that has already been configured within Opsview, such as ‘24x7’. For more information, see Hosts documentation.

Check interval column Copied

This column is used to specify the frequency (in minutes) of how often the host status is checked. For more information, see Hosts documentation.

Acceptable values are:

Maximum check attempts column Copied

This column is used to specify how many times a check must fail before it changes to a hard state. Acceptable values are any non-zero, positive integer. For more information, see Hosts documentation.

Retry interval column Copied

This column is used to specify how often a check is performed when the host is in a soft failure state. Acceptable values are any non-zero, positive integer. For more information, see Hosts documentation.

Host templates column Copied

This column is used to specify the names of host templates that the current host will include, delimited by commas. The host templates must already be defined within Opsview. For more information, see Hosts documentation.

Acceptable values are:

Enable SNMP column Copied

This column specifies whether or not to enable SNMP. Acceptable values are:

SNMP version column Copied

This column is used to specify the SNMP version. Acceptable values are one of the following:

SNMP community column Copied

This column specifies the SNMP community string for the host when configuring an SNMP agent. A value in this column is only required if the host is using SNMP versions 1 or 2c.

Acceptable values are any alpha-numeric characters forming the string.

SNMP username column Copied

This column specifies the SNMP username for the host when configuring an SNMP agent. A value in this column is only required if the host is using SNMP version 3.

Acceptable values are any alpha-numeric characters forming the string.

SNMP auth protocol column Copied

This column is used to specify the SNMP authorisation protocol and is only required when using SNMP version 3. Acceptable values are one of the following:

SNMP auth password column Copied

This column specifies the SNMP authorisation password and is only required if the host is using SNMP version 3.

Acceptable values are any alpha-numeric characters forming the string.

SNMP priv protocol column Copied

This column is used to specify the SNMP privacy protocol and is only required when using SNMP version 3. Acceptable values are one of the following:

And additionally, only fully supported on some operating systems:

For more information, see SNMP Privacy Protocol Support.

SNMP priv password column Copied

This column optionally specifies the SNMP privacy password and is only required if the host is using SNMP version 3. Acceptable values are:

Service checks column Copied

This column specifies the names of service checks that will be included (monitored by) this host. Acceptable values are:

Warning

If you have any exceptions, timed exceptions or event handlers enabled for a specific service check, these will be removed when importing. This is because it is not possible to encode the additional information required for these attributes within the limitations of a spreadsheet. See the REST API for an alternative way of doing imports that can preserve the integrity of existing data.

Import status column Copied

The contents of this column should not be modified by the user. After the import process is run, this column will contain the success or failure status for each row.

Import comments column Copied

The contents of this column should not be modified by the user. If the import process has failed, this column will contain details of the failure for each row.

["Opsview On-premises"] ["User Guide", "Technical Reference"]

Was this topic helpful?