def psaux(name):
 sanitize_name = str(name)
 pattern = re.compile(sanitize_name)
 salt_exception_pattern = re.compile('salt.+ps.psaux.+')
 ps_aux = __salt__['cmd.run']('ps aux')
 found_infos = []
 ret = []
 nb_lines = 0
 for info in ps_aux.splitlines():
  found = pattern.search(info)
  if (found is not None):
   if (not salt_exception_pattern.search(info)):
    nb_lines += 1
    found_infos.append(info)
 pid_count = (str(nb_lines) + ' occurence(s).')
 ret = []
 ret.extend([sanitize_name, found_infos, pid_count])
 return ret

def psaux ( name ) : sanitize_name = str ( name ) pattern = re . compile ( sanitize_name ) salt_exception_pattern = re . compile ( 'salt.+ps.psaux.+' ) ps_aux = __salt__ [ 'cmd.run' ] ( 'ps aux' ) found_infos = [ ] ret = [ ] nb_lines = 0 for info in ps_aux . splitlines ( ) : found = pattern . search ( info ) if ( found is not None ) : if ( not salt_exception_pattern . search ( info ) ) : nb_lines += 1 found_infos . append ( info ) pid_count = ( str ( nb_lines ) + ' occurence(s).' ) ret = [ ] ret . extend ( [ sanitize_name , found_infos , pid_count ] ) return ret
retrieve information corresponding to a "ps aux" filtered with the given pattern .