| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | package snmp |
| 4 | |
| 5 | import ( |
| 6 | "github.com/netdata/netdata/go/plugins/plugin/framework/vnodes" |
| 7 | "github.com/netdata/netdata/go/plugins/plugin/go.d/pkg/pinger" |
| 8 | ) |
| 9 | |
| 10 | type ( |
| 11 | Config struct { |
| 12 | UpdateEvery int `yaml:"update_every,omitempty" json:"update_every"` |
| 13 | Hostname string `yaml:"hostname" json:"hostname"` |
| 14 | |
| 15 | Community string `yaml:"community,omitempty" json:"community"` |
| 16 | User UserConfig `yaml:"user,omitempty" json:"user"` |
| 17 | Options OptionsConfig `yaml:"options,omitempty" json:"options"` |
| 18 | |
| 19 | CreateVnode bool `yaml:"create_vnode,omitempty" json:"create_vnode"` |
| 20 | VnodeDeviceDownThreshold int `yaml:"vnode_device_down_threshold,omitempty" json:"vnode_device_down_threshold"` |
| 21 | Vnode vnodes.VirtualNode `yaml:"vnode,omitempty" json:"vnode"` |
| 22 | |
| 23 | ManualProfiles []string `yaml:"manual_profiles,omitempty" json:"manual_profiles"` |
| 24 | |
| 25 | PingOnly bool `yaml:"ping_only,omitempty" json:"ping_only"` |
| 26 | Ping PingConfig `yaml:"ping,omitempty" json:"ping"` |
| 27 | } |
| 28 | |
| 29 | PingConfig struct { |
| 30 | Enabled bool `yaml:"enabled" json:"enabled"` |
| 31 | pinger.ProbeConfig `yaml:",inline" json:",inline"` |
| 32 | } |
| 33 | |
| 34 | UserConfig struct { |
| 35 | Name string `yaml:"name,omitempty" json:"name"` |
| 36 | SecurityLevel string `yaml:"level,omitempty" json:"level"` |
| 37 | AuthProto string `yaml:"auth_proto,omitempty" json:"auth_proto"` |
| 38 | AuthKey string `yaml:"auth_key,omitempty" json:"auth_key"` |
| 39 | PrivProto string `yaml:"priv_proto,omitempty" json:"priv_proto"` |
| 40 | PrivKey string `yaml:"priv_key,omitempty" json:"priv_key"` |
| 41 | ContextName string `yaml:"context_name,omitempty" json:"context_name"` |
| 42 | } |
| 43 | OptionsConfig struct { |
| 44 | Port int `yaml:"port,omitempty" json:"port"` |
| 45 | Retries int `yaml:"retries" json:"retries"` |
| 46 | Timeout int `yaml:"timeout,omitempty" json:"timeout"` |
| 47 | Version string `yaml:"version,omitempty" json:"version"` |
| 48 | MaxOIDs int `yaml:"max_request_size,omitempty" json:"max_request_size"` |
| 49 | MaxRepetitions int `yaml:"max_repetitions,omitempty" json:"max_repetitions"` |
| 50 | } |
| 51 | ) |
| 52 | |
| 53 | type ( |
| 54 | ChartConfig struct { |
| 55 | ID string `yaml:"id" json:"id"` |
| 56 | Title string `yaml:"title" json:"title"` |
| 57 | Units string `yaml:"units" json:"units"` |
| 58 | Family string `yaml:"family" json:"family"` |
| 59 | Type string `yaml:"type" json:"type"` |
| 60 | Priority int `yaml:"priority" json:"priority"` |
| 61 | IndexRange []int `yaml:"multiply_range,omitempty" json:"multiply_range"` |
| 62 | Dimensions []DimensionConfig `yaml:"dimensions" json:"dimensions"` |
| 63 | } |
| 64 | DimensionConfig struct { |
| 65 | OID string `yaml:"oid" json:"oid"` |
| 66 | Name string `yaml:"name" json:"name"` |
| 67 | Algorithm string `yaml:"algorithm" json:"algorithm"` |
| 68 | Multiplier int `yaml:"multiplier" json:"multiplier"` |
| 69 | Divisor int `yaml:"divisor" json:"divisor"` |
| 70 | } |
| 71 | ) |