Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
telegraf-nftables
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Show more breadcrumbs
vqgroup
telegraf-nftables
Commits
6a601ceb
Commit
6a601ceb
authored
9 years ago
by
Cameron Sparr
Browse files
Options
Downloads
Patches
Plain Diff
Add support for specifying SSL config for influxdb output
closes #191
parent
8236534e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plugins/outputs/influxdb/influxdb.go
+23
-0
23 additions, 0 deletions
plugins/outputs/influxdb/influxdb.go
plugins/outputs/mqtt/mqtt.go
+2
-1
2 additions, 1 deletion
plugins/outputs/mqtt/mqtt.go
with
25 additions
and
1 deletion
plugins/outputs/influxdb/influxdb.go
+
23
−
0
View file @
6a601ceb
...
...
@@ -28,6 +28,15 @@ type InfluxDB struct {
Timeout
internal
.
Duration
UDPPayload
int
`toml:"udp_payload"`
// Path to CA file
SSLCA
string
`toml:"ssl_ca"`
// Path to host cert file
SSLCert
string
`toml:"ssl_cert"`
// Path to cert key file
SSLKey
string
`toml:"ssl_key"`
// Use SSL but skip chain & host verification
InsecureSkipVerify
bool
conns
[]
client
.
Client
}
...
...
@@ -52,6 +61,13 @@ var sampleConfig = `
# user_agent = "telegraf"
### Set UDP payload size, defaults to InfluxDB UDP Client default (512 bytes)
# udp_payload = 512
### Optional SSL Config
# ssl_ca = "/etc/telegraf/ca.pem"
# ssl_cert = "/etc/telegraf/cert.pem"
# ssl_key = "/etc/telegraf/key.pem"
### Use SSL but skip chain & host verification
# insecure_skip_verify = false
`
func
(
i
*
InfluxDB
)
Connect
()
error
{
...
...
@@ -66,6 +82,12 @@ func (i *InfluxDB) Connect() error {
urls
=
append
(
urls
,
i
.
URL
)
}
tlsCfg
,
err
:=
internal
.
GetTLSConfig
(
i
.
SSLCert
,
i
.
SSLKey
,
i
.
SSLCA
,
i
.
InsecureSkipVerify
)
if
err
!=
nil
{
return
err
}
var
conns
[]
client
.
Client
for
_
,
u
:=
range
urls
{
switch
{
...
...
@@ -94,6 +116,7 @@ func (i *InfluxDB) Connect() error {
Password
:
i
.
Password
,
UserAgent
:
i
.
UserAgent
,
Timeout
:
i
.
Timeout
.
Duration
,
TLSConfig
:
tlsCfg
,
})
if
err
!=
nil
{
return
err
...
...
This diff is collapsed.
Click to expand it.
plugins/outputs/mqtt/mqtt.go
+
2
−
1
View file @
6a601ceb
...
...
@@ -5,11 +5,12 @@ import (
"strings"
"sync"
paho
"git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal"
"github.com/influxdata/telegraf/plugins/outputs"
"github.com/influxdata/telegraf/plugins/serializers"
paho
"git.eclipse.org/gitroot/paho/org.eclipse.paho.mqtt.golang.git"
)
var
sampleConfig
=
`
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment