Ad Widget

Collapse

Zabbix 7 / Ubuntu 24.04 - External Scripts

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bradturnbough
    Junior Member
    • Apr 2020
    • 21

    #1

    Zabbix 7 / Ubuntu 24.04 - External Scripts

    Ubuntu 24.04
    Zabbix 7.0.0


    I've noticed some strangeness with external scripts.

    I've been using Zabbix since the good old days of 1.6, so while I wouldn't consider myself a 'expert', I certainly will consider myself more than a 'user'.

    In zabbix, I have an 'external item' setup.

    check-ntp-status.sh[{HOST.IP}]

    It returns either 0 (failure) or 1 (success)


    The script has the following in it:

    output=$(/usr/lib/zabbix/externalscripts/check_ntp_time -H $1)
    if [[ "$output" == *"NTP OK"* ]] ; then
    echo 1
    else
    echo 0
    fi

    From a root session, I can run the script and it executes fine. It takes a grand total of 6 seconds to execute.

    If I modify /etc/passwd for "zabbix" from /usr/sbin/nologin to /bin/bash and then 'su zabbix' I have verified I can also execute this same script (in 8 seconds).

    HOWEVER:
    134516:20240606:194017.372 Failed to execute command "/usr/lib/zabbix/externalscripts/check-ntp-status.sh '10.70.5.100'": Timeout while executing a shell script.

    I have verified I have the Timeout value set to 30 seconds in both zabbix_server.conf and also zabbix_agent.conf. I have restarted the server as well to ensure all settings changes are loaded and being used.

    I for the life of me cannot figure out why this script is timing out. (I have other unrelated external scripts running on this box without issue, so I know the overall functionality is working as it should.

    I'm assuming this is some sort of ENV or PERMS issue, but I dont know what it is.

    I have this same exact setup running in prod (Server 20.04 / Zabbix 6.4) without issue.

    Any ideas?
  • bradturnbough
    Junior Member
    • Apr 2020
    • 21

    #2
    In case someone else comes across this......

    I just figured it out.

    Starting somewhere in a version > 6.4, there is now a screen to define timeouts:

    Administration / General / Timeouts.

    The value I had to modify was: "External Check"

    Dont ask me what the "Timeout=" value does in the agent / server config any more, or why it's even there... seems like duplicated functionality.

    Comment

    • sokeada
      Junior Member
      • Jun 2024
      • 25

      #3
      I think the issue is related to Zabbix 7.0 agent service. I've noticed that most of Zabbix 7 users having issue with Zabbix agent service including me.

      Comment

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

        #4
        Originally posted by bradturnbough
        Dont ask me what the "Timeout=" value does in the agent / server config any more, or why it's even there... seems like duplicated functionality.
        All you need to do is (re)read the docs...
        for agent
        Timeout
        Specifies timeout for communications (in seconds).
        This parameter is used for defining the duration of various communication operations:
        - awaiting a response from Zabbix server;
        - sending requests to Zabbix server, including active checks configuration requests and item data;
        - retrieving log data through logfile or Windows event log monitoring;
        - sending heartbeat messages;
        - also used as a fallback in scenarios where server/proxy older than version 7.0 is sending checks without timeouts.

        Default: 3
        Range: 1-30
        for server
        Timeout
        Specifies how long to wait for connection to proxy, agent, Zabbix web service, or SNMP checks (except SNMP walk[OID] and get[OID] items), in seconds.

        Default: 3
        Range: 1-30

        Comment

        Working...