Welcome to docs.opsview.com

Importing your Opsview Configuration from an Excel Spreadsheet

This is designed to help with the following scenarios:

  • You are migrating from another system which is not supported by an Opsview migration tool
  • You have an asset tracking or CMDB tool with the required information
  • You have an existing spreadsheet detailing your IT infrastructure
  • You wish to perform a bulk import of your host configuration into Opsview

Spreadsheet Compatibility

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.

Planning your migration

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

Using the Migration Tool

Locate the Excel spreadsheet at /usr/local/nagios/installer/import_excel.xls. Instructions are on the first worksheet.

When the spreadsheet has been updated, it must be copied to a suitable location on the Opsview master server. Then run the following command as the 'nagios' user:

/usr/local/nagios/bin/import_excel -y -o /tmp/results.xls /tmp/updatedimport.xls

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

Troubleshooting

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 /usr/local/nagios/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

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

{field}: Invalid

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

No related object for {field} '{info}'

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

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

The host is missing a name field

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

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

Spreadsheet field information

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

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

  • 'Update' - Opsview will be updated with the remaining data in the row.
  • A blank cell - the row will be ignored by the import process.

'Host' column

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

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

This column specifies the Opsview 'Primary hostname/IP address' field value, as detailed here. Acceptable cell values are:

  • Any alpha-numeric characters, forming a string value.
  • Numberic characters and 'period' characters, separating the IP address octets.

'Other addresses' column

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

  • Any alpha-numeric characters, forming a string value.
  • Numberic characters and 'period' characters, separating the IP address octets.
  • Commas separating the above.

'Monitored by' column

This column specifies which monitoring server this host will be monitored by, assuming you have more servers than the one master server. For more information, refer to monitored by.

Acceptable cell values are:

  • Any alpha-numeric string which matches the unique Nagios® Core name of an existing monitoring server.

'Description' column

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

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

  • Any alpha-numeric characters, forming string values that are existing Nagios Core hostnames
  • Commas separating the above
  • Empty cell - this means do not change any values
  • NONE - this means to remove all parents (available in Opsview 3.9.0)

'Host group' column

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:

  • Any alpha-numeric characters, forming a string that is an existing host group name.

'Host check command' column

This column specifies the command that will be run to check the status of the host - see here. Acceptable values are:

  • Any alpha-numeric characters, forming a string that is the name of an existing host check command
  • NULL, which means to set no check command (assumes the host is always UP)

'Icon' column

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.

Acceptable values are:

  • Any alpha-numeric characters and special characters, forming a string that is the name of an existing host check command - e.g. “SYMBOL - Switch”.

'Keywords' column

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.

Acceptable values are:

  • Any alpha-numeric characters, forming an individual keyword
  • Commas, which are used to delimit individual keywords
  • Empty cell - this means do not change any values
  • NONE - this means to remove all keywords (available in Opsview 3.9.0)

'Notification options' column

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:

  • 'n' - no notifications.
  • 'u' - unreachable.
  • 'd' - down.
  • 'r' - recovery.
  • 'f' - flapping.
  • 's' - scheduled downtime.
  • Commas, which are used to delimit notification events.

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

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 '24×7'.

'Re-notification interval' column

This column is used to specify the frequency (in minutes) of how often alert notifications are resent if the host status is not handled.

Acceptable values are:

  • A positive integer.
  • A zero value to disable the re-notification feature.

'Check period' column

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 '24×7'.

'Check interval' column

This column is used to specify the frequency (in minutes) of how often the host status is checked.

Acceptable values are:

  • A positive integer.
  • A zero value that means “check only on demand”.

'Maximum check attempts' column

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.

'Retry interval' column

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.

'Host templates' column

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.

Acceptable values are:

  • Any alpha-numeric characters, forming a string that is an existing host template name
  • Commas to delimit the host template names
  • Empty cell - this means do not change any values
  • NONE - this means to remove all host templates (available in Opsview 3.9.0)

'Enable SNMP' column

Available from Opsview 3.9.0.

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

  • 1 - to enable SNMP
  • 0 or an empty cell - to disable SNMP

'SNMP version' column

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

  • '1'
  • '2c'
  • '3'

'SNMP community' column

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

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

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:

  • 'md5'
  • 'sha'

'SNMP auth password' column

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

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:

  • 'des'
  • 'aes'
  • 'aes128'

'SNMP priv password' column

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

  • Any alpha-numeric or special characters forming the password string.
  • An empty cell for no password.

'Use MRTG' column

Available from Opsview 3.9.0.

This column specifies whether or not to use MRTG interface polling. Acceptable values are:

  • 1 - to enable MRTG
  • 0 - to not use MRTG

'Use NMIS' column

This column specifies whether or not to use NMIS interface polling. Acceptable values are:

  • 1 - to enable NMIS
  • 0 - to not use NMIS

'NMIS node type' column

If NMIS is enabled, this column specifies what the host type is. Acceptable values are one of the following:

  • 'router'
  • 'switch'
  • 'server'

'Service checks' column

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

  • Any alpha-numeric characters, forming a string that is the name of an existing service check
  • Commas delimiting each service check name
  • Empty cell - this means do not change any values
  • NONE - this means to remove all service checks (available in Opsview 3.9.0)

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.

'Excluded service checks' column

Note: This column is not available from Opsview 3.9.0.

This column specifies the names of service checks that are to be excluded from host templates that are based upon this host. Acceptable values are:

  • Any alpha-numeric characters, forming a string that is the name of an existing service check
  • Commas delimiting each service check name
  • Empty cell - this means do not change any values

'Import status' column

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

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.

Navigation
Print/export
Toolbox