Ad Widget

Collapse

Remote command not executed on agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Manish
    Junior Member
    • Jan 2016
    • 27

    #1

    Remote command not executed on agent

    Hello there,

    I have problem with remote command. I created action if disk in critical state then make log file zero byte. On event it shows command executed but actually its not disk still in problem state. I had to log in on to the server and truncate file to zero byte. I wonder why this happned? I given sudo permission to zabbix user for truncate command as well.

    Here is summary:

    Action condition: Trigger value = PROBLEM and Trigger = Template xxx: / Disk Critical.

    Operation command: truncate -s 0 /path/to/file.
  • Atsushi
    Senior Member
    • Aug 2013
    • 2028

    #2
    Are you set to remote command execution allowed by the setting of the agent?

    ex. zabbix_agentd.conf
    Code:
    EnableRemoteCommands=1
    User zabbix has write access to the file?

    Comment

    • Manish
      Junior Member
      • Jan 2016
      • 27

      #3
      Yes, I already set it to 1. Does zabbix user need write access to log file?

      Comment

      • Atsushi
        Senior Member
        • Aug 2013
        • 2028

        #4
        By default, the agent has been started by zabbix user.

        Thus, the remote command is executed by zabbix user.
        If there is no write permission, truncate can not be run on the file.

        If you do not want to change the permissions of the file, please try to use sudo.

        Comment

        • Manish
          Junior Member
          • Jan 2016
          • 27

          #5
          Hi Thanks.

          I used sudo and its working now. However I have another problem. I am using zabbix version 2.4.7 and I set above condition to delete old logs. I want to use this command on several host, so in target section of operations I selected all the host where I want to execute this command.

          But problem is when only one host have problem command executed on all other host and delete its log. So do I want to set action for each and every host separatly?

          Comment

          • Atsushi
            Senior Member
            • Aug 2013
            • 2028

            #6
            Please try select target "Current host" only.

            Comment

            Working...