mpconntrack

package
v0.30.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExitCodeOK             int = 0
	ExitCodeParseFlagError int = 1 + iota
)

Exit codes are int values that represent an exit code for a particular error.

View Source
const Name string = "mackerel-plugin-conntrack"

Name is executable name of this application.

View Source
const Version string = "0.1.0"

Version is version string of this application.

Variables

View Source
var ConntrackCountPaths = []string{
	"/proc/sys/net/netfilter/nf_conntrack_count",
	"/proc/sys/net/ipv4/netfilter/ip_conntrack_count",
}

ConntrackCountPaths is paths to conntrack_count files.

View Source
var ConntrackMaxPaths = []string{
	"/proc/sys/net/nf_conntrack_max",
	"/proc/sys/net/netfilter/nf_conntrack_max",
	"/proc/sys/net/ipv4/ip_conntrack_max",
	"/proc/sys/net/ipv4/netfilter/ip_conntrack_max",
}

ConntrackMaxPaths is paths to conntrack_max files.

Functions

func CurrentValue

func CurrentValue(paths []string) (n uint64, err error)

CurrentValue returns a value from a file.

func Do

func Do()

Do the plugin

func Exists

func Exists(f string) bool

Exists returns whether file exists or not.

func FindFile

func FindFile(paths []string) (f string, err error)

FindFile returns a first matching file path to search multiple paths.

Types

type CLI

type CLI struct {
	// contains filtered or unexported fields
}

CLI is the object for command line interface.

func (*CLI) Run

func (c *CLI) Run(args []string) int

Run is to parse flags and Run helper (MackerelPlugin) with the given arguments.

type ConntrackPlugin

type ConntrackPlugin struct{}

ConntrackPlugin mackerel plugin for *_conntrack.

func (ConntrackPlugin) FetchMetrics

func (c ConntrackPlugin) FetchMetrics() (map[string]interface{}, error)

FetchMetrics interface for mackerelplugin.

func (ConntrackPlugin) GraphDefinition

func (c ConntrackPlugin) GraphDefinition() map[string]mp.Graphs

GraphDefinition interface for mackerelplugin.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL