This example has a few tricks:
Piling a few tree widget items based on a string list of host IP address, and each host will get a thread trying to ping the relevant address by:
os.popen('ping -q -c2 '+addr,'r')
Whether the host is available is decided by scanning the resulting file to look for ‘100% packet loss’. The decision will be send within a signal to trigger a specific tree widget item to show up green or red icon. And it uses timer.timeout signal to run all those threads every 30 seconds
Get the source here.