def _get_salt_params():
 all_stats = __salt__['status.all_status']()
 all_grains = __salt__['grains.items']()
 params = {}
 try:
  params['name'] = all_grains['id']
  params['hostname'] = all_grains['host']
  if (all_grains['kernel'] == 'Darwin'):
   sd_os = {'code': 'mac', 'name': 'Mac'}
  else:
   sd_os = {'code': all_grains['kernel'].lower(), 'name': all_grains['kernel']}
  params['os'] = json.dumps(sd_os)
  params['cpuCores'] = all_stats['cpuinfo']['cpu cores']
  params['installedRAM'] = str((int(all_stats['meminfo']['MemTotal']['value']) / 1024))
  params['swapSpace'] = str((int(all_stats['meminfo']['SwapTotal']['value']) / 1024))
  params['privateIPs'] = json.dumps(all_grains['fqdn_ip4'])
  params['privateDNS'] = json.dumps(all_grains['fqdn'])
 except KeyError:
  pass
 return params

def _get_salt_params ( ) : all_stats = __salt__ [ 'status.all_status' ] ( ) all_grains = __salt__ [ 'grains.items' ] ( ) params = { } try : params [ 'name' ] = all_grains [ 'id' ] params [ 'hostname' ] = all_grains [ 'host' ] if ( all_grains [ 'kernel' ] == 'Darwin' ) : sd_os = { 'code' : 'mac' , 'name' : 'Mac' } else : sd_os = { 'code' : all_grains [ 'kernel' ] . lower ( ) , 'name' : all_grains [ 'kernel' ] } params [ 'os' ] = json . dumps ( sd_os ) params [ 'cpuCores' ] = all_stats [ 'cpuinfo' ] [ 'cpu cores' ] params [ 'installedRAM' ] = str ( ( int ( all_stats [ 'meminfo' ] [ 'MemTotal' ] [ 'value' ] ) / 1024 ) ) params [ 'swapSpace' ] = str ( ( int ( all_stats [ 'meminfo' ] [ 'SwapTotal' ] [ 'value' ] ) / 1024 ) ) params [ 'privateIPs' ] = json . dumps ( all_grains [ 'fqdn_ip4' ] ) params [ 'privateDNS' ] = json . dumps ( all_grains [ 'fqdn' ] ) except KeyError : pass return params
try to get all sort of parameters for server density server info .