Ad Widget

Collapse

External script goes unsupported, then supported, over and over

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chip.maurer
    Junior Member
    • Sep 2016
    • 5

    #1

    External script goes unsupported, then supported, over and over

    I have an external script item configured in my server. It is a shell script that calls a python script, checks the result, then returns the value and exits. It's pretty simple:

    root@zabbix-srv:/etc/zabbix/externalscripts# cat ecs.check.directory_tables.COKE
    #!/bin/bash
    trap '' SIGINT SIGTERM SIGQUIT SIGHUP SIGALRM
    RESULT=`python /etc/zabbix/VS/sanitized-ecs-zabbix/scripts/check_directory_tables.COKE.py`
    echo $RESULT
    if [ "$RESULT" != "0" ]
    then
    exit 1
    else
    exit 0
    fi

    The script takes 10 seconds or so to execute, so I bumped the timeout to 30 seconds. The trigger goes supported/unsupported every 6 to 10 minutes, as seen in the server log:

    2077:20160927:081624.074 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became not supported: Timeout while executing a shell script.
    2072:20160927:082605.490 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became supported
    2072:20160927:083226.360 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became not supported: Timeout while executing a shell script.
    2072:20160927:083606.883 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became supported
    2072:20160927:084623.424 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became not supported: Timeout while executing a shell script.
    2074:20160927:085604.755 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became supported
    2077:20160927:090045.365 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became not supported: Timeout while executing a shell script.
    2076:20160927:090606.100 item "vipr-host-10_247_179_200:ecs.check.directory_tables.COKE["{HOST.CONN}"]" became supported

    So, what's going on? I checked the code, and the 'timeout' error is triggered from an EINTR on a named pipe read from the script run. The server is an Ubuntu 16.04 host, and Zabbix server is 3.2.
  • asteroidyorkton
    Member
    • Aug 2016
    • 53

    #2
    I'd like to add to this about a item which gets timeout only on one server.

    system.users.num
    Not supported: Timeout in logs

    For some reason zabbix_agent processes it for long time, happens like 20 times a day. I've no idea how to find its cause. I've updated the agent too. As soon as I get that not supported email, I test it with zabbix_get and it always gets me result. Only once or twice, I got timeout from zabbix_get.

    Any suggestions are appreciated. Debug logs didn't help. OS logs looks normal. Not sure what to look into to find the cause.
    Last edited by asteroidyorkton; 28-09-2016, 11:56.

    Comment

    • batchenr
      Senior Member
      • Sep 2016
      • 440

      #3
      try to make in /etc/zabbix/zabbix_server.conf
      Timeout=30

      and restart

      Comment

      • chip.maurer
        Junior Member
        • Sep 2016
        • 5

        #4
        Timeout is already set to 30 seconds

        Forgot to mention that I had already set the timeout to max value:

        root@zabbix-srv:/etc/zabbix# grep Timeout *.conf | grep -v '#'
        zabbix_agentd.conf:Timeout=30
        zabbix_server.conf:Timeout=30

        Comment

        • batchenr
          Senior Member
          • Sep 2016
          • 440

          #5
          run your script with time command
          time yourscript.sh to see how much time it takes

          and when you run the script no errors ?
          is it a script with sudo ?

          Comment

          • chip.maurer
            Junior Member
            • Sep 2016
            • 5

            #6
            Generally takes 10-15 seconds

            The script generally takes 10-15 seconds. I suppose it's possible that sometimes it takes more than 30, but it's really unlikely.

            root@zabbix-srv:/etc/zabbix/externalscripts# time ./ecs.check.directory_tables.COKE
            1536

            real 0m11.241s
            user 0m0.108s
            sys 0m0.004s

            Comment

            • asteroidyorkton
              Member
              • Aug 2016
              • 53

              #7
              In my case, timeout is at its max 30 seconds. It shouldn't take more than 2 seconds for that command anyway. Of all the Ubuntu servers only this server fails (system.users.num runs who | wc -l command)

              Comment

              • batchenr
                Senior Member
                • Sep 2016
                • 440

                #8
                maybe try to add debug level to /etc/zabbix/zabbix_server.conf and when it becomes un supported you will get more info.

                if you think the script sometimes takes more then the time out - then here your answer

                or sometimes the script gets an error - i dont know what the script does

                Comment

                • BlackCrystal
                  Junior Member
                  • Dec 2018
                  • 28

                  #9
                  i have this problem too. timeout=30 didnt work. is there anything else i can do?

                  Comment


                  • Atsushi
                    Atsushi commented
                    Editing a comment
                    Items that take longer than 30 seconds can not be acquired as items.

                    Please use cron etc. to output the result to the file and devise the mounting method such as referring to the file as the item. There is also a way to send it to the Zabbix server using the zabbix_sender command.
                Working...