code: func (c *cmd) captureStatic() error {
  	// Collect errors via multierror as we want to gracefully
  	// fail if an API is inacessible
  	var errors error
  
  	// Collect the named outputs here
  	outputs := make(map[string]interface{}, 0)
  
  	// Capture host information
  	if c.configuredTarget("host") {
  		host, err := c.client.Agent().Host()
  		if err != nil {
  			errors = multierror.Append(errors, err)
  		}
  		outputs["host"] = host
  	}
  
  	// Capture agent information
  	if c.configuredTarget("agent") {
  		agent, err := c.client.Agent().Self()
  		if err != nil {
  			errors = multierror.Append(errors, err)
  		}
  		outputs["agent"] = agent
  	}
  
  	// Capture cluster members information, including WAN
  	if c.configuredTarget("cluster") {
  		members, err := c.client.Agent().Members(true)
  		if err != nil {
  			errors = multierror.Append(errors, err)
  		}
  		outputs["cluster"] = members
  	}
  
  	// Write all outputs to disk as JSON
  	for output, v := range outputs {
  		marshaled, err := json.MarshalIndent(v, "", "\t")
  		if err != nil {
  			errors = multierror.Append(errors, err)
  		}
  
  		err = ioutil.WriteFile(fmt.Sprintf("%s/%s.json", c.output, output), marshaled, 0644)
  		if err != nil {
  			errors = multierror.Append(errors, err)
  		}
  	}
  
  	return errors
  }
docs: // captureStatic captures static target information and writes it
  // to the output path