Documentation
¶
Overview ¶
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. This file is part of cc-lib. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file. additional authors: Holger Obermaier (NHR@KIT)
Index ¶
- Constants
- Variables
- type HttpReceiver
- func (r *HttpReceiver) Close()
- func (r *HttpReceiver) Init(name string, config json.RawMessage) error
- func (r *HttpReceiver) Name() string
- func (r *HttpReceiver) ServerHttp(w http.ResponseWriter, req *http.Request)
- func (r *HttpReceiver) SetSink(sink chan lp.CCMessage)
- func (r *HttpReceiver) Start()
- type HttpReceiverConfig
- type IPMIReceiver
- type IPMIReceiverClientConfig
- type NatsReceiver
- type NatsReceiverConfig
- type PrometheusReceiver
- type PrometheusReceiverConfig
- type ReceiveManager
- type Receiver
- func NewHttpReceiver(name string, config json.RawMessage) (Receiver, error)
- func NewIPMIReceiver(name string, config json.RawMessage) (Receiver, error)
- func NewNatsReceiver(name string, config json.RawMessage) (Receiver, error)
- func NewPrometheusReceiver(name string, config json.RawMessage) (Receiver, error)
- func NewRedfishReceiver(name string, config json.RawMessage) (Receiver, error)
- func NewSampleReceiver(name string, config json.RawMessage) (Receiver, error)
- type ReceiverConfig
- type RedfishReceiver
- type RedfishReceiverClientConfig
- type SampleReceiver
- type SampleReceiverConfig
Constants ¶
const HTTP_RECEIVER_PORT = "8080"
Variables ¶
var AvailableReceivers = map[string]func(name string, config json.RawMessage) (Receiver, error){ "http": NewHttpReceiver, "nats": NewNatsReceiver, }
Functions ¶
This section is empty.
Types ¶
type HttpReceiver ¶
type HttpReceiver struct {
// contains filtered or unexported fields
}
func (*HttpReceiver) Close ¶
func (r *HttpReceiver) Close()
func (*HttpReceiver) Init ¶
func (r *HttpReceiver) Init(name string, config json.RawMessage) error
func (*HttpReceiver) Name ¶
func (r *HttpReceiver) Name() string
Name returns the name of the metric receiver
func (*HttpReceiver) ServerHttp ¶
func (r *HttpReceiver) ServerHttp(w http.ResponseWriter, req *http.Request)
func (*HttpReceiver) Start ¶
func (r *HttpReceiver) Start()
type HttpReceiverConfig ¶
type HttpReceiverConfig struct {
Addr string `json:"address"`
Port string `json:"port"`
Path string `json:"path"`
// Maximum amount of time to wait for the next request when keep-alives are enabled
// should be larger than the measurement interval to keep the connection open
IdleTimeout string `json:"idle_timeout"`
// Controls whether HTTP keep-alives are enabled. By default, keep-alives are enabled
KeepAlivesEnabled bool `json:"keep_alives_enabled"`
// Basic authentication
Username string `json:"username"`
Password string `json:"password"`
// contains filtered or unexported fields
}
type IPMIReceiver ¶ added in v0.2.0
type IPMIReceiver struct {
// contains filtered or unexported fields
}
func (*IPMIReceiver) Close ¶ added in v0.2.0
func (r *IPMIReceiver) Close()
Close receiver: close network connection, close files, close libraries, ...
func (*IPMIReceiver) Name ¶ added in v0.2.0
func (r *IPMIReceiver) Name() string
Name returns the name of the metric receiver
func (*IPMIReceiver) Start ¶ added in v0.2.0
func (r *IPMIReceiver) Start()
type IPMIReceiverClientConfig ¶ added in v0.2.0
type IPMIReceiverClientConfig struct {
// Hostname the IPMI service belongs to
Protocol string // Protocol / tool to use for IPMI sensor reading
DriverType string // Out of band IPMI driver
Fanout int // Maximum number of simultaneous IPMI connections
NumHosts int // Number of remote IPMI devices with the same configuration
IPMIHosts string // List of remote IPMI devices to communicate with
IPMI2HostMapping map[string]string // Mapping between IPMI device name and host name
Username string // User name to authenticate with
Password string // Password to use for authentication
CLIOptions []string // Additional command line options for ipmi-sensors
// contains filtered or unexported fields
}
type NatsReceiver ¶
type NatsReceiver struct {
// contains filtered or unexported fields
}
func (*NatsReceiver) Close ¶
func (r *NatsReceiver) Close()
Close closes the connection to the NATS server
func (*NatsReceiver) Name ¶
func (r *NatsReceiver) Name() string
Name returns the name of the metric receiver
func (*NatsReceiver) Start ¶
func (r *NatsReceiver) Start()
Start subscribes to the configured NATS subject Messages wil be handled by r._NatsReceive
type NatsReceiverConfig ¶
type PrometheusReceiver ¶
type PrometheusReceiver struct {
// contains filtered or unexported fields
}
func (*PrometheusReceiver) Close ¶
func (r *PrometheusReceiver) Close()
func (*PrometheusReceiver) Name ¶
func (r *PrometheusReceiver) Name() string
Name returns the name of the metric receiver
func (*PrometheusReceiver) Start ¶
func (r *PrometheusReceiver) Start()
type ReceiveManager ¶
type ReceiveManager interface {
Init(wg *sync.WaitGroup, receiverConfig json.RawMessage) error
AddInput(name string, rawConfig json.RawMessage) error
AddOutput(output chan lp.CCMessage)
Start()
Close()
}
func New ¶
func New(wg *sync.WaitGroup, receiverConfig json.RawMessage) (ReceiveManager, error)
type Receiver ¶
type Receiver interface {
Start()
Close() // Close / finish metric receiver
Name() string // Name of the metric receiver
SetSink(sink chan lp.CCMessage) // Set sink channel
}
func NewHttpReceiver ¶
func NewHttpReceiver(name string, config json.RawMessage) (Receiver, error)
func NewIPMIReceiver ¶ added in v0.2.0
func NewIPMIReceiver(name string, config json.RawMessage) (Receiver, error)
NewIPMIReceiver creates a new instance of the redfish receiver Initialize the receiver by giving it a name and reading in the config JSON
func NewNatsReceiver ¶
func NewNatsReceiver(name string, config json.RawMessage) (Receiver, error)
NewNatsReceiver creates a new Receiver which subscribes to messages from a NATS server
func NewPrometheusReceiver ¶
func NewPrometheusReceiver(name string, config json.RawMessage) (Receiver, error)
func NewRedfishReceiver ¶ added in v0.2.0
func NewRedfishReceiver(name string, config json.RawMessage) (Receiver, error)
NewRedfishReceiver creates a new instance of the redfish receiver Initialize the receiver by giving it a name and reading in the config JSON
func NewSampleReceiver ¶
func NewSampleReceiver(name string, config json.RawMessage) (Receiver, error)
New function to create a new instance of the receiver Initialize the receiver by giving it a name and reading in the config JSON
type ReceiverConfig ¶
type ReceiverConfig struct {
Addr string `json:"address"`
Port string `json:"port"`
Database string `json:"database"`
Organization string `json:"organization,omitempty"`
Type string `json:"type"`
}
Receiver configuration: Listen address, port
type RedfishReceiver ¶ added in v0.2.0
type RedfishReceiver struct {
// contains filtered or unexported fields
}
RedfishReceiver configuration:
func (*RedfishReceiver) Close ¶ added in v0.2.0
func (r *RedfishReceiver) Close()
Close closes the redfish receiver
func (*RedfishReceiver) Name ¶ added in v0.2.0
func (r *RedfishReceiver) Name() string
Name returns the name of the metric receiver
func (*RedfishReceiver) Start ¶ added in v0.2.0
func (r *RedfishReceiver) Start()
Start starts the redfish receiver
type RedfishReceiverClientConfig ¶ added in v0.2.0
type RedfishReceiverClientConfig struct {
// Hostname the redfish service belongs to
Hostname string
// contains filtered or unexported fields
}
type SampleReceiver ¶
type SampleReceiver struct {
// contains filtered or unexported fields
}
func (*SampleReceiver) Close ¶
func (r *SampleReceiver) Close()
Close receiver: close network connection, close files, close libraries, ...
func (*SampleReceiver) Name ¶
func (r *SampleReceiver) Name() string
Name returns the name of the metric receiver
func (*SampleReceiver) Start ¶
func (r *SampleReceiver) Start()
type SampleReceiverConfig ¶
type SampleReceiverConfig struct {
Addr string `json:"address"`
Port string `json:"port"`
// contains filtered or unexported fields
}
SampleReceiver configuration: receiver type, listen address, port The defaultReceiverConfig contains the keys 'type' and 'process_messages'