func (c LinuxPlugin) GraphDefinition() map[string]mp.Graphs {
	var err error
	p := make(map[string]interface{})
	if c.Typemap["all"] || c.Typemap["swap"] {
		err = collectProcVmstat(pathVmstat, &p)
		if err != nil {
			return nil
		}
	}
	if c.Typemap["all"] || c.Typemap["netstat"] {
		err = collectNetworkStat(&p)
		if err != nil {
			return nil
		}
	}
	if c.Typemap["all"] || c.Typemap["diskstats"] {
		err = collectDiskStats(pathSysfs, &p)
		if err != nil {
			return nil
		}
	}
	if c.Typemap["all"] || c.Typemap["proc_stat"] {
		err = collectProcStat(pathStat, &p)
		if err != nil {
			return nil
		}
	}
	if c.Typemap["all"] || c.Typemap["users"] {
		err = collectWho(&p)
		if err != nil {
			return nil
		}
	}
	return graphdef
}
GraphDefinition interface for mackerelplugin
package mplinux
import (
	"bufio"
	"bytes"
	"fmt"
	"io"
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"strconv"
	"strings"
	mp "github.com/mackerelio/go-mackerel-plugin-helper"
	"github.com/urfave/cli"
)
const (
	pathVmstat = "/proc/vmstat"
	pathStat   = "/proc/stat"
	pathSysfs  = "/sys"
)
var collectVirtualDevice = regexp.MustCompile("^fio[a-z]+$")  
var graphdef = map[string]mp.Graphs{}
type LinuxPlugin struct {
	Tempfile string
	Typemap  map[string]bool
}