Ad Widget

Collapse

Is it possible to use discovery values in remote command

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zouli
    Junior Member
    • May 2017
    • 2

    #1

    Is it possible to use discovery values in remote command

    I have a discovery rule to discovery all virtual machines on a KVM host. The discovered virtual machines are stored in macro {#DOMAINNAME}.

    I can monitor those virtual machines status, and see triggered alarm when any virtual machine not in running state.

    Now, what I want is to execute remote command on host, like "sudo virsh start {#DOMAINNAME}" to bring virtual machine back to active state when the vm is non-active. While it seems the remote command does not recognize macro.

    Can anybody help on this?

    Thanks very much!
    Anthony
  • ovas
    Senior Member
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Apr 2017
    • 138

    #2
    Hello zouli!

    Macros with # sign are only used withing the low level discovery process. They are not usable in other areas.
    Can you please try to substitute {#DOMAINNAME} macro with the following one: {HOST.IP}? What will happen?
    If it does not work, how is this command called - external script? frontend script, SSH check?

    Comment

    • zouli
      Junior Member
      • May 2017
      • 2

      #3
      system macro can work in actions

      Hi OVAS,

      Thanks for your reply. I have checked that system macros {HOST.IP} {HOST.NAME} can work in actions. So the problem is how the macro in LLD can be used in actions.

      Do you have any idea?

      Comment

      • ovas
        Senior Member
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Apr 2017
        • 138

        #4
        If I understand your question correctly, you are asking if it is possible to use LLD macro in actions. I don't see how it is possible, LLD macro is operational only within LLD. Here is the list of supported locations for LLD macros: https://www.zabbix.com/documentation...ros/lld_macros

        Comment

        Working...