Skip to content

Commit cff8b9d

Browse files
committed
Adopt exporter
- Strip down repo to reduce maintenance - Drop support for Helm chart / Docker Centos build containers / rpms etc
1 parent 0e8e934 commit cff8b9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+24
-2831
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

Dockerfile

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
FROM golang:1.24.2 AS builder
22

3-
LABEL maintainer="Jennings Liu <[email protected]>"
4-
53
ARG ARCH=amd64
64

7-
ENV GOROOT /usr/local/go
8-
ENV GOPATH /go
9-
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
10-
ENV GO_VERSION 1.15.2
11-
ENV GO111MODULE=on
12-
13-
14-
# Build dependencies
5+
# Build binary
156
RUN mkdir -p /go/src/github.com/ && \
16-
git clone https://github.com/jenningsloy318/redfish_exporter /go/src/github.com/jenningsloy318/redfish_exporter && \
17-
cd /go/src/github.com/jenningsloy318/redfish_exporter && \
7+
git clone https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \
8+
cd /go/src/github.com/stackhpc/redfish_exporter && \
189
make build
1910

2011
FROM golang:1.24.2
2112

22-
COPY --from=builder /go/src/github.com/jenningsloy318/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
13+
COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
2314
RUN mkdir /etc/prometheus
24-
COPY config.yml.example /etc/prometheus/redfish_exporter.yml
15+
COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/config.yml.example /etc/prometheus/redfish_exporter.yml
2516
CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"]

Dockerfile.Alpine-builder

Lines changed: 0 additions & 26 deletions
This file was deleted.

Dockerfile.Centos7-builder

Lines changed: 0 additions & 19 deletions
This file was deleted.

Dockerfile.Centos8-builder

Lines changed: 0 additions & 19 deletions
This file was deleted.

Makefile

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,16 @@ pkgs = ./...
88

99
BIN_DIR ?= $(shell pwd)/build
1010
VERSION ?= $(shell cat VERSION)
11-
REVERSION ?=$(shell git log -1 --pretty="%H")
11+
REVISION ?=$(shell git log -1 --pretty="%H")
1212
BRANCH ?=$(shell git rev-parse --abbrev-ref HEAD)
1313
TIME ?=$(shell date --rfc-3339=seconds)
1414
DOCKER := $(shell { command -v podman || command -v docker; } 2>/dev/null)
1515

16-
17-
all: fmt style build docker-build docker-rpm
16+
all: fmt style build docker-build
1817

1918
style:
2019
@echo ">> checking code style"
21-
! $(GOFMT) -d $$(find . -path ./vendor -prune -o -name '*.go' -print) | grep '^'
20+
! $(GOFMT) -d $$(find . -path '*.go' -print) | grep '^'
2221

2322
check_license:
2423
@echo ">> checking license header"
@@ -32,38 +31,16 @@ check_license:
3231

3332
build: |
3433
@echo ">> building binaries"
35-
$(GO) build -o build/redfish_exporter -ldflags '-X "main.Version=$(VERSION)" -X "main.BuildRevision=$(REVERSION)" -X "main.BuildBranch=$(BRANCH)" -X "main.BuildTime=$(TIME)"'
36-
37-
docker-build-centos7:
38-
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos7 /bin/bash -c "yum update -y && make build"
39-
40-
41-
docker-build-centos8:
42-
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos8 /bin/bash -c "yum update -y && make build"
34+
$(GO) build -o build/redfish_exporter -ldflags '-X "main.Version=$(VERSION)" -X "main.BuildRevision=$(REVISION)" -X "main.BuildBranch=$(BRANCH)" -X "main.BuildTime=$(TIME)"'
4335

4436
docker-build:
45-
make docker-build-centos7
46-
make docker-build-centos8
47-
48-
rpm: | build
49-
@echo ">> building binaries"
50-
$(RPM)
51-
52-
docker-rpm-centos7:
53-
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos7 /bin/bash -c "yum update -y && make rpm"
54-
55-
docker-rpm-centos8:
56-
$(DOCKER) run -v `pwd`:/go/src/github.com/jenningsloy318/redfish_exporter -w /go/src/github.com/jenningsloy318/redfish_exporter docker.io/jenningsloy318/prom-builder:centos8 /bin/bash -c "yum update -y && make rpm"
57-
58-
docker-rpm:
59-
make docker-rpm-centos7
60-
make docker-rpm-centos8
37+
$(DOCKER) build -t stackhpc/redfish_exporter --network=host .
6138

6239
fmt:
6340
@echo ">> format code style"
64-
$(GOFMT) -w $$(find . -path ./vendor -prune -o -name '*.go' -print)
41+
$(GOFMT) -w $$(find . -path '*.go' -print)
6542

6643
clean:
6744
rm -rf $(BIN_DIR)
6845

69-
.PHONY: all style check_license fmt build fmt build rpm docker-build docker-rpm
46+
.PHONY: all style check_license fmt build fmt build rpm docker-build

README.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# redfish_exporter
2-
A prometheus exporter to get metrics from redfish based servers such as lenovo/dell/Supermicro servers.
2+
A prometheus exporter to get metrics from redfish based servers.
3+
4+
This is a fork of the original project from https://github.com/jenningsloy318/redfish_exporter
35

46
## Configuration
57

@@ -154,17 +156,6 @@ To build the redfish_exporter executable run the command:
154156
make build
155157
```
156158

157-
or build in centos 7 docker image
158-
```sh
159-
make docker-build-centos7
160-
```
161-
162-
or build in centos 8 docker image
163-
```sh
164-
make docker-build-centos8
165-
```
166-
or we can also build a docker image using [Dockerfile](./Dockerfile)
167-
168159
## Running
169160
- running directly on linux
170161
```sh

REST_API_user_manual.pdf

-1.09 MB
Binary file not shown.

collector/chassis_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"sync"
88

99
"github.com/apex/log"
10-
"github.com/jenningsloy318/redfish_exporter/common"
1110
"github.com/prometheus/client_golang/prometheus"
11+
"github.com/stackhpc/redfish_exporter/common"
1212
"github.com/stmcginnis/gofish/redfish"
1313
)
1414

collector/common_collector.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"sync"
66

77
"github.com/apex/log"
8-
redfish_common "github.com/jenningsloy318/redfish_exporter/common"
98
"github.com/prometheus/client_golang/prometheus"
9+
redfish_common "github.com/stackhpc/redfish_exporter/common"
1010
"github.com/stmcginnis/gofish/common"
1111
"github.com/stmcginnis/gofish/redfish"
1212
)

0 commit comments

Comments
 (0)