There are a set of commands in /etc/update-motd.d which are run when a user logs in. The 50-landscape-sysinfo plugin is a symlink to /usr/share/landscape/landscape-sysinfo.wrapper. When this runs we get an indication that there are errors in /var/log/landscape/sysinfo.log. Looking at this log we see errors like this:
2014-06-25 09:35:09,725 ERROR Network plugin raised an exception. Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/landscape/sysinfo/sysinfo.py", line 99, in run result = plugin.run() File "/usr/lib/python2.7/dist-packages/landscape/sysinfo/network.py", line 32, in run for info in self._get_device_info(): File "/usr/lib/python2.7/dist-packages/landscape/lib/network.py", line 161, in get_active_device_info speed, duplex = get_network_interface_speed(sock, interface) File "/usr/lib/python2.7/dist-packages/landscape/lib/network.py", line 242, in get_network_interface_speed raise e IOError: [Errno 22] Invalid argument
Former user commented on 2014-06-25T18:02:34.000-0400 (edited 2017-12-14T12:24:03.216-0500):
The python code for the above exception basically looks like this:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_IP)
speed, duplex = get_network_interface_speed(sock, interface)
speed = -1
try:
fcntl.ioctl(sock, SIOCETHTOOL, packed) # Status ioctl() call
res = status_cmd.tostring()
speed, duplex = struct.unpack('12xHB28x', res)
except IOError as e:
if e.errno == errno.EPERM:
logging.warn("Could not determine network interface speed, "
"operation not permitted.")
elif e.errno != errno.EOPNOTSUPP:
raise e
speed = -1
duplex = False
See this http://stackoverflow.com/questions/2872058/get-link-speed-programmatically and this http://www.linuxjournal.com/node/6908/print for more info about this ioctl.
Former user commented on 2015-04-28T11:59:37.000-0400:
It would be easy to punt on this by returning EOPNOTSUPP for now.