Running a command with a timeout

…and to reopen old wounds…

I’ve encountered cases in several different fixlets where a command issued with “wait” or “waithidden” never completes, leaving the BES client unable to process any further actions. Rather than fixing every possible edge case and update each fixlet/task individually (some of which are default content), I had an RFE to add a client setting to timeout these external processes after a period of time. While I’m waiting on that, I went ahead and built something external that I’m testing out.

Have a look at
https://bigfix.me/fixlet/details/23049
https://bigfix.me/fixlet/details/23048
https://bigfix.me/fixlet/details/23047
https://bigfix.me/analysis/details/2998503

This is a process I’m calling “BESChildKiller”. Currently for Windows-only, it sets up a Scheduled Task that periodically checks for child processes of BESClient.exe. If they exceed a timeout value, the process gets killed (I’m currently testing with a 2-hour timeout; it’s configured by client settings, so you could assign different timeouts on different hosts). There’s also an Analysis to read the logs if any processes have actually been killed. Specific external process names can be excluded (for instance “rbagent.exe” from BigFix OSD can be expected to run for long durations, so we can whitelist this process to avoid killing it).

This is very much Alpha, and very much Use At Your Own Risk. Killing processes can be dangerous. So can running Scheduled Tasks in SYSTEM context.

2 Likes