LsMod - command /sbin/lsmod¶

This parser reads the output of /sbin/lsmod into a dictionary, keyed on the module name. Each item is a dictionary with three keys:

• size - the size of the module’s memory footprint in bytes

• depnum - the number of modules dependent on this module

• deplist - the list of dependent modules as presented (i.e. as a string)

This dictionary is available in the data attribute.

The parser also provides pseudo-dictionary access so it can be checked for the existence of a module or module data retrieved as if it was a dictionary.

Sample input:

Module                  Size  Used by
xt_CHECKSUM            12549  1
tun                    27141  3
ip6t_rpfilter          12546  1


Examples

>>> modules = shared[LsMod]
>>> 'ip6t_rpfilter' in modules
True
>>> 'bridge' in modules
False
>>> modules['tun']['deplist']
''

class insights.parsers.lsmod.LsMod(context, extra_bad_lines=None)[source]
Parse the output of /sbin/lsmod.
parse_content(content)[source]