It is often the case that hosts on your network will be similar, but differ in subtle ways depending on their exact purpose. For example some servers may have two internal disks whilst some may have just one, and some servers may have multiple ethernet cards where others do not. Opsview provides attributes to deal with situations like this, as they are a way of associating metadata with a host - here is an example of how to configure Opsview to use them.

Let's assume we have a Linux host that has three ethernet cards - eth0, eth1 and eth2. Rather than create three service checks which reference these interfaces explicitly, we'll configure a single Interface Throughput check that will be duplicated for each network card that a host has.

1. Create the attribute

First we'll create an attribute called "NIC" so that we can store this metadata against the host. Go to Advanced -> Attributes -> Actions -> Create new attribute and enter a name of NIC, then save it.


2. Define the attribute for one or more hosts

Now that the attribute is known to the system, it can be applied to some hosts. In this example, we edit the Linux host, and under the "Attributes" tab, add three entries all with a label of NIC, with the values eth0, eth1 and eth2.


3. Create a service check which uses the attribute

Now that we have some metadata about the host, we can create a service check that uses it. The screenshot shows the configured service check - the "Multiple" prefix indicates that we have selected "NIC" as the value for Create Multiple Services under the Advanced section of the check configuration, and so at reload time Opsview will create three service checks, replacing %NIC% with each of the three values.

4. Apply the new check to the host

The check can either be applied directly on the Monitors tab of the host configuration, or using a Host Template. Once the check has been applied, reload Opsview and navigate to the host status. You should now see three services, one for each ethernet card that you have defined for the host.


5. Apply to more hosts

This new service check can now be applied to any number of hosts you wish, and you simply need to define as many NIC attributes as you need for that particular host. This example really just scratches the surface of how host attributes can help you better organise your server monitoring. You can find out more about attributes on our documentation site and try it out for yourself by downloading Opsview Community Edition.

About the Author

Neil Ferguson is Technical Manager at Opsview. Neil has been working with Opsview since the project began in 2006 and has carried out most of the largest installations in the UK, US and Europe. Neil has a weatlh of knowledge of working with network infrastructure and is also an experienced Linux/UNIX sysadmin.