dmsetup commands - Command dmsetup

Parsers for parsing and extracting data from output of commands related to dmsetup. Parsers contained in this module are:

DmsetupInfo - command dmsetup info -C

class insights.parsers.dmsetup.DmsetupInfo(context, extra_bad_lines=None)[source]

Bases: insights.core.CommandParser

dmsetup info -C command output

Example input:

Name               Maj Min Stat Open Targ Event  UUID
VG00-tmp           253   8 L--w    1    1      0 LVM-gy9uAwD7LuTIApplr2sogbOx5iS0FTax6lLmBji2ueSbX49gxcV76M29cmukQiw4
VG00-home          253   3 L--w    1    1      0 LVM-gy9uAwD7LuTIApplr2sogbOx5iS0FTaxCqXOnbGe2zjhX923dFiIdl1oi7mO9tXp
VG00-var           253   6 L--w    1    2      0 LVM-gy9uAwD7LuTIApplr2sogbOx5iS0FTaxicvyvt67113nTb8vMlGfgdEjDx0LKT2O
VG00-swap          253   1 L--w    2    1      0 LVM-gy9uAwD7LuTIApplr2sogbOx5iS0FTax3Ll2XhOYZkylx1CjOQi7G4yHgrIOsyqG
VG00-root          253   0 L--w    1    1      0 LVM-gy9uAwD7LuTIApplr2sogbOx5iS0FTaxKpnAKYhrYMYMNMwjegkW965bUgtJFTRY
VG00-var_log_audit 253   5 L--w    1    1      0 LVM-gy9uAwD7LuTIApplr2sogbOx5iS0FTaxwQ8R0XWJRm86QX3befq1cHRy47Von6ZW

Example data structure produced:

data = [
  {
    'Stat': 'L--w',
    'Name': 'VG00-tmp',
    'Min': '8',
    'Targ': '1',
    'Maj': '253',
    'Open': '1',
    'Event': '0',
    'UUID': 'LVM-gy9uAwD7LuTIApplr2sogbOx5iS0FTax6lLmBji2ueSbX49gxcV76M29cmukQiw4'
  },...
]
data

List of devices found, in order

Type

list

names

Device names, in order found

Type

list

uuids

UUID

Type

list

by_name

Access to each device by devicename

Type

dict

by_uuid

Access to each device by uuid

Type

dict

info

List of devices found, in order using SetupInfo structure

Type

list

Example

>>> len(setup_info)
6
>>> setup_info.names[0]
'VG00-tmp'
>>> setup_info[1]['Maj']
'253'
>>> setup_info[1]['Stat']
'L--w'
>>> setup_info.info[-1].name
'VG00-var_log_audit'
>>> setup_info.info[-1].major
253
>>> setup_info.info[-1].live_table
True
>>> setup_info.info[-1].readonly
False
parse_content(content)[source]

This method must be implemented by classes based on this class.

class insights.parsers.dmsetup.SetupInfo(name, major, minor, open, segments, events, live_table, inactive_table, suspended, readonly, uuid)

Bases: tuple

Data structure to represent dmsetup information

property events
property inactive_table
property live_table
property major
property minor
property name
property open
property readonly
property segments
property suspended
property uuid