Welcome to docs.opsview.com


Attributes are an advanced feature in Opsview. You can assign 1 or many attributes to a host.

You can also set service checks to use the attributes for a host to then create multiple services for monitoring. For example, if you have host A with 3 URL attributes:

  • /about
  • /login
  • /logout

And you create a service check, called “Website page check” that uses the URL attribute to create multiple services, then for each host that has this service check associated will create X number of services. So for host A, there will be 3 services created:

  • Website page check: /about
  • Website page check: /login
  • Website page check: /logout

You can access these attributes in the Host Macro section when defining a service check. For instance, entering %URL% will return the first URL attribute for a host. If an attribute is not associated with a host, then a blank string is returned.

How It Works

  • A service check will have the multiple services option set with an attribute set
  • When the Nagios® Core configuration is generated, there will be X number of services created, based on the number of attributes
  • If no attributes are defined for the particular host, no services will be generated
  • Host attribute macros, of the form %NAME% will be substituted in the arguments field
  • A macro of the form %NAME:1% will substitute with the values of the Arg1 field for the host macro


  • You can change the arguments for a service check using the host attributes, but you cannot change other service check information like check interval, servicegroup, etc. This would require a different servicecheck altogether
  • You cannot say “use these 3 out of the 5 DISK variables set” - it is all or nothing. You could create two attributes, DISK_LOW and DISK_HIGH, instead, with two different service checks referencing these host attributes
  • You can only have at most 1 host attribute in a service check definition. This is the one that will be iterated around. If you have other attributes and the attribute is not defined for the host, then it will be blank. If there are many attributes assigned, the 'first' one (based alphabetically) will be used
  • You cannot have the service description longer than 128 characters, when combined with the service check name. If you do, this will fail a reload and you will get this message:
Service description '....' is greater than 128 characters. Please change the attribute or service check name to be shorter
  • The attribute can only consist of alphanumeric characters, space, a period (”.”), a forward slash (”/”) or a dash (”-”), up to 63 characters - this is because the value could be used in the service name, which has restrictions on the characters used. Any trailing spaces will be removed. The argument field allows any characters, but be aware that Nagios Core may process some special characters like !, $ and \.


This is the name of the attribute.

Names can only consist of the letters A-Z (upper case only) or an underscore, up to 63 characters.

Note: that if you change it here, any currently defined service checks expecting the old name in the arguments (such as %DISK%) will return an empty string instead.

Default Value

Available from Opsview 3.9.0.

This value is used if a host does not have an attribute associated. This is effectively a global attribute that you can override on a host basis.

The value cannot be longer than 63 characters and must be alphanumerics. This is because it could be used for multiple service checks and there are restrictions to the characters here.

Default Arguments

These are the default arguments if a host specific attribute does not exist.

Note: These are not default argument values for host specific attributes - these are arguments for the default attribute if there is no host specific one. See example below.


Assume an attribute of MYSQL_CREDENTIALS has a default value of Default and a default arg1 of mysqlusername and default arg2 of mysqlpassword.

Assume also there is a service check called Mysql login which has arguments of -u %MYSQL_CREDENTIALS:1% -p %MYSQL_CREDENTIALS:2%

Host1 has no attributes for MYSQL_CREDENTIALS.

Host2 has 1 host attribute for MYSQL_CREDENTIALS with value=mysqlhost2, arg1=host2user and arg2=host2password.

Host3 has 1 host attribute for MYSQL_CREDENTIALS with value=mysqlhost3, arg1=host3user and no arg2.

Opsview would generate:

  • Host1, Mysql Login - with an argument of -u mysqlusername -p mysqlpassword
  • Host2, Mysql Login - with an argument of -u host2user -p host2password
  • Host3, Mysql Login - with an argument of -u host3user -p

Note that there is no password for Host3. This is because the arg2 for the host attribute on host3 has no arg2 (and arg2 is not inherited from the default arg2).

Internally Generated Attributes

Some attributes are internally generated, so it is not necessary to manually add information at the host edit pages. There are currently 3 internally generated attributes:

  • INTERFACE - based on the snmp interfaces stored from a query host call
  • SLAVENODE - returns a list of all slave nodes
  • CLUSTERNODE - returns a list of all other cluster nodes within a slave environment

Note however, that you still need to associate the relevant service checks to the host. In the initial database, these templates can be used:

Host Template Service check Description
SNMP MIB-II Interface Monitors bandwidth of the specific interface from the query host list
Opsview Master Slave-node Monitors each slave for connectivity
Opsview Common Cluster-node Monitors each other node in a slave cluster

Associating a host to the appropriate host template will ensure the service checks get created correctly.


URL's as attributes

Since the main value of an attribute cannot contain certain charactes (colon, comma, question mark), to use an URL as an attribute requires the use of attribute arguments

To do this, on the Settings→Attributes list page,

  • Create a new attribute and set the value to be URL (or similar)

and on the Host edit page Attributes tab,

  • Use the attribute just created (in this case URL)
  • Click on the 'eye' icon to expand the arguments fields
  • Set Arg1 to be the URL you require, e.g. https://docs.opsview.com

and finally,

  • In the Servicecheck arguments for the check use the macro %URL:1 to refer to the URL