proxmox

package
v1.21.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 12 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Proxmox Input Plugin

The proxmox plugin gathers metrics about containers and VMs using the Proxmox API.

Telegraf minimum version: Telegraf 1.16.0

Configuration

[[inputs.proxmox]]
  ## API connection configuration. The API token was introduced in Proxmox v6.2. Required permissions for user and token: PVEAuditor role on /.
  base_url = "https://localhost:8006/api2/json"
  api_token = "USER@REALM!TOKENID=UUID"
  ## Node name, defaults to OS hostname
  # node_name = ""

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  insecure_skip_verify = false

  # HTTP response timeout (default: 5s)
  response_timeout = "5s"
Permissions

The plugin will need to have access to the Proxmox API. An API token must be provided with the corresponding user being assigned at least the PVEAuditor role on /.

Measurements & Fields

  • proxmox
    • status
    • uptime
    • cpuload
    • mem_used
    • mem_total
    • mem_free
    • mem_used_percentage
    • swap_used
    • swap_total
    • swap_free
    • swap_used_percentage
    • disk_used
    • disk_total
    • disk_free
    • disk_used_percentage

Tags

  • node_fqdn - FQDN of the node telegraf is running on
  • vm_name - Name of the VM/container
  • vm_fqdn - FQDN of the VM/container
  • vm_type - Type of the VM/container (lxc, qemu)

Example Output

$ ./telegraf --config telegraf.conf --input-filter proxmox --test
> proxmox,host=pxnode,node_fqdn=pxnode.example.com,vm_fqdn=vm1.example.com,vm_name=vm1,vm_type=lxc cpuload=0.147998116735236,disk_free=4461129728i,disk_total=5217320960i,disk_used=756191232i,disk_used_percentage=14,mem_free=1046827008i,mem_total=1073741824i,mem_used=26914816i,mem_used_percentage=2,status="running",swap_free=536698880i,swap_total=536870912i,swap_used=172032i,swap_used_percentage=0,uptime=1643793i 1595457277000000000
> ...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeDNS added in v1.18.0

type NodeDNS struct {
	Data struct {
		Searchdomain string `json:"search"`
	} `json:"data"`
}

type Proxmox

type Proxmox struct {
	BaseURL         string          `toml:"base_url"`
	APIToken        string          `toml:"api_token"`
	ResponseTimeout config.Duration `toml:"response_timeout"`
	NodeName        string          `toml:"node_name"`

	tls.ClientConfig

	Log telegraf.Logger `toml:"-"`
	// contains filtered or unexported fields
}

func (*Proxmox) Description

func (px *Proxmox) Description() string

func (*Proxmox) Gather

func (px *Proxmox) Gather(acc telegraf.Accumulator) error

func (*Proxmox) Init

func (px *Proxmox) Init() error

func (*Proxmox) SampleConfig

func (px *Proxmox) SampleConfig() string

type ResourceType

type ResourceType string
var (
	QEMU ResourceType = "qemu"
	LXC  ResourceType = "lxc"
)

type VMConfig added in v1.18.0

type VMConfig struct {
	Data struct {
		Searchdomain string `json:"searchdomain"`
		Hostname     string `json:"hostname"`
		Template     int    `json:"template"`
	} `json:"data"`
}

type VMCurrentStats added in v1.18.0

type VMCurrentStats struct {
	Data VMStat `json:"data"`
}

type VMStat added in v1.18.0

type VMStat struct {
	ID        json.Number `json:"vmid"`
	Name      string      `json:"name"`
	Status    string      `json:"status"`
	UsedMem   json.Number `json:"mem"`
	TotalMem  json.Number `json:"maxmem"`
	UsedDisk  json.Number `json:"disk"`
	TotalDisk json.Number `json:"maxdisk"`
	UsedSwap  json.Number `json:"swap"`
	TotalSwap json.Number `json:"maxswap"`
	Uptime    json.Number `json:"uptime"`
	CPULoad   json.Number `json:"cpu"`
}

type VMStats added in v1.18.0

type VMStats struct {
	Data []VMStat `json:"data"`
}

Jump to

Keyboard shortcuts

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