Dcbtool - Command /sbin/dcbtool gc {interface} dcb

Parse Lines from the dcbtool gc eth1 dcb to check DCBX if enabled

Successful completion of the command returns data similar to:

Command:    Get Config
Feature:    DCB State
Port:       eth0
Status:     Off
DCBX Version: FORCED CIN

The keys in this data are converted to lower case and spaces are converted to underscores.

An is_on attribute is also provided to indicate if the status is ‘On’.

Examples:

>>> dcbstate = shared[Dcbtool]
>>> dcb.data
{
    "command": "Get Config",
    "feature": "DCB State",
    "port": "eth0",
    "status": "Off"
    "dcbx_version":"FORCED CIN"
}
>>> dcb['port']
'eth0'
>>> dcb['state']
'Off'
>>> dcb.is_on
False

If a “Connection refused” error is encountered, an empty dictionary is returned`.

class insights.parsers.dcbtool_gc_dcb.Dcbtool(context, extra_bad_lines=None)[source]

Bases: insights.core.LegacyItemAccess, insights.core.CommandParser

Parse the output of the dcbtool command.

If the command output contains ‘Connection refused’, no data is stored. The LegacyItemAccess mixin class is used to provide direct access to the data.

data

A dictionary of the content of the command output.

Type

dict

is_on

(bool): Is the status of the interface ‘On’?

parse_content(content)[source]

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