mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 11:36:51 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
dac91ccd2d | ||
|
88b072f48e | ||
|
dc6df54936 | ||
|
e92e578a98 |
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM golang:1.12-alpine3.10 as builder
|
||||||
|
|
||||||
|
WORKDIR /go/src/vsphere-influxdb-go
|
||||||
|
COPY . .
|
||||||
|
RUN apk --update add --virtual build-deps git
|
||||||
|
RUN go get -d -v ./...
|
||||||
|
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo
|
||||||
|
|
||||||
|
FROM alpine:3.10
|
||||||
|
RUN apk update \
|
||||||
|
&& apk upgrade \
|
||||||
|
&& apk add ca-certificates \
|
||||||
|
&& addgroup -S spock && adduser -S spock -G spock
|
||||||
|
COPY --from=0 /go/src/vsphere-influxdb-go/vsphere-influxdb-go /vsphere-influxdb-go
|
||||||
|
|
||||||
|
USER spock
|
||||||
|
|
||||||
|
CMD ["/vsphere-influxdb-go"]
|
@ -110,7 +110,8 @@ func (vcenter *VCenter) Connect() error {
|
|||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
stdlog.Println("Connecting to vcenter:", vcenter.Hostname)
|
stdlog.Println("Connecting to vcenter:", vcenter.Hostname)
|
||||||
u, err := url.Parse("https://" + vcenter.Username + ":" + vcenter.Password + "@" + vcenter.Hostname + "/sdk")
|
u, err := url.Parse("https://" + vcenter.Hostname + "/sdk")
|
||||||
|
u.User = url.UserPassword(vcenter.Username, vcenter.Password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
errlog.Println("Could not parse vcenter url:", vcenter.Hostname)
|
errlog.Println("Could not parse vcenter url:", vcenter.Hostname)
|
||||||
errlog.Println("Error:", err)
|
errlog.Println("Error:", err)
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"Domain": ".lab",
|
"Domain": ".lab",
|
||||||
|
"RemoveHostDomainName": false,
|
||||||
"Interval": 60,
|
"Interval": 60,
|
||||||
"VCenters": [
|
"VCenters": [
|
||||||
{ "Username": "monitoring", "Password": "monixx", "Hostname": "vcenter-01.dc-01.lab" },
|
{ "Username": "monitoring", "Password": "monixx", "Hostname": "vcenter-01.dc-01.lab" },
|
||||||
|
Loading…
x
Reference in New Issue
Block a user