Griesbacher / nagflux

A connector which copies performancedata from Nagios / Icinga(2) / Naemon to InfluxDB
GNU General Public License v2.0
65 stars 30 forks source link

README up date: go get deprecated #58

Open oswinfox opened 1 year ago

oswinfox commented 1 year ago

Hello guys,

In the README.md file it use go get command when it is deprecated. We have to use go install github.com/griesbacher/nagflux@latest instead.

see got get output:

go get -v -u github.com/griesbacher/nagflux
go: go.mod file not found in current directory or any parent directory.
    'go get' is no longer supported outside a module.
    To build and install a command, use 'go install' with a version,
    like 'go install example.com/cmd@latest'
    For more information, see https://golang.org/doc/go-get-install-deprecation
    or run 'go help get' or 'go help install'.

Cheers

oswinfox commented 1 year ago

When trying to use go install github.com/griesbacher/nagflux@latest command I have this error:

root/gorepo/pkg/mod/github.com/griesbacher/nagflux@v0.4.1/statistics/prometheus.go:109:39: undefined: prometheus.Handler

It seems we should change the prometheus.Handler to promhttp.Handler in the file nagflux/statistics/prometheus.go can someone check this issue?

Captn138 commented 1 year ago

The change you suggest seems to be the right one, also we need to import "github.com/prometheus/client_golang/prometheus/promhttp" as weel.

ebasse-prog commented 1 year ago

I have tis sam problem. I added github.com/prometheus/client_golang/prometheus/promhttp line and display error:

# github.com/griesbacher/nagflux/statistics
./prometheus.go:8:1: could not import github.com/prometheus/client_golang/prometheus/promhttp (open : no such file or directory)

Before, change from: prometheus.Handler to promhttp.Handler in the file nagflux/statistics/prometheus.go not help