Ad Widget

Collapse

Error message regarding PATH with zabbix-agent2 on Linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • earendil
    Junior Member
    • Dec 2021
    • 1

    #1

    Error message regarding PATH with zabbix-agent2 on Linux

    Hello,

    I have an error currently with the last version of Zabbix-Agent2 on Linux server.
    The "system.run" and "system.users.num" key seems not working with the following error message:

    Code:
    # zabbix_get -s localhost -k system.users.num
    ZBX_NOTSUPPORTED: Failed to get logged in user count: Cannot execute command: exec: "sh": executable file not found in $PATH.
    But, when I check on the Zabbix Agent configuration, I see nothing that can explain this issue...
    • Systemd service file:
    Code:
    # systemctl cat zabbix-agent2
    # /usr/lib/systemd/system/zabbix-agent2.service
    [Unit]
    Description=Zabbix Agent 2
    After=syslog.target
    After=network.target
    
    [Service]
    Environment="CONFFILE=/etc/zabbix/zabbix_agent2.conf"
    EnvironmentFile=-/etc/sysconfig/zabbix-agent2
    Type=simple
    Restart=on-failure
    PIDFile=/run/zabbix/zabbix_agent2.pid
    KillMode=control-group
    ExecStart=/usr/sbin/zabbix_agent2 -c $CONFFILE
    ExecStop=/bin/kill -SIGTERM $MAINPID
    RestartSec=10s
    User=zabbix
    Group=zabbix
    
    [Install]
    WantedBy=multi-user.target
    
    # /etc/systemd/system/zabbix-agent2.service.d/override.conf
    [Service]
    LimitNOFILE=97816
    • Configuration file (/etc/zabbix/zabbix_agent2.conf):
    Code:
    # grep '^[^#]' /etc/zabbix/zabbix_agent2.conf
    PidFile=/var/run/zabbix/zabbix_agent2.pid
    LogType=system
    LogFile=/var/log/zabbix/zabbix_agent2.log
    LogFileSize=100
    DebugLevel=3
    Server=localhost,10.23.241.219,10.12.100.220
    ListenPort=10050
    StatusPort=9999
    ServerActive=10.23.241.219,10.12.100.220
    Hostname=euhmonp20
    HostMetadataItem=system.uname
    AllowKey=system.run[*]
    RefreshActiveChecks=120
    BufferSend=5
    BufferSize=100
    PersistentBufferPeriod=1h
    Timeout=3
    Include=/etc/zabbix/zabbix_agent2.d
    UnsafeUserParameters=0
    ControlSocket=/tmp/agent.sock
    Did someone has already seen this error? And have perhaps the solution to fixe it?

    Thanks.
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2
    I think Zabbix is using plain "sh" to execute commands. Your error message indicates, it cannot find it. Usually it is a link to bash somewhere.
    "which sh" or "whereis sh" should show you, if it is present and in path... If you can do it as user zabbix. then you should see, if it is found or not.

    Comment

    Working...