There are a few 'gotchas' with Variables which are noted below. If you have any issues with Variables, please refer first to this section.
A Variable's value field can only contain 63 characters or less. This is because Opsview Monitor cannot allow the service description to be longer than 128 characters, when combined with the Service Check name. If it is longer, this will fail a reload and the message below will be displayed:
Service description '....' is greater than 128 characters. Please change the attribute or Service Check name to be shorter.
There are restrictions on what characters can be placed within the 'value' field. The value field 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 Check name, which has restrictions on the characters used. Any trailing spaces will be removed. Also, the argument field allows any characters, but be aware that Nagios Core may process some special characters like !, $ and . These special characters must be 'escaped', for example 'Password11!' becomes 'Password11\!', and 'PAS$WORD' becomes 'PAS$$WORD'.
This is the name of the Variable.
Names can only consist of the letters A-Z (upper case only) or an underscore, up to 63 characters.
Some Variables are internally-generated, so it is not necessary to manually add information at the Host edit pages. There are currently three internally-generated variables:
- 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:
Associating a Host to the appropriate Host template will ensure the Service Checks get created correctly.