Added selfcheck support

Should increase agent stability when connected to the network.