Ad Widget

Collapse

Howto add host name of "discovering" host to LLD host prototypes?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aschild
    Junior Member
    • Sep 2014
    • 25

    #1

    Howto add host name of "discovering" host to LLD host prototypes?

    I'm trying to convert my hyper-v monitoring templates and scripts to work without any installing scripts on the hyper-v servers.


    For this, I can get the list of VM on the Hyper-V host via the
    Code:
    perf_instance_en.discovery["Hyper-V VM Vid Partition"]
    key.
    This then returns a json structure, just fine to create hosts.

    Code:
    [{"{#INSTANCE}":"_Total"},{"{#INSTANCE}":"sv03"},{"{#INSTANCE}":"sv04"}]
    With a filter to take out the _Total values I get the remaining sv03 and sv04 values to use it a name prototypes.
    The name of the host prototypes is then: {#INSTANCE}

    This works fine and it creates two new hosts sv03 and sv04 in Zabbix.
    But unfortunally this is not good enough, since we need to have the name of the hyper-v host included somewhere in the new hosts names.

    So basically if the Hyper-V host is named: HYPERV01, then I wish to have the VM hosts named HYPERV01_sv03 and HYPERV01_sv04

    But adding {HOST.NAME}_{#INSTANCE} does not work, as the {HOST.NAME} seems to be unknown inside the discovery run.

    Any ideas how to get the host name of the Hyper-V server present inside the discovery process?
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4806

    #2
    in discovery you can use LLD macros, this means, that you need to obtain that info in your initial script and add that LLD macro. How.. I have no idea...

    I really do not want to downplay your efforts in building your own, but there is out of th box vmware monitoring, why build it again? It would be simple thing to use "{#HV.NAME}_{#VM.NAME}" there as hostname..THeres so many LLD-s to use .. https://www.zabbix.com/documentation...scovery_fields

    Comment

    • aschild
      Junior Member
      • Sep 2014
      • 25

      #3
      Hyper-V is the Microsoft Hypervisor, so the vmware monitoring isn't helping here.
      I don't think there is way to chain two agent calls in one lld, correct?

      Comment

      Working...