Hi,
Actually when you define a Macro (variable) in your host definition you will need to use the _HOST for accessing it.
For example in the ssh packs you have :
Code:
define host{
name ssh
use generic-host
register 0
_SSHPORT 22
}
define command {
command_name check_ssh
command_line $PLUGINSDIR$/check_ssh -p $_HOSTSSHPORT$ $HOSTADDRESS$
}
In my opinion, the best solution is to do the same here. Do not use the $VCENTER$ in the command but the $_HOSTVCENTER$ one. Then you can define the name in a "sub" template.
Code:
define host{
name vmware-vm
use generic-host
register 0
}
define host{
name vcenter-one
use vmware-vm
register 0
_VCENTER vecenter-one
}
define host{
name vcenter-two
use vmware-vm
register 0
_VCENTER vecenter-two
}