iotop for EPEL5
BJ Dierkes
wdierkes at 5dollarwhitebox.org
Mon Sep 14 16:10:01 UTC 2009
Hello all,
Per the EPEL meeting last week we are attempting to get iotop working
for EL5. The issue is that iotop requires Python >= 2.5 in order to
use the builtin netlink support (of the socket module). That said,
there is also a fallback on the '_netlink C module':
From /usr/lib/python2.4/site-packages/iotop/netlink.py:
#------------------------------------------------
try:
# try to use python 2.5's netlink support
_dummysock = socket.socket(socket.AF_NETLINK, socket.SOCK_RAW, 0)
_dummysock.bind((0, 0))
del _dummysock
def _nl_bind(descriptor, addr):
descriptor.bind(addr)
def _nl_getsockname(descriptor):
return descriptor.getsockname()
def _nl_send(descriptor, msg):
descriptor.send(msg)
def _nl_recv(descriptor, bufs=16384):
return descriptor.recvfrom(bufs)
except socket.error:
# or fall back to the _netlink C module
try:
import _netlink
except ImportError:
raise ImportError("This is neither python 2.5 nor is "
"the _netlink C module available!")
def _nl_bind(descriptor, addr):
_netlink.bind(descriptor.fileno(), addr[1])
def _nl_getsockname(descriptor):
return _netlink.getsockname(descriptor.fileno())
def _nl_send(descriptor, msg):
_netlink.send(descriptor.fileno(), msg)
def _nl_recv(descriptor, bufs=16384):
return _netlink.recvfrom(descriptor.fileno(), bufs)
#------------------------------------------------
I can't figure out where the '_netlink C module' would be provided, as
I was hoping to implement that if possible. All Google hits seem to
reference this code.
Any ideas?
---
derks
More information about the epel-devel-list
mailing list