mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 11:36:51 +00:00
Compare commits
No commits in common. "master" and "v0.8.5" have entirely different histories.
18
Dockerfile
18
Dockerfile
@ -1,18 +0,0 @@
|
|||||||
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,8 +110,7 @@ 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.Hostname + "/sdk")
|
u, err := url.Parse("https://" + vcenter.Username + ":" + vcenter.Password + "@" + 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,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"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