Successful monitoring code to watch devices join and leave the network