def parse_inodes(self): """ Parse output of get_inodes(). Returned structure is a dictionary of dictionaries: {device: {'blocks': value, 'used': value, 'free': value, 'percent': value, 'iused': value, 'ifree': value, 'ipercent': value, 'mount': value} } blocks - amount of all 1k blocks used - amount of used disk space in Kb free - amount of free disk space in Kb percent - amount of used disk space in percent iused - amount of used inodes ifree - amount of free inodes ipercent - amount of used inodes in percent mount - mount point """ fields = ("blocks", "used", "free", "percent", "iused", "ifree", "ipercent", "mount") return utils.parser_storage(self.get_inodes(), fields)
def parse_inodes(self): """ Parse ouput of get_inodes(). Returned structure is a dictionary of dictionaries: {device: {'mount': value, 'used': value, 'free': value, 'percent': value} mount - mount point used - amount of used inodes free - amount of free inodes percent - amount of used inodes in percent """ fields = ("used", "free", "percent", "mount") return utils.parser_storage(self.get_inodes(), fields)
def parse_swap(self): ''' Parse output of get_swap(). Returned structure is a dictionary of dictionaries: {path: {'dev': value, 'swaplo': value, 'blocks': value, 'free': value} } path - The path name for the swap area. dev - The major/minor device number in decimal if it is a block special device; zeroes otherwise. swaplo - The swaplow value for the area in 512-byte blocks. blocks - The swaplen value for the area in 512-byte blocks. free - The number of 512-byte blocks in this area that are not currently allocated. ''' fields = ('dev', 'swaplo', 'blocks', 'free') return utils.parser_storage(self.get_swap(), fields)
def parse_fsusage(self): """ Parse output of get_fsusage(). Returned structure is a dictionary of dictionaries: {device: {'mount': value, 'used: value, 'percent': value, 'free': value, 'size': value} } mount - mount point used - amount of used disk space in Kb percent - amount of used disk space in percent free - amount of free disk space in Kb size - amount of all disk space in kB """ fields = ("size", "used", "free", "percent", "mount") return utils.parser_storage(self.get_fsusage(), fields)