Giter Site home page Giter Site logo

remote_node_exporter's Introduction

remote_node_exporter

a agentless prometheus/node_exporter

Usage

env PORT=9101 SSH_HOST=192.168.2.1 SSH_USER=root SSH_PASS=123456 ./remote_node_exporter

Howto integrate to prometheus/grafana

  1. Download prometheus
mkdir prometheus
sudo mv prometheus /opt/
cd /opt/prometheus

curl -L https://github.com/prometheus/prometheus/releases/download/v2.3.2/prometheus-2.3.2.linux-amd64.tar.gz | tar xvzp --strip-components=1
curl -L https://github.com/phuslu/remote_node_exporter/releases/download/v0.12.0/remote_node_exporter-0.12.0.linux-amd64.tar.gz | tar xvzp --strip-components=1

  1. Configure prometheus.yml
global:
  scrape_interval:     15s
  evaluation_interval: 15s

scrape_configs:
  - job_name: 'remote_node_exporter'
    scheme: 'http'
    static_configs:
      - targets: ['192.168.2.2:10001']
        labels:
          instance: lab.phus.lu
  1. Create systemd services
cat <<EOF >prometheus.service
[Unit]
Description=prometheus

[Service]
WorkingDirectory=/opt/prometheus
ExecStart=/opt/prometheus/prometheus --config.file=/opt/prometheus/prometheus.yml
ExecReload=/bin/kill -HUP \$MAINPID
Restart=always
LimitNOFILE=100000
LimitNPROC=100000

[Install]
WantedBy=multi-user.target
EOF

cat <<EOF >remote-node-exporter.service
[Unit]
Description=prometheus remote node exporter

[Service]
ExecStart=/opt/prometheus/remote_node_exporter --config.file=/opt/prometheus/remote_node_exporter.yml
Restart=always
LimitNOFILE=100000
LimitNPROC=100000

[Install]
WantedBy=multi-user.target
EOF

  1. start monitoring services
sudo systemctl enable $(pwd)/*.service
sudo systemctl start remote-node-exporter
sudo systemctl start prometheus
  1. Install grafana
mkdir grafana
sudo mv grafana /opt/
cd /opt/grafana

curl -L https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-5.2.2.linux-x64.tar.gz | tar xvzp --strip-components=1

cat <<EOF >grafana.service
[Unit]
Description=grafana

[Service]
WorkingDirectory=/opt/grafana
ExecStart=/opt/grafana/bin/grafana-server
ExecReload=/bin/kill -HUP \$MAINPID
Restart=always
LimitNOFILE=100000
LimitNPROC=100000

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable $(pwd)/grafana.service
sudo systemctl start grafana.service

  1. Impport to grafana dashboard
  • Visit http://<your_ip>:9090 to verify prometheus api
  • Import http://<your_ip>:9090 as datasource to grafana server
  • Import grafana_dashboard.json as dashboard to grafana server

remote_node_exporter's People

Stargazers

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

Watchers

 avatar  avatar

remote_node_exporter's Issues

Error index out of range

Hi There,
Thanks for your exporter, it's very useful for me.
But I met an error as below:

2021/10/13 06:33:39 http: panic serving 10.29.81.43:41332: runtime error: index out of range goroutine 1356 [running]: net/http.(*conn).serve.func1(0xc00033a000) /home/phuslu/go.git/src/net/http/server.go:1754 +0xd0 panic(0x8b2ee0, 0xd0f820) /home/phuslu/go.git/src/runtime/panic.go:513 +0x1b9 main.(*Metrics).CollectFilesystem(0xc0004e8090, 0x0, 0x0) /home/phuslu/remote_node_exporter/remote_node_exporter.go:875 +0x18f7 main.(*Metrics).CollectAll(0xc0004e8090, 0xc0004e8090, 0x72, 0x0, 0x0) /home/phuslu/remote_node_exporter/remote_node_exporter.go:976 +0x178 main.main.func1(0x9c8020, 0xc0001c4000, 0xc0004e4000) /home/phuslu/remote_node_exporter/remote_node_exporter.go:1199 +0x7e net/http.HandlerFunc.ServeHTTP(0xc0000856e0, 0x9c8020, 0xc0001c4000, 0xc0004e4000) /home/phuslu/go.git/src/net/http/server.go:1972 +0x44 net/http.(*ServeMux).ServeHTTP(0xd1d840, 0x9c8020, 0xc0001c4000, 0xc0004e4000) /home/phuslu/go.git/src/net/http/server.go:2369 +0x127 net/http.serverHandler.ServeHTTP(0xc0001a21a0, 0x9c8020, 0xc0001c4000, 0xc0004e4000) /home/phuslu/go.git/src/net/http/server.go:2749 +0xab net/http.(*conn).serve(0xc00033a000, 0x9c88e0, 0xc000192080) /home/phuslu/go.git/src/net/http/server.go:1855 +0x646 created by net/http.(*Server).Serve /home/phuslu/go.git/src/net/http/server.go:2859 +0x2f5

Please kindly help me to fix it.
Thank You so much!

Unable to build remote node exporter

OS: ubuntu 14.04
go version go1.7.6 linux/amd64
remote node exporter version:0.4.0


# _/home/mmahajan/remote_node_exporter
./remote_node_exporter.go:995: undefined: os.Executable

ARM release

Hello phuslu!

Is it possible to compile this for ARM devices?
I would like to target some *Pi-s with it.

Broken dependencies while building Dockerfile

Hi,

building your image yields error:

Step 5/11 : RUN go get -d -v github.com/prometheus/common/log
 ---> Running in 79f55f7ea349
go: downloading github.com/prometheus/common v0.32.1
go get: module github.com/prometheus/common@upgrade found (v0.32.1), but does not contain package github.com/prometheus/common/log
The command '/bin/sh -c go get -d -v github.com/prometheus/common/log' returned a non-zero code: 1

Do you plan on updating dependencies?

can we change scrape interval

I am running remote node exporter and node exporter simultaneously but output making difference
In Prometheus is use scrape interval 15s .

Release is not compressed

It seems the file remote_node_exporter-0.12.0.linux-amd64.tar.gz is not compressed with gzip.

You must be missing the z in tar czf ...

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.