Ad Widget

Collapse

Remote Commands + Proxy

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mfortes
    Senior Member
    • Oct 2019
    • 416

    #1

    Remote Commands + Proxy


    Friends, My question:
    Remote commands configured in an action, are executed on hosts monitored by proxy? The proxy who executes the commands? And any version, or is it from a specific one...


    Michael R. Fortes

    Linkedin: Mike Fortes
    Medium: mromeiro-f
  • markfree
    Senior Member
    • Apr 2019
    • 868

    #2
    According to Remote Commands doc,

    Remote commands can be executed by Zabbix server, proxy or agent. Remote commands on Zabbix agent can be executed directly by Zabbix server or through Zabbix proxy. Both on Zabbix agent and Zabbix proxy remote commands are disabled by default.
    The way I see it, remote commands can be executed on either Server, Proxy or Agent. That will depend on where you're trying to execute an action.

    Comment

    • mfortes
      Senior Member
      • Oct 2019
      • 416

      #3
      I want to run the command on the final host, a windows for example... Monitored via proxy...
      Today when I try to run a remote command, Zabbix is ​​ignoring the proxy and trying to run the command directly from Zabbix Server... But it needs to go through the proxy to see the host


      Michael R. Fortes

      Linkedin: Mike Fortes
      Medium: mromeiro-f

      Comment

      • markfree
        Senior Member
        • Apr 2019
        • 868

        #4
        Have you enabled agent's remote command?
        They can be enabled by:
        • adding an AllowKey=system.run parameter in agent configuration;
        • setting the EnableRemoteCommands parameter to '1' in proxy configuration

        Did you set up the action with "Execute on Zabbix agent"?
        Click image for larger version

Name:	zabbix_action.PNG
Views:	2921
Size:	7.7 KB
ID:	427154

        Comment

        • mfortes
          Senior Member
          • Oct 2019
          • 416

          #5
          Yeah... but i dont have "Zabbix Server (Proxy)"...

          Which version has this option?



          Michael R. Fortes

          Linkedin: Mike Fortes
          Medium: mromeiro-f

          Comment

          • markfree
            Senior Member
            • Apr 2019
            • 868

            #6
            The screenshot above was taken from a 4.4 server.
            But I see what you mean.

            Looking at a 5.4 server, my "operation" tab from "Actions" configuration does not show any "remote command" option. It is locked at "send message".
            For me, the only operation available for "trigger actions" is "Send message", wich is quite odd.
            Click image for larger version

Name:	send_message_operation.PNG
Views:	2868
Size:	6.0 KB
ID:	427162
            I only noticed that now.

            According to Operations documentation, it should have "remote command" operation.
            You can define the following operations for all events:
            send a message
            execute a remote command

            Comment

            • markfree
              Senior Member
              • Apr 2019
              • 868

              #7
              I found the reason why my "operation" was limited.

              Operations doc says
              <remote command name> - execute a remote command. Commands are available for execution if previously defined in global scripts with Action operation selected as its scope.
              So, it seems remote commands are available through "scripts" configuration under "administration".

              You must configure a script setting its scope as "action operation" and its type as "script", which then shows "execute on" option.
              Click image for larger version

Name:	script_options.PNG
Views:	2888
Size:	15.5 KB
ID:	427164

              After that, your new script should appear at "operation" box under "operation details".
              Click image for larger version

Name:	operation_details.PNG
Views:	2879
Size:	29.2 KB
ID:	427165

              Please, see if that helps you.

              Comment

              • mfortes
                Senior Member
                • Oct 2019
                • 416

                #8
                My Zabbix Server is too old... I dont have any of this options...
                Thanks 4 the help <3


                Michael R. Fortes

                Linkedin: Mike Fortes
                Medium: mromeiro-f

                Comment


                • markfree
                  markfree commented
                  Editing a comment
                  What's your server version?
              • mfortes
                Senior Member
                • Oct 2019
                • 416

                #9
                3.2.11 at this moment


                Michael R. Fortes

                Linkedin: Mike Fortes
                Medium: mromeiro-f

                Comment

                • markfree
                  Senior Member
                  • Apr 2019
                  • 868

                  #10
                  According to Remote commands documentation version 3.2,
                  Remote commands are not supported to be executed on Zabbix agents monitored by Zabbix proxy, so for commands from Zabbix server to agent a direct connection is required.
                  I would suggest upgrading the server.

                  Comment

                  Working...