Documentation ¶
Index ¶
- Constants
- Variables
- func FixupName(name string) string
- func LookupEnvBool(key string, defaultVal bool) bool
- func LookupEnvInt(key string, defaultVal int) int
- func LookupEnvString(key string, defaultVal string) string
- type Addr
- type AgentId
- type Cid
- type Column
- type Compression
- type CustomColumn
- type Device
- type DeviceData
- type DeviceID
- type DeviceList
- type DeviceMap
- type DeviceMapper
- type DeviceMetricsMetadata
- type DeviceTableMetadata
- type Devices
- type EAPIC
- type EAPIConfig
- type ExtensionSet
- type IPAddr
- type IfaceID
- type IntId
- type Interface
- type InterfaceCapacityBPS
- type InterfaceData
- type InterfaceRow
- type JCHF
- type KentikConfig
- type LastMetadata
- type MerakiConfig
- type MetaValue
- type MetricInfo
- type Mib
- type Oidtype
- type Output
- type OutputContext
- type OutputType
- type Plan
- type Provider
- type SNMPTestWalker
- type SnmpConfig
- type SnmpDeviceConfig
- func (d *SnmpDeviceConfig) AddUserTag(k string, v string)
- func (d *SnmpDeviceConfig) GetTestWalker() SNMPTestWalker
- func (d *SnmpDeviceConfig) GetUserTags() map[string]string
- func (d *SnmpDeviceConfig) InitUserTags(serviceName string)
- func (d *SnmpDeviceConfig) SetTestWalker(w SNMPTestWalker)
- func (d *SnmpDeviceConfig) SetUserTags(in map[string]string)
- func (d *SnmpDeviceConfig) UpdateFrom(old *SnmpDeviceConfig, conf *SnmpConfig)
- type SnmpDeviceMetric
- type SnmpDiscoConfig
- type SnmpGlobalConfig
- type SnmpMetricSet
- type SnmpTrapConfig
- type StringArray
- type TestId
- type TopValue
- type V3SNMP
- type V3SNMPConfig
Constants ¶
const ( AwsSmPrefix = "aws.sm." AWSErrPrefix = "AwsError: " )
const ( AzureKVPrefix = "azure.kv." AzureErrPrefix = "AzureError: " )
const ( GCPSmPrefix = "gcp.sm." GCPErrPrefix = "GCPError: " )
const ( LOGICAL_INTERFACE = "logical" PHYSICAL_INTERFACE = "physical" PollAdjustTime = 5 )
const ( SNMP_GOOD = 1 SNMP_BAD_NO_DATA = 3 SNMP_BAD_DEVICE_ERR = 4 SNMP_BAD_INTERFACE_ERR = 5 SNMP_BAD_POLL_TIMEOUT = 6 SNMP_BAD_INIT_METADATA = 7 SNMP_BAD_INIT_METRICS = 8 SNMP_BAD_FIRST_METRICS_POLL = 9 )
const ( ObjID Oidtype = 1 String = 2 INTEGER = 3 NetAddr = 4 IpAddr = 5 Counter = 6 Gauge = 7 TimeTicks = 8 Counter64 = 11 BitString = 12 Index = 15 Integer32 = 16 )
const ( CompressionNone Compression = "none" CompressionGzip = "gzip" CompressionSnappy = "snappy" CompressionDeflate = "deflate" CompressionNull = "null" KENTIK_EVENT_TYPE = "KFlow" KENTIK_EVENT_SNMP = "KSnmp" KENTIK_EVENT_TRACE = "KTrace" KENTIK_EVENT_SYNTH = "KSynth" KENTIK_EVENT_SNMP_DEV_METRIC = "KSnmpDeviceMetric" KENTIK_EVENT_SNMP_INT_METRIC = "KSnmpInterfaceMetric" KENTIK_EVENT_SNMP_METADATA = "KSnmpInterfaceMetadata" KENTIK_EVENT_SNMP_TRAP = "KSnmpTrap" KENTIK_EVENT_JSON = "KJson" KENTIK_EVENT_KTRANS_METRIC = "KTranslateMetric" KentikAPIToken = "KENTIK_API_TOKEN" KentikAPITimeout = "KENTIK_API_TIMEOUT" IndexVar = "Index" StringPrefix = "ks_" PrivateIP = "Private IP" DropMetric = "DropMetric" AdminStatus = "if_AdminStatus" )
const ( EventOutput OutputType = "event" MetricOutput = "metric" RollupOutput = "rollup" )
const ( InstProvider = "kentik" CollectorName = "ktranslate" SnmpCollector = "snmp" SendBatchDuration = 1 * time.Second DefaultProfileMessage = "Missing matched profile. See overview page for details." SIGUSR1 = syscall.Signal(0xa) // Because windows doesn't have this. SIGUSR2 = syscall.Signal(0xc) // Because windows doesn't have this. PluginSyslog = "ktranslate-syslog" PluginHealth = "ktranslate-health" FloatMS = "float_ms" InvalidEnum = "invalid enum" DeviceTagTable = "KT_Device_Tag" FromLambda = "awslambda" GaugeMetric = "gauge" CountMetric = "count" FromGCP = "gcppubsub" )
const (
UserTagPrefix = "tags."
)
Variables ¶
var ( InputTesting = []*JCHF{ &JCHF{CompanyId: 10, SrcAddr: "10.2.2.1", Protocol: "TCP", DstAddr: "2001:db8::68", Timestamp: 1, L4DstPort: 80, OutputPort: IfaceID(20), EventType: KENTIK_EVENT_TYPE, CustomStr: map[string]string{"foo": "bar"}, CustomInt: map[string]int32{"fooI": 1}, CustomBigInt: map[string]int64{"fooII": 12}, InBytes: 12121, InPkts: 12, OutBytes: 13, OutPkts: 1, SrcEthMac: "90:61:ae:fb:c2:19", avroSet: map[string]interface{}{}}, &JCHF{CompanyId: 10, SrcAddr: "3.2.2.2", InBytes: 1, OutBytes: 12, InPkts: 12, OutPkts: 1, Protocol: "UDP", DstAddr: "2001:db8::69", SrcEthMac: "90:61:ae:fb:c2:20", Timestamp: 2, CustomStr: map[string]string{"tar": "far"}, EventType: KENTIK_EVENT_TYPE, avroSet: map[string]interface{}{}}, } InputTestingSynth = []*JCHF{ &JCHF{CompanyId: 10, SrcAddr: "10.2.2.1", Protocol: "TCP", DstAddr: "2001:db8::68", Timestamp: 1, L4DstPort: 80, OutputPort: IfaceID(20), EventType: KENTIK_EVENT_SYNTH, CustomStr: map[string]string{"foo": "bar"}, CustomInt: map[string]int32{"foo": 1}, CustomBigInt: map[string]int64{"foo": 12}, InBytes: 12121, InPkts: 12, OutBytes: 13, OutPkts: 1, SrcEthMac: "90:61:ae:fb:c2:19", avroSet: map[string]interface{}{}}, } InputTestingSnmp = []*JCHF{ &JCHF{CompanyId: 10, SrcAddr: "10.2.2.1", Protocol: "UDP", DstAddr: "2001:db8::68", Timestamp: 1, L4DstPort: 80, OutputPort: IfaceID(20), EventType: KENTIK_EVENT_SNMP_INT_METRIC, CustomStr: map[string]string{"foo": "bar"}, CustomInt: map[string]int32{"foo": 1}, CustomBigInt: map[string]int64{"foo": 12}, InBytes: 12121, InPkts: 12, OutBytes: 13, OutPkts: 1, SrcEthMac: "90:61:ae:fb:c2:19", avroSet: map[string]interface{}{}}, } )
var ( SNMP_STATUS_MAP = map[int64]string{ SNMP_GOOD: "GOOD", SNMP_BAD_NO_DATA: "BAD: No data", SNMP_BAD_DEVICE_ERR: "BAD: Device Error", SNMP_BAD_INTERFACE_ERR: "BAD: Interface Error", SNMP_BAD_POLL_TIMEOUT: "BAD: Poll Timeout", SNMP_BAD_INIT_METADATA: "BAD: Init Metadata", SNMP_BAD_INIT_METRICS: "BAD: Init Metrics", SNMP_BAD_FIRST_METRICS_POLL: "BAD: Metrics Poll", } )
Functions ¶
func LookupEnvBool ¶
func LookupEnvInt ¶
func LookupEnvString ¶
Types ¶
type Compression ¶
type Compression string
type CustomColumn ¶
type CustomColumn struct { ID uint32 Name string Type string // kt.FORMAT_UINT32 or kt.FORMAT_STRING or kt.FORMAT_ADDR CustomMapValues map[uint32]string }
A CustomColumn corresponds a row in mn_kflow_field, which represents a field in the "Custom" field of a kflow record. This could either be a field we add to most kflow (e.g. i_ult_exit_network_bndry_name), or a "custom dimension" for a company (e.g. c_customer, c_kentik_services, etc.). The CustomMapValues field is filled in with data from mn_flow_tag_kv if it exists, but in a post HSCD (hyper-scale custom dimensions aka hippo tagging) world, these generally won't be there.
type Device ¶
type Device struct { ID DeviceID `json:"id,string"` Name string `json:"device_name"` CompanyID Cid `json:"company_id,string"` DeviceType string `json:"device_type"` DeviceSubtype string `json:"device_subtype"` Description string `json:"device_description"` IP net.IP `json:"ip"` Interfaces map[IfaceID]Interface `json:"-"` AllInterfaces []Interface `json:"all_interfaces"` SendingIps []net.IP `json:"sending_ips"` SampleRate uint32 `json:"device_sample_rate,string"` BgpType string `json:"device_bgp_type"` Plan Plan `json:"plan"` CdnAttr string `json:"cdn_attr"` MaxFlowRate int `json:"max_flow_rate"` Customs []Column `json:"custom_column_data,omitempty"` CustomStr string `json:"custom_columns"` // contains filtered or unexported fields }
A Device represents a device, corresponding to a row in mn_device. It also has all its interfaces attached.
func (*Device) InitUserTags ¶
func (*Device) SetMsgUserTags ¶
func (*Device) SetUserTags ¶
type DeviceData ¶
type DeviceData struct { Manufacturer string `yaml:"manufacturer"` InterfaceData map[string]*InterfaceData `yaml:"interface_data"` DeviceMetricsMetadata *DeviceMetricsMetadata `yaml:"device_metrics_metadata,omitempty"` }
DeviceData holds information about a device, sent via ST, and sent to the portal in writeSNMPWrapper.
type DeviceList ¶
type DeviceList struct {
Devices []Device `json:"devices"`
}
type DeviceMapper ¶
type DeviceMapper struct {
Devices map[DeviceID]map[IfaceID]*InterfaceRow
}
type DeviceMetricsMetadata ¶
type DeviceMetricsMetadata struct { SysName string `yaml:"sys_name,omitempty"` SysObjectID string `yaml:"sys_object_id,omitempty"` SysDescr string `yaml:"sys_descr,omitempty"` SysLocation string `yaml:"sys_location,omitempty"` SysContact string `yaml:"sys_contact,omitempty"` SysServices int `yaml:"sys_services,omitempty"` EngineID string `yaml:"-"` Customs map[string]string CustomInts map[string]int64 Tables map[string]DeviceTableMetadata }
type DeviceTableMetadata ¶
func NewDeviceTableMetadata ¶
func NewDeviceTableMetadata() DeviceTableMetadata
type EAPIC ¶
type EAPIC EAPIConfig // Need a 2nd type alias to avoid stack overflow on parsing.
type EAPIConfig ¶
type EAPIConfig struct { Host string `yaml:"host"` Username string `yaml:"username"` Password string `yaml:"password"` Transport string `yaml:"transport"` Port int `yaml:"port"` // contains filtered or unexported fields }
func (*EAPIConfig) MarshalYAML ¶
func (a *EAPIConfig) MarshalYAML() (interface{}, error)
Make sure that things serialize back to how they were.
func (*EAPIConfig) UnmarshalYAML ¶
func (a *EAPIConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
This lets the config get overriden by a global_v3 string.
type ExtensionSet ¶
type ExtensionSet struct { ExtOnly bool `yaml:"ext_only"` EAPIConfig *EAPIConfig `yaml:"eapi_config,omitempty"` // Arista eAPI. MerakiConfig *MerakiConfig `yaml:"meraki_config,omitempty"` }
Contain various extensions to snmp which can be used to get data.
type IfaceID ¶
type IfaceID IntId
IfaceID denotes interfce id note this is not mn_interface.id but snmp_id, {input,output}_port in flow
type Interface ¶
type Interface struct { ID int64 `json:"id"` DeviceID DeviceID `json:"device_id,string"` DeviceName string `json:"device_name"` DeviceType string `json:"device_type"` SiteID int `json:"site_id"` SnmpID IfaceID `json:"snmp_id,string"` SnmpSpeedMbps int64 `json:"snmp_speed,string"` // unit? TODO: switch to uint64, rename to SnmpSpeedMbps SnmpType int `json:"snmp_type"` SnmpAlias string `json:"snmp_alias"` InterfaceIP string `json:"interface_ip"` InterfaceDescription string `json:"interface_description"` Provider string `json:"provider"` VrfID int64 `json:"vrf_id"` Netmask string `json:"interface_ip_netmask"` Addrs []Addr `json:"secondary_ips"` SiteTitle string `json:"site_title"` SiteCountry string `json:"site_country"` }
An Interface is everything we know about a device's interfaces. It corresponds to a row in mn_interface, joined with information from mn_device and mn_site.
type InterfaceCapacityBPS ¶
type InterfaceCapacityBPS = uint64
InterfaceCapacityBPS denotes capacity of interface in bits per second
type InterfaceData ¶
type InterfaceData struct { IPAddr // embedded AliasAddr []IPAddr `yaml:"alias_address"` Index string `yaml:"index"` Speed uint64 `yaml:"speed"` Description string `yaml:"desc"` Alias string `yaml:"alias"` Type string `yaml:"type"` ExtraInfo map[string]string `yaml:"extra_info"` }
InterfaceData is the metadata we've discovered about an interface during SNMP polling, or from Streaming Telemetry. It's sent *to* the API server as part of a DeviceData.
type InterfaceRow ¶
type InterfaceRow struct { DeviceId uint32 `json:"device_id"` DeviceName string `json:"device_name"` DeviceType string `json:"device_type"` SiteId uint32 `json:"site_id"` SnmpId string `json:"snmp_id"` SnmpSpeed int64 `json:"snmp_speed"` SnmpType uint32 `json:"snmp_type"` SnmpAlias string `json:"snmp_alias"` InterfaceIp string `json:"interface_ip"` InterfaceDescription string `json:"interface_description"` Provider string `json:"provider"` VrfId uint32 `json:"vrf_id"` SiteTitle string `json:"site_title"` SiteCountry string `json:"site_country"` }
type JCHF ¶
type JCHF struct { Timestamp int64 `json:"timestamp"` DstAs uint32 `json:"dst_as"` DstGeo string `json:"dst_geo"` HeaderLen uint32 `json:"header_len"` InBytes uint64 `json:"in_bytes"` InPkts uint64 `json:"in_pkts"` InputPort IfaceID `json:"input_port"` IpSize uint32 `json:"ip_size"` DstAddr string `json:"dst_addr"` SrcAddr string `json:"src_addr"` L4DstPort uint32 `json:"l4_dst_port"` L4SrcPort uint32 `json:"l4_src_port"` OutputPort IfaceID `json:"output_port"` Protocol string `json:"protocol"` SampledPacketSize uint32 `json:"sampled_packet_size"` SrcAs uint32 `json:"src_as"` SrcGeo string `json:"src_geo"` TcpFlags uint32 `json:"tcp_flags"` Tos uint32 `json:"tos"` VlanIn uint32 `json:"vlan_in"` VlanOut uint32 `json:"vlan_out"` NextHop string `json:"next_hop"` MplsType uint32 `json:"mpls_type"` OutBytes uint64 `json:"out_bytes"` OutPkts uint64 `json:"out_pkts"` TcpRetransmit uint32 `json:"tcp_rx"` SrcFlowTags string `json:"src_flow_tags"` DstFlowTags string `json:"dst_flow_tags"` SampleRate uint32 `json:"sample_rate"` DeviceId DeviceID `json:"device_id"` DeviceName string `json:"device_name"` CompanyId Cid `json:"company_id"` DstBgpAsPath string `json:"dst_bgp_as_path"` DstBgpCommunity string `json:"dst_bgp_comm"` SrcBgpAsPath string `json:"src_bpg_as_path"` SrcBgpCommunity string `json:"src_bgp_comm"` SrcNextHopAs uint32 `json:"src_nexthop_as"` DstNextHopAs uint32 `json:"dst_nexthop_as"` SrcGeoRegion string `json:"src_geo_region"` DstGeoRegion string `json:"dst_geo_region"` SrcGeoCity string `json:"src_geo_city"` DstGeoCity string `json:"dst_geo_city"` DstNextHop string `json:"dst_nexthop"` SrcNextHop string `json:"src_nexthop"` SrcRoutePrefix string `json:"src_route_prefix"` DstRoutePrefix string `json:"dst_route_prefix"` SrcSecondAsn uint32 `json:"src_second_asn"` DstSecondAsn uint32 `json:"dst_second_asn"` SrcThirdAsn uint32 `json:"src_third_asn"` DstThirdAsn uint32 `json:"dst_third_asn"` SrcEthMac string `json:"src_eth_mac"` DstEthMac string `json:"dst_eth_mac"` InputIntDesc string `json:"input_int_desc"` OutputIntDesc string `json:"output_int_desc"` InputIntAlias string `json:"input_int_alias"` OutputIntAlias string `json:"output_int_alias"` InputInterfaceCapacity int64 `json:"input_int_capacity"` OutputInterfaceCapacity int64 `json:"output_int_capacity"` InputInterfaceIP string `json:"input_int_ip"` OutputInterfaceIP string `json:"output_int_ip"` CustomStr map[string]string `json:"custom_str,omitempty"` CustomInt map[string]int32 `json:"custom_int,omitempty"` CustomBigInt map[string]int64 `json:"custom_bigint,omitempty"` EventType string `json:"eventType"` Provider Provider `json:"provider"` // Entity type for this data. CustomMetrics map[string]MetricInfo `json:"-"` CustomTables map[string]DeviceTableMetadata `json:"-"` MatchAttr map[string]*regexp.Regexp `json:"-"` // contains filtered or unexported fields }
func (*JCHF) SetIFPorts ¶
type KentikConfig ¶ added in v1.0.0
type LastMetadata ¶
type LastMetadata struct { DeviceInfo map[string]interface{} InterfaceInfo map[IfaceID]map[string]interface{} Tables map[string]DeviceTableMetadata MatchAttr map[string]*regexp.Regexp XtraInfo map[string]MetricInfo }
func (*LastMetadata) GetTableName ¶
func (*LastMetadata) Missing ¶
func (lm *LastMetadata) Missing(new *LastMetadata) []string
func (*LastMetadata) Size ¶
func (lm *LastMetadata) Size() int
type MerakiConfig ¶
type MetricInfo ¶
type MetricInfo struct { Oid string `json:"-"` Mib string `json:"-"` Name string `json:"-"` Profile string `json:"-"` Table string `json:"-"` Format string `json:"-"` Type string `json:"-"` PollDur time.Duration `json:"-"` Tables map[string]bool `json:"-"` }
func (*MetricInfo) GetType ¶
func (m *MetricInfo) GetType() string
type Mib ¶
type Mib struct { Oid string Name string Type Oidtype Extra string Tag string Enum map[string]int64 EnumRev map[int64]string Conversion string Mib string Table string PollDur time.Duration MatchAttr map[string]*regexp.Regexp FromExtended bool OtherTables map[string]bool Format string AllowDup bool // contains filtered or unexported fields }
func (*Mib) IsPollReady ¶
type Output ¶
type Output struct { Body []byte Ctx OutputContext CB func(error) // Called when this is sent to a sink. }
func NewOutputWithProvider ¶
func NewOutputWithProvider(body []byte, prov Provider, stype OutputType) *Output
func (*Output) GetDataType ¶
type OutputContext ¶
type OutputContext struct { Provider Provider Type OutputType }
type OutputType ¶
type OutputType string
type Provider ¶
type Provider string
const ( ProviderRouter Provider = "kentik-router" ProviderDefault Provider = "kentik-default" ProviderVPC Provider = "kentik-vpc" ProviderSynth Provider = "kentik-network-synthetic" ProviderSwitch Provider = "kentik-switch" ProviderFirewall Provider = "kentik-firewall" ProviderUPS Provider = "kentik-ups" ProviderPDU Provider = "kentik-pdu" ProviderIOT Provider = "kentik-iot" ProviderHost Provider = "kentik-host" ProviderAlert Provider = "kentik-alert" ProviderFlowDevice Provider = "kentik-flow-device" ProviderWirelessController Provider = "kentik-wireless-controller" ProviderNas Provider = "kentik-nas" ProviderSan Provider = "kentik-san" ProviderAgent Provider = "kentik-agent" ProviderFibreChannel Provider = "kentik-fibre-channel" ProviderTrapUnknown Provider = "kentik-trap-device" ProviderHttpDevice Provider = "kentik-http" )
type SnmpConfig ¶
type SnmpConfig struct { Devices DeviceMap `yaml:"devices"` Trap *SnmpTrapConfig `yaml:"trap"` Disco *SnmpDiscoConfig `yaml:"discovery"` Global *SnmpGlobalConfig `yaml:"global"` DeviceOrig string `yaml:"-"` }
type SnmpDeviceConfig ¶
type SnmpDeviceConfig struct { DeviceName string `yaml:"device_name"` DeviceIP string `yaml:"device_ip"` Community string `yaml:"snmp_comm,omitempty"` UseV1 bool `yaml:"use_snmp_v1"` V3 *V3SNMPConfig `yaml:"snmp_v3,omitempty"` Debug bool `yaml:"debug"` SampleRate int64 `yaml:"sample_rate,omitempty"` // Used for flow. Port uint16 `yaml:"port,omitempty"` OID string `yaml:"oid"` Description string `yaml:"description"` Checked time.Time `yaml:"last_checked"` MibProfile string `yaml:"mib_profile"` Provider Provider `yaml:"provider"` FlowOnly bool `yaml:"flow_only,omitempty"` PingOnly bool `yaml:"ping_only,omitempty"` UserTags map[string]string `yaml:"user_tags"` DiscoveredMibs []string `yaml:"discovered_mibs,omitempty"` PollTimeSec int `yaml:"poll_time_sec,omitempty"` TimeoutMS int `yaml:"timeout_ms,omitempty"` Retries int `yaml:"retries,omitempty"` EngineID string `yaml:"engine_id,omitempty"` MatchAttr map[string]string `yaml:"match_attributes"` MonitorAdminShut bool `yaml:"monitor_admin_shut"` NoUseBulkWalkAll bool `yaml:"no_use_bulkwalkall"` InstrumentationName string `yaml:"instrumentationName,omitempty"` RunPing bool `yaml:"response_time,omitempty"` Ext *ExtensionSet `yaml:"ext,omitempty"` PingSec int `yaml:"ping_interval_sec,omitempty"` // contains filtered or unexported fields }
func (*SnmpDeviceConfig) AddUserTag ¶
func (d *SnmpDeviceConfig) AddUserTag(k string, v string)
func (*SnmpDeviceConfig) GetTestWalker ¶
func (d *SnmpDeviceConfig) GetTestWalker() SNMPTestWalker
func (*SnmpDeviceConfig) GetUserTags ¶
func (d *SnmpDeviceConfig) GetUserTags() map[string]string
func (*SnmpDeviceConfig) InitUserTags ¶
func (d *SnmpDeviceConfig) InitUserTags(serviceName string)
func (*SnmpDeviceConfig) SetTestWalker ¶
func (d *SnmpDeviceConfig) SetTestWalker(w SNMPTestWalker)
func (*SnmpDeviceConfig) SetUserTags ¶
func (d *SnmpDeviceConfig) SetUserTags(in map[string]string)
func (*SnmpDeviceConfig) UpdateFrom ¶
func (d *SnmpDeviceConfig) UpdateFrom(old *SnmpDeviceConfig, conf *SnmpConfig)
Save any hard coded parts of this profile which might get overriten by an automatic process.
type SnmpDeviceMetric ¶
type SnmpDeviceMetric struct { DeviceMetrics go_metrics.Meter InterfaceMetrics go_metrics.Meter Metadata go_metrics.Meter Errors go_metrics.Meter Fail go_metrics.Gauge Missing go_metrics.Gauge MissingMeta go_metrics.Gauge }
func NewSnmpDeviceMetric ¶
func NewSnmpDeviceMetric(registry go_metrics.Registry, deviceName string) *SnmpDeviceMetric
type SnmpDiscoConfig ¶
type SnmpDiscoConfig struct { Cidrs StringArray `yaml:"cidrs"` IgnoreList StringArray `yaml:"ignore_list"` Debug bool `yaml:"debug"` Ports []int `yaml:"ports"` DefaultCommunities []string `yaml:"default_communities"` UseV1 bool `yaml:"use_snmp_v1"` DefaultV3 *V3SNMPConfig `yaml:"default_v3"` OtherV3s []*V3SNMPConfig `yaml:"other_v3s,omitempty"` AddDevices bool `yaml:"add_devices"` AddAllMibs bool `yaml:"add_mibs"` Threads int `yaml:"threads"` ReplaceDevices bool `yaml:"replace_devices"` NoDedup bool `yaml:"no_dedup_engine_id,omitempty"` CheckAll bool `yaml:"check_all_ips,omitempty"` CidrOrig string `yaml:"-"` IgnoreOrig string `yaml:"-"` }
type SnmpGlobalConfig ¶
type SnmpGlobalConfig struct { PollTimeSec int `yaml:"poll_time_sec"` DropIfOutside bool `yaml:"drop_if_outside_poll"` MibProfileDir string `yaml:"mib_profile_dir"` MibDB string `yaml:"mibs_db"` MibsEnabled []string `yaml:"mibs_enabled"` TimeoutMS int `yaml:"timeout_ms"` Retries int `yaml:"retries"` GlobalV3 *V3SNMPConfig `yaml:"global_v3"` RunPing bool `yaml:"response_time"` PingSec int `yaml:"ping_interval_sec,omitempty"` UserTags map[string]string `yaml:"user_tags"` MatchAttr map[string]string `yaml:"match_attributes"` }
type SnmpMetricSet ¶
type SnmpMetricSet struct { Devices map[string]*SnmpDeviceMetric Mux sync.RWMutex Traps go_metrics.Meter }
func NewSnmpMetricSet ¶
func NewSnmpMetricSet(registry go_metrics.Registry) *SnmpMetricSet
type SnmpTrapConfig ¶
type SnmpTrapConfig struct { Listen string `yaml:"listen"` Community string `yaml:"community"` Version string `yaml:"version"` Transport string `yaml:"transport"` V3 *V3SNMPConfig `yaml:"v3_config"` }
type StringArray ¶
type StringArray []string
func (*StringArray) UnmarshalYAML ¶
func (a *StringArray) UnmarshalYAML(unmarshal func(interface{}) error) error
type V3SNMP ¶
type V3SNMP V3SNMPConfig // Need a 2nd type alias to avoid stack overflow on parsing.
type V3SNMPConfig ¶
type V3SNMPConfig struct { UserName string `yaml:"user_name"` AuthenticationProtocol string `yaml:"authentication_protocol"` AuthenticationPassphrase string `yaml:"authentication_passphrase"` PrivacyProtocol string `yaml:"privacy_protocol"` PrivacyPassphrase string `yaml:"privacy_passphrase"` ContextEngineID string `yaml:"context_engine_id"` ContextName string `yaml:"context_name"` // contains filtered or unexported fields }
func (*V3SNMPConfig) InheritGlobal ¶
func (a *V3SNMPConfig) InheritGlobal() bool
func (*V3SNMPConfig) MarshalYAML ¶
func (a *V3SNMPConfig) MarshalYAML() (interface{}, error)
Make sure that things serialize back to how they were.
func (*V3SNMPConfig) UnmarshalYAML ¶
func (a *V3SNMPConfig) UnmarshalYAML(unmarshal func(interface{}) error) error
This lets the config get overriden by a global_v3 string.