Ad Widget

Collapse

Permission denied issue custom event using UserParameter

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dreas
    Member
    • Aug 2007
    • 89

    #1

    Permission denied issue custom event using UserParameter

    I have recently setup Zabbix (1.4.1) and so far things are going quite well. I tried however to add a custom event to monitor one of our programs but encounter permission issues.

    In /etc/zabbix/zabbix_agentd.conf I added:
    UserParameter=mysoftware.status,/home/me/mysoftware.py

    mysoftware.py calls an external program "test". I have added the user "zabbix" to the group allowed to run "test".

    I changed to the user zabbix (su -s /bin/bash zabbix), and ran "zabbix_agent -t mysoftware.status -c /etc/zabbix/zabbix_agentd.conf". This works fine, no error message.

    However when restarting the zabbix-agentd service (/etc/init.d/zabbix-agent restart) I get in in /var/log/zabbix-agent/zabbix_agentd.log:
    /var/run/test/test-socket: Permission denied

    Any clues on how to fix this? What am I doing wrong? I encounter the same issue with another program (similar setup however).

    Why does the test from the command line work but not from the agent?
  • JonB
    Member
    • Oct 2006
    • 63

    #2
    Originally posted by dreas
    However when restarting the zabbix-agentd service (/etc/init.d/zabbix-agent restart) I get in in /var/log/zabbix-agent/zabbix_agentd.log:
    /var/run/test/test-socket: Permission denied
    This says it all. The user zabbix does not have permission to write to /var/run/test/test-socket.

    You will need to use sudo

    UserParameter=mysoftware.status,sudo /home/me/mysoftware.py

    Add user user zabbix to /etc/sudoers

    zabbix ALL=NOPASSWD: /var/run/test/test-socket

    Jon

    Comment

    • dreas
      Member
      • Aug 2007
      • 89

      #3
      Thanks for the reply. I was trying to avoid using sudo. Why does the command work fine if I su to the zabbix user and run the test? I should encounter the same issue then?

      Comment

      Working...