Ad Widget

Collapse

Permissions problem with custom script in UserParameter Zabbix 3.2.11

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nuv
    Junior Member
    • Nov 2018
    • 2

    #1

    Permissions problem with custom script in UserParameter Zabbix 3.2.11

    Hello,

    i have following problem when im trying to add custom item in zabbix.

    I created two custom items:

    /etc/zabbix/zabbix_agentd.conf
    UserParameter=used,/etc/zabbix/xen-used-space.sh
    UserParameter=total,/etc/zabbix/xen-total-space.sh

    Permissions for those scripts are (0755/-rwxr-xr-x)

    visudo:
    zabbix ALL=(root) NOPASSWD: /etc/zabbix/xen-used-space.sh
    zabbix ALL=(root) NOPASSWD: /etc/zabbix/xen-total-space.sh

    # zabbix_agentd -t total
    total [t|136.113]

    Error from zabbix server: Item not supported - Timeout while executing a shell script.

    When i trying to run those scripts with zabbix user:

    # sudo -u zabbix /etc/zabbix/xen-used-space.sh
    Authentication failed
    For usage run: 'xe help'
    Authentication failed
    For usage run: 'xe help'

    /etc/zabbix/xen-total-space.sh

    Code:
    #!/bin/bash
    
    used(){
        xe sr-param-list uuid=`xe sr-list params=uuid name-label="Local storage" --minimal` | grep physical-size | awk '{print $4}' | awk '{ byte =$1 /1024/1024/1024; print byte }'
    }
    
    echo "$(used)"
    Any ideas?
  • nuv
    Junior Member
    • Nov 2018
    • 2

    #2
    /etc/sudoers
    Defaults:zabbix !requiretty

    SOLVED

    Comment

    Working...