Ad Widget

Collapse

Execute script from the agent and give back result to server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Halloween_BE
    Junior Member
    • Oct 2019
    • 26

    #1

    Execute script from the agent and give back result to server

    Hello,
    I have written a small bash script for sending back OS version, kernel version and architecture in one string. I would like to execute this script (located on all my Linux hosts) but I don't know how to do.
    Thanks in advance for your replies.
    Regards
  • Halloween_BE
    Junior Member
    • Oct 2019
    • 26

    #2
    Ok, I found system.run but I have to enable RemoteCommands on the agent. I would like to be sure it’s safe ?
    is Zabbix Server the only ip authorised to send commands?

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #3
      If you don't want to run an unexpected command, you should not enable remote commands. Consider using the UserParameter setting if you have decided which commands to execute in advance.
      Zabbix agent accepts requests from the server set in Server. If the remote command is valid, there is a possibility that the server on which Zabbix agent is installed can be attacked using Zabbix server as a springboard.

      Comment

      • Halloween_BE
        Junior Member
        • Oct 2019
        • 26

        #4
        Thanks for your reply.
        I will try the UserParameter then.
        What are RemoteCommands used for then ? It’s quite dangerous.
        Last question, do you have a recommendation where to place the scripts on the monitored machine?
        /root is not accessible to everyone and /etc/zabbix is maybe not the best place...
        I tried /var/run/zabbix but its seems not to be a good idea under Ubuntu.
        regards.

        Comment

        • Halloween_BE
          Junior Member
          • Oct 2019
          • 26

          #5
          Thanks I did it with User Parameters and it's working well. I will not use Remote command for the moment.

          Comment

          • 1berto
            Senior Member
            • Sep 2018
            • 182

            #6
            If you don't want the agent to run unexpected commands, don't give access to those commands to the agent.
            Per definition only the server(s)/proxy(ies) specified on the Server/ServerActive clause can send commands to agent, so the security is in the name/ip level.
            You can encrypt the traffic between agent/server increasing security.

            Comment

            Working...