def inodeusage(args=None):
 flags = _clean_flags(args, 'disk.inodeusage')
 cmd = 'df -iP'
 if flags:
  cmd += ' -{0}'.format(flags)
 ret = {}
 out = __salt__['cmd.run'](cmd, python_shell=False).splitlines()
 for line in out:
  if line.startswith('Filesystem'):
   continue
  comps = line.split()
  if (not comps):
   continue
  try:
   if (__grains__['kernel'] == 'OpenBSD'):
    ret[comps[8]] = {'inodes': (int(comps[5]) + int(comps[6])), 'used': comps[5], 'free': comps[6], 'use': comps[7], 'filesystem': comps[0]}
   else:
    ret[comps[5]] = {'inodes': comps[1], 'used': comps[2], 'free': comps[3], 'use': comps[4], 'filesystem': comps[0]}
  except (IndexError, ValueError):
   log.error('Problem parsing inode usage information')
   ret = {}
 return ret

def inodeusage ( args = None ) : flags = _clean_flags ( args , 'disk.inodeusage' ) cmd = 'df -iP' if flags : cmd += ' -{0}' . format ( flags ) ret = { } out = __salt__ [ 'cmd.run' ] ( cmd , python_shell = False ) . splitlines ( ) for line in out : if line . startswith ( 'Filesystem' ) : continue comps = line . split ( ) if ( not comps ) : continue try : if ( __grains__ [ 'kernel' ] == 'OpenBSD' ) : ret [ comps [ 8 ] ] = { 'inodes' : ( int ( comps [ 5 ] ) + int ( comps [ 6 ] ) ) , 'used' : comps [ 5 ] , 'free' : comps [ 6 ] , 'use' : comps [ 7 ] , 'filesystem' : comps [ 0 ] } else : ret [ comps [ 5 ] ] = { 'inodes' : comps [ 1 ] , 'used' : comps [ 2 ] , 'free' : comps [ 3 ] , 'use' : comps [ 4 ] , 'filesystem' : comps [ 0 ] } except ( IndexError , ValueError ) : log . error ( 'Problem parsing inode usage information' ) ret = { } return ret
return inode usage information for volumes mounted on this minion cli example: .