Alert script is not working - home&user permissions

XMLWordPrintable

    • Type: Incident report
    • Resolution: Won't fix
    • Priority: Major
    • None
    • Affects Version/s: 2.2.6
    • Component/s: Server (S)
    • None
    • Environment:
      Centos 6.5
      Zabbix installed via yum from repo.zabbix.com

      After add media type with own script i had problem with delivery messages to my communicator. So i tried to debug it and found where is problem:
      Zabbix-server run as system user zabbix:
      zabbix 21573 0.0 0.1 165016 3704 ? S 14:04 0:00 zabbix_server -c /etc/zabbix/zabbix_server.conf

      when i add to my script lines:
      echo ~ > /tmp/home.log
      echo `id` > /tmp/whoami.log
      echo `pwd` > /tmp/from.log
      i saw that home is set to /root and script starts as user zabbix from location /
      It's problem in two cases

      • when you try to run from script some programs based on config files in your home directory - zabbix try to get /root directory and has no permission
      • when you try to debug: simple > doesn't work because zabbix usually has no permissions to write in / (and > ~/file.log not working because ~ is /root)

      Temporary solution, add to script:
      export HOME=/real/zabbix/home

      Expected solution: run scripts as zabbix user with zabbix home.

            Assignee:
            Unassigned
            Reporter:
            Artur Zarzycki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: