Opsview Knowledge Center

Host Templates

Introduction to Host Templates in Opsview Monitor

What are Host Templates and How Do They Work?

Host templates are similar to Service Groups in that they allow for the logical grouping of Service Checks into a single container; a 'Host template'.

Unlike with Service Groups, a Service Check can be part of more than one Host template. This means you can create a Host template with Service Checks from one or more Service Groups.

These Host templates can then be applied to one or more Hosts. This means that if you need to apply 10 Service Checks to 1,000 standard hosts, you can create and apply a new Host template containing the 10 Service Checks, to all 1,000 hosts via a single screen.

This means that all Hosts that have the aforementioned Host template applied will inherit the Service Checks set within the template. This allows you to add Service Checks to one Host Template, knowing they will be applied to every host, be it one or 1,000 hosts, that have the Host Template. In the future, if you need to add another five Service Checks to all the hosts, you can simply edit the Host template, add the five Service Checks, and after a reload all Hosts that have the Host Template will have the Service Checks applied.

Host Templates also allow for the addition of icons and management URL's:

  • Icon: Used solely within Business Service Monitoring; the icon uploaded is displayed on the dashboard when a Component is created using the host template.
  • Management URL's: Management URLs are used to put extra entries onto the contextual menus for Hosts using a given template. Examples include SSH, Telnet and more. These management URLs are created in the Host template, and then appear in the contextual menus of Hosts that have the Host template applied.

Adding a New Host Template

The addition, removal and modification of Host templates is all done via the 'Host Template Settings' section of Settings, located on the second tab:

Once within the Host Templates window, you can click on the 'Add New' button in the top left:

Clicking the 'Add New' button will load the modal window as shown below.

Description Tab

The description tab is a very simple one containing only three fields:

  • Name: The name of the Host Template. This is what will be visible within the Host edit window.
  • Description: A friendly, more detailed text field outlining what the Host Template does ' or what Hosts it should be applied to, etc.
  • Hosts: The Hosts who should have this Host template applied. Select from the left box (all) to the right box (selected Hosts).

Note: This should be the tab called 'Description' but for some reason the tab is called 'Host Templates' defect.

Service Checks Tab

The 'Service Checks' tab is where you can choose which service checks are part of the template. This tab is very similar to the tab within the 'host settings' modal window. For information on each field, see Section Configuring a host: 'Service checks tab

From a host template perspective, you should check the service checks you wish to be part of this host template using the tree structure on the left hand side. A counter at the top, i.e. 'All Selected (3)', will display the number of service checks within the host template.

To change the default arguments for the service check, i.e. 'Apache Solr ' System Memory' in the screenshot above, simply check the 'Exception' field ' which will allow the arguments to be edited. These edited arguments will be pushed down to all hosts who have this host template added. Editing the timed exception works on the same basis.

To add an event handler to this service check simply check the 'Event handler' checkbox and complete as required.

Management URLs Tab

The 'Management URLs' tab allows you to add extra entries onto the contextual menus for Hosts using a given template. Examples include SSH, Telnet and more. These management URLs are created in the Host template, and then appear in the contextual menus of Hosts that have the Host template applied.

In the example above, we have created a new management URL called 'Web URL', which will appear as a clickable link in the host contextual menu for any Host that has the template applied. When this link is clicked, it will open up a new browser tab and go to http://ip-of-the-host:8080. The IP or hostname will be populated based on the host, i.e. if the template is applied to a Host with the 'Primary Hostname / IP' of 192.168.0.1, then the contextual menu item 'Web URL' when clicked will navigate to 'http://192.168.0.1:8080'.

Icon Tab

The 'Icon' tab allows for the uploading of a png, jpeg or gif image. The maximum supported file size is 5MB and, after uploading, will be converted to 100x100 40x40 and 20x20 png for previewing. The aspect ratio will be retained and a transparent background will be applied. You may use an image with a transparent background.

To upload an image simply click on 'Browse', find the image file on your computer and click 'OK'. Then finally click 'Upload' and the image will be added.

Renaming a New Host Template

To rename a Host template, simply click on the contextual menu of the Host template and click on 'Edit':

After clicking 'Edit', the modal window will load for the Host Template in question.

Simply modify the name and any other fields required, i.e. description, and click 'Submit Changes'.

Deleting a New Host Template

To delete a Host Template, simply click on the contextual menu of the Host Template and click on 'Edit':

After clicking on 'Delete', a modal window will appear asking you to confirm:

Simply click on 'OK' and the Host template is deleted. If any Hosts were using the Host Template and thus the Service Checks from within the Host template, then those Service Checks will be removed from the Hosts in question.

If the Host Template is being used by a 'BSM Component', then it cannot be deleted until the Component is deleted or is using a different Host template. If you attempt to delete a Host Template that is used by a BSM component, you will see the 'Delete' button is disabled and a tooltip message will appear:

Exporting an Opspack

This section will show you how to export an Opspack from the Host Templates page. For more details on Opspacks, see Opspacks.

How to Export an Opspack:

Click on specific Host Template's contextual menu

Select Export Opspack

Verify your export and click 'Export'

Your browser client will download the Host Template and this can be found in your Downloads folder.

Importing an Opspack

This section will show you how to import an Opspack. This can be done from the Host Templates menu seen below:

An Example of the Host Template Menu

An Example of the Host Template Menu

To import an Opspack begin by selecting the 'Import Opspack' button on the top left of the page.

An Example of the Import Opspacks menu

An Example of the Import Opspacks menu

How to Import Opspack:

Click 'Browse'

Select the Opspack file you wish to import (e.g. application-apache-solr.opspack)

Select 'Upload'

Note: The loader will display either of the follow

Import: A new Opspack file ready to be imported.

Existing: An existing Opspack file ready to be overwritten.

Error: An error has occurred during the upload process

An Example of the Loader

An Example of the Loader

Select 'Import' or 'Overwrite'

Your import of an Opspack has been successfully completed.

Host Templates

Introduction to Host Templates in Opsview Monitor