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.
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.
Comment