Ad Widget

Collapse

UserParameter timing out

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cptnzod
    Member
    • Jan 2007
    • 56

    #1

    UserParameter timing out

    I am checking the server-status in an apache server with a simple wget script which times out. My script supposedly returns a 1 or 0. The issue is that the agent times out and I do not get any return value. I increased the agent timeout to 27 seconds but I am not getting an answer back yet. I changed the trigger to check if it is not a 1 i.e. <> 1 but still the agent time out is killing me. How do I get around that? I need to get a value back.

    here is my script:
    /usr/bin/wget -t 1 --delete-after http://$1/server-status 2>&1 | grep "200 OK" > /dev/null
    if [ $? -gt 0 ];then
    echo 0
    exit 1
    else
    echo 1
    exit 0
    fi
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #2
    Greetings,
    Originally posted by cptnzod
    I changed the trigger to check if it is not a 1 i.e. <> 1 but still the agent time out is killing me. How do I get around that? I need to get a value back.
    Right off the bat, I would log on the agent server as the Zabbix user and attempt to run the script. Find out how long that takes. If it is more than 3 seconds, then you will need to change the server's timeout to support it. By default, the Zabbix Server is configured to time out agent queries at 5 seconds. If the script takes more than 5 seconds, what you should do instead is run the script in a cron job, outputting the data into a temp file. Then have the Zabbix Agent pull the data from the temp file instead.
    Unofficial Zabbix Developer

    Comment

    • cptnzod
      Member
      • Jan 2007
      • 56

      #3
      Thank you ver much for the info. I increased the server timeout and it solved the problem. I will consider doing it out of cron as well.

      Comment

      Working...