func getCPUSample() (idle, total uint64) {
	contents, err := ioutil.ReadFile("/proc/stat")
	if err != nil {
		return
	}
	lines := strings.Split(string(contents), "\n")
	for _, line := range lines {
		fields := strings.Fields(line)
		if fields[0] == "cpu" {
			numFields := len(fields)
			for i := 1; i < numFields; i++ {
				val, err := strconv.ParseUint(fields[i], 10, 64)
				if err != nil {
					fmt.Println("Error: ", i, fields[i], err)
				}
				total += val  
				if i == 4 {   
					idle = val
				}
			}
			return
		}
	}
	return
}
getCPUSample helps CPUUsage do its thing. Taken from a stackoverflow:
http://stackoverflow.com/questions/11356330/getting-cpu-usage-with-golang
package checks
import (
	"fmt"
	"github.com/CiscoCloud/distributive/chkutil"
	"github.com/CiscoCloud/distributive/errutil"
	"github.com/CiscoCloud/distributive/fsstatus"
	"github.com/CiscoCloud/distributive/memstatus"
	log "github.com/Sirupsen/logrus"
	"io/ioutil"
	"os"
	"strconv"
	"strings"
	"syscall"
	"time"
)
type MemoryUsage struct{ maxPercentUsed uint8 }
func init() {
    chkutil.Register("MemoryUsage", func() chkutil.Check {
        return &MemoryUsage{}
    })
    chkutil.Register("SwapUsage", func() chkutil.Check {
        return &SwapUsage{}
    })
    chkutil.Register("FreeMemory", func() chkutil.Check {
        return &FreeMemory{}
    })
    chkutil.Register("FreeSwap", func() chkutil.Check {
        return &FreeSwap{}
    })
    chkutil.Register("CPUUsage", func() chkutil.Check {
        return &CPUUsage{}
    })
    chkutil.Register("DiskUsage", func() chkutil.Check {
        return &DiskUsage{}
    })
    chkutil.Register("InodeUsage", func() chkutil.Check {
        return &InodeUsage{}
    })
}
func (chk MemoryUsage) New(params []string) (chkutil.Check, error) {
	if len(params) != 1 {
		return chk, errutil.ParameterLengthError{1, params}
	}
	per, err := strconv.ParseInt(strings.Replace(params[0], "%", "", -1), 10, 8)
	if strings.HasPrefix(params[0], "-") || err != nil {
		return chk, errutil.ParameterTypeError{params[0], "uint8"}
	}
	chk.maxPercentUsed = uint8(per)
	return chk, nil
}
func (chk MemoryUsage) Status() (int, string, error) {
	actualPercentUsed, err := memstatus.FreeMemory("percent")
	if err != nil {
		return 1, "", err
	}
	if actualPercentUsed < int(chk.maxPercentUsed) {
		return errutil.Success()
	}
	msg := "Memory usage above defined maximum"
	slc := []string{fmt.Sprint(actualPercentUsed)}
	return errutil.GenericError(msg, fmt.Sprint(chk.maxPercentUsed), slc)
}
type SwapUsage struct{ maxPercentUsed int8 }
func (chk SwapUsage) ID() string { return "SwapUsage" }
func (chk SwapUsage) New(params []string) (chkutil.Check, error) {
	if len(params) != 1 {
		return chk, errutil.ParameterLengthError{1, params}
	}
	per, err := strconv.ParseInt(strings.Replace(params[0], "%", "", -1), 10, 8)
	if err != nil {
		return chk, errutil.ParameterTypeError{params[0], "positive int8"}
	}
	if per < 0 {
		return chk, errutil.ParameterTypeError{params[0], "positive int8"}
	}
	chk.maxPercentUsed = int8(per)
	return chk, nil
}
func (chk SwapUsage) Status() (int, string, error) {
	actualPercentUsed, err := memstatus.UsedSwap("percent")
	if err != nil {
		return 1, "", err
	}
	if actualPercentUsed < int(chk.maxPercentUsed) {
		return errutil.Success()
	}
	msg := "Swap usage above defined maximum"
	slc := []string{fmt.Sprint(actualPercentUsed)}
	return errutil.GenericError(msg, fmt.Sprint(chk.maxPercentUsed), slc)
}
func freeMemOrSwap(input string, swapOrMem string) (int, string, error) {
	amount, units, err := chkutil.SeparateByteUnits(input)
	if err != nil {
		log.WithFields(log.Fields{
			"err": err.Error(),
		}).Fatal("Couldn't separate string into a scalar and units")
	}
	var actualAmount int
	switch strings.ToLower(swapOrMem) {
	case "memory":
		actualAmount, err = memstatus.FreeMemory(units)
	case "swap":
		actualAmount, err = memstatus.FreeSwap(units)
	default:
		log.Fatalf("Invalid option passed to freeMemoOrSwap: %s", swapOrMem)
	}
	if err != nil {
		return 1, "", err
	} else if actualAmount > amount {
		return errutil.Success()
	}
	msg := "Free " + swapOrMem + " lower than defined threshold"
	actualString := fmt.Sprint(actualAmount) + units
	return errutil.GenericError(msg, input, []string{actualString})
}
type FreeMemory struct{ amount string }
func (chk FreeMemory) New(params []string) (chkutil.Check, error) {
	if len(params) != 1 {
		return chk, errutil.ParameterLengthError{1, params}
	}
	_, _, err := chkutil.SeparateByteUnits(params[0])
	if err != nil {
		return chk, errutil.ParameterTypeError{params[0], "amount"}
	}
	chk.amount = params[0]
	return chk, nil
}
func (chk FreeMemory) Status() (int, string, error) {
	return freeMemOrSwap(chk.amount, "memory")
}
type FreeSwap struct{ amount string }
func (chk FreeSwap) New(params []string) (chkutil.Check, error) {
	if len(params) != 1 {
		return chk, errutil.ParameterLengthError{1, params}
	}
	_, _, err := chkutil.SeparateByteUnits(params[0])
	if err != nil {
		return chk, errutil.ParameterTypeError{params[0], "amount"}
	}
	chk.amount = params[0]
	return chk, nil
}
func (chk FreeSwap) Status() (int, string, error) {
	return freeMemOrSwap(chk.amount, "swap")
}