upsd

package
v0.56.0 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

README

UPS (NUT) collector

Overview

This collector monitors Uninterruptible Power Supplies by polling the UPS daemon using the NUT network protocol.

Collected metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

ups

These metrics refer to the UPS unit.

Labels:

Label Description
ups_name UPS name.
battery_type Battery type (chemistry). battery.type variable value.
device_model Device model. device.mode variable value.
device_serial Device serial number. device.serial variable value.
device_manufacturer Device manufacturer. device.mfr variable value.
device_type Device type (ups, pdu, scd, psu, ats). device.type variable value.

Metrics:

Metric Dimensions Unit
upsd.ups_load load percentage
upsd.ups_load_usage load_usage Watts
upsd.ups_status on_line, on_battery, low_battery, high_battery, replace_battery, charging, discharging, bypass, calibration, offline, overloaded, trim_input_voltage, boost_input_voltage, forced_shutdown, other status
upsd.ups_temperature temperature Celsius
upsd.ups_battery_charge charge percentage
upsd.ups_battery_estimated_runtime runtime seconds
upsd.ups_battery_voltage voltage Volts
upsd.ups_battery_voltage_nominal nominal_voltage Volts
upsd.ups_input_voltage voltage Volts
upsd.ups_input_voltage_nominal nominal_voltage Volts
upsd.ups_input_current current Ampere
upsd.ups_input_current_nominal nominal_current Ampere
upsd.ups_input_frequency frequency Hz
upsd.ups_input_frequency_nominal nominal_frequency Hz
upsd.ups_output_voltage voltage Volts
upsd.ups_output_voltage_nominal nominal_voltage Volts
upsd.ups_output_current current Ampere
upsd.ups_output_current_nominal nominal_current Ampere
upsd.ups_output_frequency frequency Hz
upsd.ups_output_frequency_nominal nominal_frequency Hz

Setup

Prerequisites

No action required.

Configuration
File

The configuration file name is go.d/upsd.conf.

The file format is YAML. Generally, the format is:

update_every: 1
autodetection_retry: 0
jobs:
  - name: some_name1
  - name: some_name1

You can edit the configuration file using the edit-config script from the Netdata config directory.

cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/upsd.conf
Options

The following options can be defined globally: update_every, autodetection_retry.

Config options
Name Description Default Required
update_every Data collection frequency. 1
autodetection_retry Re-check interval in seconds. Zero means not to schedule re-check. 0
address UPS daemon address in IP:PORT format. 127.0.0.1:3493 yes
timeout Connection/write/read timeout in seconds. The timeout includes name resolution, if required. 2
Examples
Basic

A basic example configuration.

Config
jobs:
  - name: local
    address: 127.0.0.1:3493
Multi-instance

Note: When you define multiple jobs, their names must be unique.

Collecting metrics from local and remote instances.

Config
jobs:
  - name: local
    address: 127.0.0.1:3493

  - name: remote
    address: 203.0.113.0:3493

Troubleshooting

Debug mode

To troubleshoot issues with the upsd collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
    
  • Switch to the netdata user.

    sudo -u netdata -s
    
  • Run the go.d.plugin to debug the collector:

    ./go.d.plugin -d -m upsd
    

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address  string       `yaml:"address"`
	Username string       `yaml:"username"`
	Password string       `yaml:"password"`
	Timeout  web.Duration `yaml:"timeout"`
}

type Upsd

type Upsd struct {
	module.Base

	Config `yaml:",inline"`
	// contains filtered or unexported fields
}

func New

func New() *Upsd

func (*Upsd) Charts

func (u *Upsd) Charts() *module.Charts

func (*Upsd) Check

func (u *Upsd) Check() bool

func (*Upsd) Cleanup

func (u *Upsd) Cleanup()

func (*Upsd) Collect

func (u *Upsd) Collect() map[string]int64

func (*Upsd) Init

func (u *Upsd) Init() bool

Jump to

Keyboard shortcuts

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