def _execute_pillar(pillar_name, run_type):
 groups = __salt__['pillar.get'](pillar_name)
 data = {}
 for group in groups:
  data[group] = {}
  commands = groups[group]
  for command in commands:
   if isinstance(command, dict):
    plugin = next(six.iterkeys(command))
    args = command[plugin]
   else:
    plugin = command
    args = ''
   command_key = _format_dict_key(args, plugin)
   data[group][command_key] = run_type(plugin, args)
 return data

def _execute_pillar ( pillar_name , run_type ) : groups = __salt__ [ 'pillar.get' ] ( pillar_name ) data = { } for group in groups : data [ group ] = { } commands = groups [ group ] for command in commands : if isinstance ( command , dict ) : plugin = next ( six . iterkeys ( command ) ) args = command [ plugin ] else : plugin = command args = '' command_key = _format_dict_key ( args , plugin ) data [ group ] [ command_key ] = run_type ( plugin , args ) return data
run one or more nagios plugins from pillar data and get the result of run_type the pillar have to be in this format: webserver: ping_google: - check_icmp: 8 .