xfs_quota Commands

Parser contains in this module is:

XFSQuotaState - command /sbin/xfs_quota -x -c 'state -gu'

class insights.parsers.xfs_quota.XFSQuotaState(context, extra_bad_lines=None)[source]

Bases: CommandParser

The /sbin/xfs_quota -x -c 'state -gu' command provides information for the xfs quota devices.

group_quota

Dictionary of information for each group quota

Type:

dict

user_quota

Dictionary of information for each user quota

Type:

dict

Sample directory list collected:

User quota state on /sdd (/dev/sdd)
  Accounting: ON
  Enforcement: ON
  Inode: #131 (1 blocks, 1 extents)
Blocks grace time: [7 days]
Blocks max warnings: 5
Inodes grace time: [7 days]
Inodes max warnings: 5
Realtime Blocks grace time: [7 days]
Group quota state on /sdd (/dev/sdd)
  Accounting: OFF
  Enforcement: OFF
  Inode: N/A
Blocks grace time: [--------]
Blocks max warnings: 0
Inodes grace time: [--------]
Inodes max warnings: 0
Realtime Blocks grace time: [--------]
User quota state on /sdb (/dev/sdb)
  Accounting: ON
  Enforcement: ON
  Inode: #131 (2 blocks, 2 extents)
Blocks grace time: [6 days]
Blocks max warnings: 10
Inodes grace time: [6 days]
Inodes max warnings: 5
Realtime Blocks grace time: [6 days]
Group quota state on /sdb (/dev/sdb)
  Accounting: ON
  Enforcement: ON
  Inode: #137 (2 blocks, 2 extents)
Blocks grace time: [7 days]
Blocks max warnings: 5
Inodes grace time: [7 days]
Inodes max warnings: 5
Realtime Blocks grace time: [7 days]

Examples

>>> type(quota_state)
<class 'insights.parsers.xfs_quota.XFSQuotaState'>
>>> len(quota_state.user_quota)
3
>>> quota_state.user_quota['/dev/sdd'] == {'device': '/dev/sdd', 'accounting': 'ON', 'enforcement': 'ON', 'inode': '#131 (1 blocks, 1 extents)', 'blocks_grace_time': '7 days', 'blocks_max_warnings': '5', 'inodes_grace_time': '7 days', 'inodes_max_warnings': '5', 'realtime_blocks_grace_time': '7 days'}
True
parse_content(content)[source]

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