Ad Widget

Collapse

Running scripts (when clicked on hosts)on Different Servers instead of zabbix server.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbixfk
    Senior Member
    • Jun 2013
    • 256

    #1

    Running scripts (when clicked on hosts)on Different Servers instead of zabbix server.

    Hello All,

    Is there any way to trigger scripts ( Administration-> Scripts ) from different server say proxy server instead of zabbix server/agent?

    The reason for this question was, i have a proxy server for which some range of hosts are connecting, and i wanted to run traceroute to hosts from proxy server. As of now i don't see any option to sepcify the same.



    Any pointers are greatly helpful.

    Thanks
  • dan_cytexone
    Member
    • Dec 2008
    • 61

    #2
    Is it possible to run Custom scripts to manage hosts via proxies?

    If so how do you do this?

    Comment

    • Firm
      Senior Member
      • Dec 2009
      • 342

      #3
      {PROXY.NAME} macro is supported in "Trigger-based notifications and commands". So you can provide it to server script which may execute remote command on proxy via ssh.

      Comment

      • dan_cytexone
        Member
        • Dec 2008
        • 61

        #4
        Originally posted by Firm
        {PROXY.NAME} macro is supported in "Trigger-based notifications and commands". So you can provide it to server script which may execute remote command on proxy via ssh.
        Can you please give a specific example on how to do this? ie Where to place {proxy.name} and perhaps an example screenshot or syntax?

        Thank you so much for your help

        Comment

        • Firm
          Senior Member
          • Dec 2009
          • 342

          #5
          "Commands" field should looks like this:

          Code:
          ssh {PROXY.NAME} traceroute {HOST.CONN}
          Of course, you have to configure public key access under zabbix user to proxy host.

          Comment

          • dan_cytexone
            Member
            • Dec 2008
            • 61

            #6
            Originally posted by Firm
            "Commands" field should looks like this:

            Code:
            ssh {PROXY.NAME} traceroute {HOST.CONN}
            Of course, you have to configure public key access under zabbix user to proxy host.
            Can you explain what you mean by public key access? I just tested this with a super admin and please see error below

            Command :

            ssh {PROXY.NAME} /bin/ping -c 3 {HOST.CONN} 2>&1

            Error Received :

            ssh: Could not resolve hostname {proxy.name}: Name or service not known

            Comment

            • dan_cytexone
              Member
              • Dec 2008
              • 61

              #7
              Hi Firm

              Wanted to follow up to see if you knew how to solve this?

              Thanks!

              Dan

              Comment

              • Firm
                Senior Member
                • Dec 2009
                • 342

                #8
                It seems that {PROXY.NAME} is not populated if script is running on server side. Need to investigate further.

                Comment

                • dan_cytexone
                  Member
                  • Dec 2008
                  • 61

                  #9
                  Thanks, please let me know or if anyone else has any suggestions.

                  Comment

                  • dan_cytexone
                    Member
                    • Dec 2008
                    • 61

                    #10
                    Seems like {PROXY.NAME} doesn't work anywhere in the system.

                    Comment

                    • dan_cytexone
                      Member
                      • Dec 2008
                      • 61

                      #11
                      Rebump on this message

                      Comment

                      Working...