oxidized

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotConfigured = fmt.Errorf("oxidized API URL is not configured")

ErrNotConfigured is returned when Settings.OxidizedApiURL is empty.

View Source
var ErrNotImplemented = errors.New("not implemented")

ErrNotImplemented is returned by GetDevice, which oxidized has no single- device lookup API for - only a full router.db dump (LoadDevices/GetDevices) or a fetch of a device's last stored config (GetDeviceConfig).

Functions

func FetchRemoteConfig

func FetchRemoteConfig(factumConfig *util.ConfigFactum) (*util.ConfigOxidized, error)

FetchRemoteConfig pulls the Oxidized API connection settings from the primary, authenticated with factumConfig.Token (checked against the primary's Settings.FactumApiToken - see web.Controller.checkServiceToken).

func NewOxidizedClient

func NewOxidizedClient(c util.ConfigOxidized) *oxidizedClient

func RemoteClient

func RemoteClient(factumConfig *util.ConfigFactum) (*oxidizedClient, error)

RemoteClient is the FetchRemoteConfig + NewOxidizedClient convenience most callers want.

func SplitNodeFull added in v1.0.3

func SplitNodeFull(nodeFull string) (group, node string)

SplitNodeFull mirrors oxidized-web's node_full parsing: the last '/' separates group from node, so groups themselves may contain slashes.

Types

type Diff added in v1.0.3

type Diff struct {
	Patch   string `json:"patch"`
	Added   int    `json:"added"`
	Removed int    `json:"removed"`
}

Diff is a unified patch between two versions of one node's config.

type FactumOxidizedClient

type FactumOxidizedClient struct {
	Config         *util.ConfigFactum
	OxidizedConfig *util.ConfigOxidized
	Oxidized       *oxidizedClient
}

func NewFactumOxidizedClient

func NewFactumOxidizedClient(config *util.ConfigFactum) (*FactumOxidizedClient, error)

NewFactumOxidizedClient fetches the Oxidized API connection settings and the oxidized-sync settings (router.db path, ignore lists) from the primary over REST - config.Oxidized is never used, since factum2-oxidized typically runs on a different host than the primary and has no local oxidized config of its own (see util.ConfigOxidized's doc comment).

func (*FactumOxidizedClient) Sync

func (foc *FactumOxidizedClient) Sync(reporter jobevent.Reporter) error

Sync fetches devices from the Factum API, filters out those that don't need backup, writes oxidized's router.db, and asks oxidized to reload if anything changed.

type Node added in v1.0.3

type Node struct {
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	IP       string `json:"ip"`
	Group    string `json:"group"`
	Model    string `json:"model"`
	Status   string `json:"status"`
	Time     string `json:"time"`
	Mtime    string `json:"mtime"`
}

Node is one entry from GET /nodes.json after oxidized-web flattens last-status onto the row.

type OxidizedDevice

type OxidizedDevice struct {
	Name  string
	IP    string
	Model string
}

OxidizedDevice is one entry from oxidized's own router.db file.

type Version added in v1.0.3

type Version struct {
	OID     string        `json:"oid"`
	Date    string        `json:"date"`
	Time    string        `json:"time"`
	Author  VersionAuthor `json:"author"`
	Message string        `json:"message"`
}

Version is one git commit that touched a node's config (GET /node/version.json).

type VersionAuthor added in v1.0.3

type VersionAuthor struct {
	Name  string `json:"name"`
	Email string `json:"email"`
}

VersionAuthor is the git committer oxidized recorded for a version.

Jump to

Keyboard shortcuts

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