I have a script in /usr/local/Extensions. Sometimes takes ~10 seconds to execute, other times it takes ~50ms to execute, just the nature of the data. When it takes a short amount of time, everything is fine, but when it takes ~10s I get:
"Command timed out"
How can I make it respect a 20 second timeout time? I tried the steps at Resolving Command Timed Out Issues ; I set zCommandCommandTimeout to 20 on the device that runs the datasource/command. Does not help. Restarted Zenoss.
zCommandCommandTimeout seems to be referring to "Time in seconds to wait for commands to complete on the remote device."
The Device running the datasource/command is not remote, it doesn't have an IP or represent a real host, it's just a dummy device to bind templates to, does that matter to where I define the timeout? In other words, this datasource is running locally on the zenoss server from the /Extensions directory, using an empty container Device. Where is the setting where I can tell it to timeout in more than 5 seconds?
Verified with zentestcommand, when it takes under 5 seconds, then it works fine, otherwise, command timed out at ~5 seconds.
This turned out to be an illusion. What was happening was that the command was giving "Code: 1 - Msg: General error" ...and not understanding why I went to test the command with zentestcommand, which evidently has its own timeout. Apparently set to 5s by default, but can be adjusted with "-t". Saw the "Command timed out" there and assumed that must have been what was causing "Code: 1 - Msg: General error" when the command ran. Real problem turned out to be a bad exit code being returned from the command.
So for anyone getting "Command Timed Out" from zentestcommand without knowing why, zentestcommand has its own timeout. Looking inside, zentestcommand seems quite different than zencommand. Not convinced it's great test. Up the timeout with -t. For zencommand itself, adjusting zCommandCommandTimeout on the device running the command seems like the proper way to adjust the command timeout.