Giter Site home page Giter Site logo

smartctl_ssacli_exporter's Introduction

smartctl_ssacli_exporter

Export metric from HP enterprise raid card & disk smartctl with auto detect disk

Flag name Default Value Desc
listen :9633 Exporter listener port && address
metricsPath /metrics URL path for surfacing collected metrics

Usage

./smartctl_ssacli_exporter

Install

Build from source

git clone https://github.com/jakubjastrabik/smartctl_ssacli_exporter.git
go get
go build

Dashboard

Grafana ID: 12587 https://grafana.com/grafana/dashboards/12587

smartctl_ssacli_exporter's People

Contributors

jakubjastrabik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

smartctl_ssacli_exporter's Issues

runtime error: invalid memory address or nil pointer dereference

Hi,
Any guesses what I am missing,
the exporter runs on port 9633, but when i try to curl localhost:9633/metrics, i get the following runtime error

root@compute# jobs
[1]+  Running                 ./smartctl_ssacli_exporter &


root@compute# curl http://localhost:9633/metrics
2022/08/29 16:29:38 http: panic serving 127.0.0.1:36890: runtime error: invalid memory address or nil pointer dereference
goroutine 22 [running]:
net/http.(*conn).serve.func1(0xc00014c780)
        /usr/lib/go/src/net/http/server.go:1772 +0x139
panic(0x917060, 0xe117f0)
        /usr/lib/go/src/runtime/panic.go:975 +0x3e3
github.com/prometheus/client_golang/prometheus.processMetric(0xa67120, 0xc000218e40, 0xc0001b55b8, 0xc0001b55e8, 0x0, 0x0, 0x0)
        /home/jastrabik/go/src/github.com/prometheus/client_golang/prometheus/registry.go:592 +0x51
github.com/prometheus/client_golang/prometheus.(*Registry).Gather(0xc0000e0730, 0x0, 0x0, 0x0, 0x0, 0x0)
        /home/jastrabik/go/src/github.com/prometheus/client_golang/prometheus/registry.go:517 +0xbe0
github.com/prometheus/client_golang/prometheus/promhttp.HandlerFor.func1(0x7f0625d6c118, 0xc00012a7d0, 0xc000154100)
        /home/jastrabik/go/src/github.com/prometheus/client_golang/prometheus/promhttp/http.go:126 +0x93
net/http.HandlerFunc.ServeHTTP(0xc00015e070, 0x7f0625d6c118, 0xc00012a7d0, 0xc000154100)
        /usr/lib/go/src/net/http/server.go:2012 +0x44
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerInFlight.func1(0x7f0625d6c118, 0xc00012a7d0, 0xc000154100)
        /home/jastrabik/go/src/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:40 +0xab
net/http.HandlerFunc.ServeHTTP(0xc00011a990, 0x7f0625d6c118, 0xc00012a7d0, 0xc000154100)
        /usr/lib/go/src/net/http/server.go:2012 +0x44
github.com/prometheus/client_golang/prometheus/promhttp.InstrumentHandlerCounter.func1(0xa6c7c0, 0xc0001640e0, 0xc000154100)
        /home/jastrabik/go/src/github.com/prometheus/client_golang/prometheus/promhttp/instrument_server.go:100 +0xda
net/http.HandlerFunc.ServeHTTP(0xc00011aa80, 0xa6c7c0, 0xc0001640e0, 0xc000154100)
        /usr/lib/go/src/net/http/server.go:2012 +0x44
net/http.(*ServeMux).ServeHTTP(0xe22d20, 0xa6c7c0, 0xc0001640e0, 0xc000154100)
        /usr/lib/go/src/net/http/server.go:2387 +0x1a5
net/http.serverHandler.ServeHTTP(0xc000164000, 0xa6c7c0, 0xc0001640e0, 0xc000154100)
        /usr/lib/go/src/net/http/server.go:2807 +0xa3
net/http.(*conn).serve(0xc00014c780, 0xa6dd80, 0xc000146300)
        /usr/lib/go/src/net/http/server.go:1895 +0x86c
created by net/http.(*Server).Serve
        /usr/lib/go/src/net/http/server.go:2933 +0x35c
curl: (52) Empty reply from server

build fail

go version
go version go1.15 linux/amd64

~/smartctl_ssacli_exporter# go get
cannot find package "github.com/prometheus/common/log" in any of:
/usr/local/go/src/github.com/prometheus/common/log (from $GOROOT)
/root/work/src/github.com/prometheus/common/log (from $GOPATH)

curl returns empty reply from server

Hi @jakubjastrabik
I have installed the smartctl_ssacli_exporter (using the built smartctl_ssacli_exporter binary) in one of the centos 7 machine and trying to curl,
but returs zero values,
can you help what packages it is dependednt on ?, I have installed smartmontools and other ssacli,hpssacli.

appreciate your suggestions

# netstat -lptn |grep smarts
tcp        0      0 0.0.0.0:9633            0.0.0.0:*               LISTEN      55276/smart

# curl http://localhost:9633/metrics -vvv
* About to connect() to localhost port 9633 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9633 (#0)
> GET /metrics HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:9633
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server

Cannot install

Hi,

I've no idea in galang and I have issues with installing this repo on newer system - Debian 12 :

server:/usr/src/smartctl_ssacli_exporter# go get
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'.

go version go1.19.8 linux/amd64

How can I install it ?

Thanks

2 raid contoller in one server

hi
is there any way to star exporter to get data form slot 0 and 1 in the same time ?
i started 2 exporter on different port a get what i need but need to change port in grafana dashboard to

btw good job :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.