fkie_node_manager_daemon: catch error if no net_if_stats available
@@ -58,6 +58,7 @@ class NetLoad(SensorInterface):
self.settings = settings
def check_sensor(self):
+ try:
net_stats = psutil.net_if_stats()
net = psutil.net_io_counters(pernic=True)
diag_level = 0
@@ -117,3 +118,8 @@ class NetLoad(SensorInterface):
self._stat_msg.level = diag_level
self._stat_msg.values = diag_vals
self._stat_msg.message = diag_msg
+ except Exception as error:
+ import traceback
+ print(traceback.format_exc())
+ rospy.logwarn("Sensor network not checked because of error: %s" % utf8(error))
+ self._interval = 0
