Ad Widget

Collapse

using macros in Executed script

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nikita_lnx
    Junior Member
    • Jun 2022
    • 10

    #1

    using macros in Executed script

    Hello! I need some help with issue.
    I've created a template with some macro and Item
    ​​
    ​​
    Then I try to use it with host (template was attached to this host). But it is not working
    ​​
    Is it possible to use macro like in my example {$WEBSITENAME} in Exectudet script via SSH by Template?
    Without macro if I put any website it works fine.
    Thank you!
  • Answer selected by nikita_lnx at 16-11-2022, 16:36.
    cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    You should be able to use "user macros" in ssh script..

    Items / item prototypes
    In an item or an item prototype configuration, user macros can be used in the following fields:
    SSH agent:
    Username
    Public key file
    Private key file
    Password
    Script​​

    Comment

    • cyber
      Senior Member
      Zabbix Certified SpecialistZabbix Certified Professional
      • Dec 2006
      • 4807

      #2
      You should be able to use "user macros" in ssh script..

      Items / item prototypes
      In an item or an item prototype configuration, user macros can be used in the following fields:
      SSH agent:
      Username
      Public key file
      Private key file
      Password
      Script​​

      Comment

      • nikita_lnx
        Junior Member
        • Jun 2022
        • 10

        #3
        Thank you for your help! Now it's working
        For other users:
        Go to Admiistration - General - Macros and set the Macro value there instead of template level
        Click image for larger version

Name:	image.png
Views:	590
Size:	18.6 KB
ID:	454423

        Comment

        • cyber
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Dec 2006
          • 4807

          #4
          Setting global macros just makes them available for everyone and everywhere. In my mind this should be avoided You can set them in template or even on host level.

          Comment

          Working...