Results 1 to 3 of 3

Thread: Using two $VCENTER$ alias on my configuration

  1. #1

    Using two $VCENTER$ alias on my configuration

    hi, i have another (little) problem ...

    what is the best solution for using two (or more) $VCENTER$ variables on my configuration ? Duplicate VMware Esxi template and adding a $VCENTER2$ ?


    Or there's a solution for overload $VCENTER$ variable from ressource.cfg directly on my HOST définition ?

    Thanks everyone.

  2. #2
    Administrator
    Join Date
    Jun 2011
    Posts
    216

    Re: Using two $VCENTER$ alias on my configuration

    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
    }

  3. #3

    Re: Using two $VCENTER$ alias on my configuration

    perfect ...it's a quick and smart solution ! Thanks !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •