Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions .github/workflows/build.yml

This file was deleted.

7 changes: 2 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
go-version: '1.24'

- name: Check style
run: make style

- name: Check that we can compile the exporter
run: make build

- name: Check that we can build the docker container
- name: Build Docker container
run: make docker-build
19 changes: 5 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
FROM golang:1.24.2 AS builder

LABEL maintainer="Jennings Liu <[email protected]>"

ARG ARCH=amd64

ENV GOROOT /usr/local/go
ENV GOPATH /go
ENV PATH "$GOROOT/bin:$GOPATH/bin:$PATH"
ENV GO_VERSION 1.15.2
ENV GO111MODULE=on


# Build dependencies
# Build binary
RUN mkdir -p /go/src/github.com/ && \
git clone https://github.com/jenningsloy318/redfish_exporter /go/src/github.com/jenningsloy318/redfish_exporter && \
cd /go/src/github.com/jenningsloy318/redfish_exporter && \
git clone https://github.com/stackhpc/redfish_exporter /go/src/github.com/stackhpc/redfish_exporter && \
cd /go/src/github.com/stackhpc/redfish_exporter && \
make build

FROM golang:1.24.2

COPY --from=builder /go/src/github.com/jenningsloy318/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/build/redfish_exporter /usr/local/bin/redfish_exporter
RUN mkdir /etc/prometheus
COPY config.yml.example /etc/prometheus/redfish_exporter.yml
COPY --from=builder /go/src/github.com/stackhpc/redfish_exporter/config.yml.example /etc/prometheus/redfish_exporter.yml
CMD ["/usr/local/bin/redfish_exporter","--config.file","/etc/prometheus/redfish_exporter.yml"]
26 changes: 0 additions & 26 deletions Dockerfile.Alpine-builder

This file was deleted.

19 changes: 0 additions & 19 deletions Dockerfile.Centos7-builder

This file was deleted.

19 changes: 0 additions & 19 deletions Dockerfile.Centos8-builder

This file was deleted.

37 changes: 7 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ pkgs = ./...

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


all: fmt style build docker-build docker-rpm
all: fmt style build docker-build

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

check_license:
@echo ">> checking license header"
Expand All @@ -32,38 +31,16 @@ check_license:

build: |
@echo ">> building binaries"
$(GO) build -o build/redfish_exporter -ldflags '-X "main.Version=$(VERSION)" -X "main.BuildRevision=$(REVERSION)" -X "main.BuildBranch=$(BRANCH)" -X "main.BuildTime=$(TIME)"'

docker-build-centos7:
$(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"


docker-build-centos8:
$(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"
$(GO) build -o build/redfish_exporter -ldflags '-X "main.Version=$(VERSION)" -X "main.BuildRevision=$(REVISION)" -X "main.BuildBranch=$(BRANCH)" -X "main.BuildTime=$(TIME)"'

docker-build:
make docker-build-centos7
make docker-build-centos8

rpm: | build
@echo ">> building binaries"
$(RPM)

docker-rpm-centos7:
$(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"

docker-rpm-centos8:
$(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"

docker-rpm:
make docker-rpm-centos7
make docker-rpm-centos8
$(DOCKER) build -t stackhpc/redfish_exporter --network=host .

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

clean:
rm -rf $(BIN_DIR)

.PHONY: all style check_license fmt build fmt build rpm docker-build docker-rpm
.PHONY: all style check_license fmt build fmt build rpm docker-build
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# redfish_exporter
A prometheus exporter to get metrics from redfish based servers such as lenovo/dell/Supermicro servers.
A prometheus exporter to get metrics from redfish based servers.

This is a fork of the original project from https://github.com/jenningsloy318/redfish_exporter

## Configuration

Expand Down Expand Up @@ -154,17 +156,6 @@ To build the redfish_exporter executable run the command:
make build
```

or build in centos 7 docker image
```sh
make docker-build-centos7
```

or build in centos 8 docker image
```sh
make docker-build-centos8
```
or we can also build a docker image using [Dockerfile](./Dockerfile)

## Running
- running directly on linux
```sh
Expand Down
Binary file removed REST_API_user_manual.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion collector/chassis_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"sync"

"github.com/apex/log"
"github.com/jenningsloy318/redfish_exporter/common"
"github.com/prometheus/client_golang/prometheus"
"github.com/stackhpc/redfish_exporter/common"
"github.com/stmcginnis/gofish/redfish"
)

Expand Down
2 changes: 1 addition & 1 deletion collector/common_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"sync"

"github.com/apex/log"
redfish_common "github.com/jenningsloy318/redfish_exporter/common"
"github.com/prometheus/client_golang/prometheus"
redfish_common "github.com/stackhpc/redfish_exporter/common"
"github.com/stmcginnis/gofish/common"
"github.com/stmcginnis/gofish/redfish"
)
Expand Down
2 changes: 1 addition & 1 deletion collector/manager_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"sync"

"github.com/apex/log"
"github.com/jenningsloy318/redfish_exporter/common"
"github.com/prometheus/client_golang/prometheus"
"github.com/stackhpc/redfish_exporter/common"
)

// ManagerSubmanager is the manager subsystem
Expand Down
2 changes: 1 addition & 1 deletion collector/redfish_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"time"

alog "github.com/apex/log"
"github.com/jenningsloy318/redfish_exporter/common"
"github.com/prometheus/client_golang/prometheus"
"github.com/stackhpc/redfish_exporter/common"
gofish "github.com/stmcginnis/gofish"
gofishcommon "github.com/stmcginnis/gofish/common"
redfish "github.com/stmcginnis/gofish/redfish"
Expand Down
2 changes: 1 addition & 1 deletion collector/system_collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sync"

"github.com/apex/log"
"github.com/jenningsloy318/redfish_exporter/common"
"github.com/prometheus/client_golang/prometheus"
"github.com/stackhpc/redfish_exporter/common"
"github.com/stmcginnis/gofish/redfish"
)

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/jenningsloy318/redfish_exporter
module github.com/stackhpc/redfish_exporter

go 1.21

Expand Down
23 changes: 0 additions & 23 deletions helm/.helmignore

This file was deleted.

24 changes: 0 additions & 24 deletions helm/Chart.yaml

This file was deleted.

22 changes: 0 additions & 22 deletions helm/templates/NOTES.txt

This file was deleted.

Loading